Skip to content

Commit

Permalink
Merge pull request #27 from tfjgeorge/full_backward_hooks
Browse files Browse the repository at this point in the history
switches to full backward hooks in jacobian generator
  • Loading branch information
tfjgeorge committed Jul 5, 2021
2 parents d6cbe15 + 4a3f621 commit 522a9a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nngeometry/generator/jacobian.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ def _add_hooks(self, hook_x, hook_gy, mods):
handles = []
for m in mods:
handles.append(m.register_forward_pre_hook(hook_x))
handles.append(m.register_backward_hook(hook_gy))
handles.append(m.register_full_backward_hook(hook_gy))
return handles

def _hook_savex(self, mod, i):
Expand Down Expand Up @@ -1117,4 +1117,4 @@ def _get_dataloader(self, examples):
return examples
else:
return DataLoader(TensorDataset(*examples),
batch_size=len(examples[0]))
batch_size=len(examples[0]))

0 comments on commit 522a9a4

Please sign in to comment.