Equivalent of register forward hook for parameters?

I have some custom parameters that I want to log the outputs for. How do I setup the forward hook akin to module.register_forward_hook?

If you are dealing with modules, you could use this code example.
I’m not sure what you mean by “custom parameters”, as parameters won’t have an output without any operation.

@ptrblck I mean, I have a parameter within a module and I want to see it’s forward activation separately from the module’s forward hook.

Could you wrap the operation involving this parameter in a custom module and register the forward hook?

I assume you are performing some operation using this parameter in your forward method.
If so, you could also return/store the output of this operation.

1 Like