This approach 600 might work to register hooks for all modules.


If you are using out of place activations, the output will non-linearity will be applied on the input and will return the output you could clone into your dict. However, if you are using inplace=True, note that also the input will be manipulated in-place.


Yes, you can pass any module (containing other submodules) and register the hook to this outer output.