Tensors have a function: register_hook.
register_hook ( hook )[SOURCE] 605
Registers a backward hook.
The description says that everytime a gradient with respect to the tensor is computed the hook will be called.
My question: what are hooks used for?
Kind regards,
Jens