Skip to content

Commit

Permalink
Improve numerical robustness of input diff hook unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
bauerfe committed Nov 13, 2024
1 parent 9a194ad commit 347e225
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/test_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,4 @@ def test_input_diff_hook():
layer.register_forward_hook(hooks.input_diff_hook)
model(inp)
for idx, correct in correct_values.items():
assert (model[idx].hook_data["diff_output"] == correct).all()
assert torch.allclose(model[idx].hook_data["diff_output"], correct)

0 comments on commit 347e225

Please sign in to comment.