The backward hook as is is essentially the same as a backward hook on the output variable. If you have a non-trivial module (i.e. one which performs more than one operation) then you won’t get input gradients of the module, but those of the last operation in the module.
Best regards
Thomas