Got it, but will register_backward_hook affect the grad_in of the module? I am correctly placing the hook in the first layer where it should be, the gradient flowing in should be the shape of the image [1, 3, 224, 224] but both grad_in and grad_out are [1, 64, 224, 224] any tips for this?