You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should update the docs to recommend usage of self(x) for calculating the forward pass rather than self.forward(x). Calling forward() directly can cause issues when you're using PyTorch model hooks (eg. see the additional logic in nn.Module.__call__).
Although most people don't play around with hooks and using self.forward() will work fine for them, we should probably follow the best practice (as I understand) of using __call__ for calculating forward passes.
📚 Documentation
We should update the docs to recommend usage of
self(x)
for calculating the forward pass rather thanself.forward(x)
. Callingforward()
directly can cause issues when you're using PyTorch model hooks (eg. see the additional logic innn.Module.__call__
).Although most people don't play around with hooks and using
self.forward()
will work fine for them, we should probably follow the best practice (as I understand) of using__call__
for calculating forward passes.Related issues: #632
The text was updated successfully, but these errors were encountered: