I’m working on a project which requires me to get input and output tensors of intermediate layers for further analysis. However, I want to get them in backpropagation process for the convenience of analysis, although they are calculated in forward process.
The register_backward_hook function might be useful, but it only return grad_input and grad_output tensors, which are not the tensors I want. Can anyone give some advice to me? Any information will be appreciated.