Skip to content

Commit

Permalink
Update hook registering to newest API
Browse files Browse the repository at this point in the history
  • Loading branch information
szymonmaszke authored and Szymon Maszke committed Jun 13, 2022
1 parent 24669cd commit 1eff7c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torchlayers/regularization.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def __init__(self, module, weight_decay, name: str = None):
self.weight_decay = weight_decay
self.name = name

self.hook = self.module.register_backward_hook(self._weight_decay_hook)
self.hook = self.module.register_full_backward_hook(self._weight_decay_hook)

def remove(self):
self.hook.remove()
Expand Down

0 comments on commit 1eff7c5

Please sign in to comment.