Hi,
First you should be careful and not rely on the result of register_backward_hook. You can see in the documentation a warning stating that it can return wrong results at the moment.
I would first remove these from your code.
Otherwise, the gradient for a convolution wrt input is given by a convtranspose of the gradient of the output with the weights of the original convolution.