How to access input/output activations of a layer given its parameters names?

This approach might work to register hooks for all modules.

  1. 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.

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