forwards plays the same role as __call__ does for a regular python class.
Basically when you run model(input) this calls internally forward + some extra code around this function to add functionalities.
This way they pytorch ensures you don’t rewrite __call__ but an undefined method: forward.
Any custom module that you write (anything which inherits from a nn.Module) needs to define this function. Official layers already define  it.