Hi,
Unfortunately it is a really tricky problem to solve without impacting users not using the hook and supporting most of the nn.Module behaviours.
It is very hard to make it work nicely with inplace operations and not even possible at the moment to forbid inplace ops if we don’t support it.
So there is some progress in cleaning this inplace ops and the backward hooks will come after.
Unfortunately, I have limited amount of time to do all the changes that are needed but if someone wants to work on this I can help.
At the moment, the workaround is to use register_hook directly on the specific Tensors that you want to change.