oneflow.nn.Module.register_backward_hook¶
-
Module.
register_backward_hook
(hook: Callable[[oneflow.nn.modules.module.Module, Union[Tuple[oneflow.Tensor, …], oneflow.Tensor], Union[Tuple[oneflow.Tensor, …], oneflow.Tensor]], Union[None, oneflow.Tensor]])¶ Registers a backward hook on the module.
This function is deprecated in favor of
register_full_backward_hook()
and the behavior of this function will change in future versions.- Returns
a handle that can be used to remove the added hook by calling
handle.remove()
- Return type
oneflow.utils.hooks.RemovableHandle