torch.nn.Module.register_full_backward_pre_hook
Module.register_full_backward_pre_hook(hook: BackwardPreHook): RemovableHandleRegister a full backward pre-hook on this module. The hook will be called before the backward pass.
Parameters
hookBackwardPreHook- Function called with (module, gradOutput)
Returns
RemovableHandle– Handle to remove the hook