parameters: (
          self, hook: Callable[['Module', _grad_t, _grad_t], Union[None, Tensor]]
      )
return_statement: return handle
docstring: r"""Registers a backward hook on the module.
  
          This function is deprecated in favor of :meth:`~torch.nn.Module.register_full_backward_hook` and
          the behavior of this function will change in future versions.
  
          Returns:
              :class:`torch.utils.hooks.RemovableHandle`:
                  a handle that can be used to remove the added hook by calling
                  ``handle.remove()``
docstring_summary: r"""Registers a backward hook on the module.
docstring_tokens: r Registers a backward hook on the module .
function: def register_backward_hook(
          self, hook: Callable[['Module', _grad_t, _grad_t], Union[None, Tensor]]
      ) -> RemovableHandle:
          r"""Registers a backward hook on the module.
  
          This function is deprecated in favor of :meth:`~torch.nn.Module.register_full_backward_hook` and
          the behavior of this function will change in future versions.
  
          Returns:
              :class:`torch.utils.hooks.RemovableHandle`:
                  a handle that can be used to remove the added hook by calling
                  ``handle.remove()``
  
          """
          if self._is_full_backward_hook is True:
              raise RuntimeError("Cannot use both regular backward hooks and full backward hooks on a "
                                 "single Module. Please use only one of them.")
  
          self._is_full_backward_hook = False
  
          handle = hooks.RemovableHandle(self._backward_hooks)
          self._backward_hooks[handle.id] = hook
          return handle
function_tokens: def register_backward_hook ( self , hook : Callable [ [ 'Module' , _grad_t , _grad_t ] , Union [ None , Tensor ] ] ) -> RemovableHandle : if self . _is_full_backward_hook is True : raise RuntimeError ( "Cannot use both regular backward hooks and full backward hooks on a " "single Module. Please use only one of them." ) self . _is_full_backward_hook = False handle = hooks . RemovableHandle ( self . _backward_hooks ) self . _backward_hooks [ handle . id ] = hook return handle