You should avoid calling Module.forward
.
The difference is that all the hooks are dispatched in the __call__
function, so if you call .forward
and have hooks in your model, the hooks won’t have any effect
18 Likes