Why we dont need to call net.forward(input)

Hi all,
I 'm a noob in pytorch and going over the tutorial for some time. One think I could’nt understand is that
how it is possible to use net(input) instead of net.forward(input)

thanks for answers

1 Like

When you call your model directly, the internal __call__ function is called (source code).
This function registers the hooks and calls forward.
So you should always call the model directly and not model.forward().

6 Likes