Thank you @ptrblck for your response. I have read the link that you sent and I have a follow up question. What is the difference between grad_out as a result of registering register_full_backward_hook on a module such as conv2d and A.register_hook() (A as a output of a module that is called activation)? Are both equal but come from different modules?
My purpose is computing the gradient respect to the outputs of filters in a specific layer. Which one of these functions, register_full_backward_hook or register_hook on a tensor do you suggest?
Thank you in advance for your attention given to my problem.