I finally found the mistake and it was very stupid. I used
layer.register_full_backward__pre_hook(..)
instead of
layer.register_full_backward_pre_hook(..)
(so just an extra underscore).
Still, thank you for your advice. It helped me as I wasn’t aware of the 2.0 update before.
Cheers