Skip to content

Commit 8cbf8e0

Browse files
iden-kalemajfacebook-github-bot
authored andcommitted
Replace register_backward_hook with register_full_backward_hook (#720)
Summary: Pull Request resolved: #720 register_backward_hook is deprecated and may lead to errors in gradient calculation. We switch to the supported register_full_backward_hook. Reviewed By: HuanyuZhang Differential Revision: D68562558 fbshipit-source-id: 58bf997a617da6eb097c6b159ed9354d4c8320a2
1 parent 58f11ec commit 8cbf8e0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

opacus/grad_sample/grad_sample_module.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def add_hooks(
207207
)
208208

209209
self.autograd_grad_sample_hooks.append(
210-
module.register_backward_hook(
210+
module.register_full_backward_hook(
211211
partial(
212212
self.capture_backprops_hook,
213213
loss_reduction=loss_reduction,

0 commit comments

Comments
 (0)