How should be used register_forward_hook?

No, this is the exact reason why you should call the module directly instead of its .forward pass, as e.g. hooks will be skipped otherwise.

3 Likes