cybertronai / autograd-hacks

The Unlicense
151 stars 31 forks source link

UserWarning: Using a non-full backward hook when the forward contains multiple autograd Nodes is deprecated and will be removed in future versions. This hook will be missing some grad_input. Please use register_full_backward_hook to get the documented behavior. #10

Open slerman12 opened 3 years ago

slerman12 commented 3 years ago

Getting this warning:

UserWarning: Using a non-full backward hook when the forward contains multiple autograd Nodes is deprecated and will be removed in future versions. This hook will be missing some grad_input. Please use register_full_backward_hook to get the documented behavior.

bhattg commented 3 years ago

Hey can you describe more about this issue? I am also getting the same

optimass commented 2 years ago

same

v-liuwei commented 2 years ago

As said by the official documents,

This function(register_backward_hook()) is deprecated in favor of register_full_backward_hook() and the behavior of this function will change in future versions.

So just replace register_backward_hook() with register_full_backward_hook() in autograd_hacks.py at line 56.

https://github.com/cybertronai/autograd-hacks/blob/2c2e494cbf7a0240199cd767f3179477f25f4e23/autograd_hacks.py#L56