fynance.models.neural_network.BaseNeuralNet.register_forward_pre_hook¶
-
BaseNeuralNet.
register_forward_pre_hook
(hook)¶ Registers a forward pre-hook on the module.
The hook will be called every time before
forward
is invoked. It should have the following signature:hook(module, input) -> None
The hook should not modify the input.
- Returns:
torch.utils.hooks.RemovableHandle
:- a handle that can be used to remove the added hook by calling
handle.remove()