Libtorch Register_hook how to use?

Hi.
How to the register_hook function in Libtorch? Or do similar functions exist?

1 Like

Looking forward to this too. Can’t find any documentation :frowning:

@21fa417e3fb06e56040c @maris_ancans Please see https://github.com/pytorch/pytorch/blob/115494b00bf31549aa5227068bd66a3da9de469b/test/cpp/api/autograd.cpp#L535-L612 for example usage of Tensor.register_hook. We will update the documentation on this soon.

1 Like

thanks a lot ! :grinning::grinning: