parameters: (self, hook: Callable[..., None])
return_statement: return handle
docstring: r"""Registers a forward pre-hook on the module.
  
          The hook will be called every time before :func:`forward` is invoked.
          It should have the following signature::
  
              hook(module, input) -> None or modified input
  
          The input contains only the positional arguments given to the module.
          Keyword arguments won't be passed to the hooks and only to the ``forward``.
          The hook can modify the input. User can either return a tuple or a
          single modified value in the hook. We will wrap the value into a tuple
          if a single value is returned(unless that value is already a tuple).
  
          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 forward pre-hook on the module.
docstring_tokens: r Registers a forward pre - hook on the module .
function: def register_forward_pre_hook(self, hook: Callable[..., None]) -> RemovableHandle:
          r"""Registers a forward pre-hook on the module.
  
          The hook will be called every time before :func:`forward` is invoked.
          It should have the following signature::
  
              hook(module, input) -> None or modified input
  
          The input contains only the positional arguments given to the module.
          Keyword arguments won't be passed to the hooks and only to the ``forward``.
          The hook can modify the input. User can either return a tuple or a
          single modified value in the hook. We will wrap the value into a tuple
          if a single value is returned(unless that value is already a tuple).
  
          Returns:
              :class:`torch.utils.hooks.RemovableHandle`:
                  a handle that can be used to remove the added hook by calling
                  ``handle.remove()``
          """
          handle = hooks.RemovableHandle(self._forward_pre_hooks)
          self._forward_pre_hooks[handle.id] = hook
          return handle
function_tokens: def register_forward_pre_hook ( self , hook : Callable [ ... , None ] ) -> RemovableHandle : handle = hooks . RemovableHandle ( self . _forward_pre_hooks ) self . _forward_pre_hooks [ handle . id ] = hook return handle