Skip to content

Commit

Permalink
Try decreasing atol
Browse files Browse the repository at this point in the history
  • Loading branch information
f-dangel committed Mar 2, 2024
1 parent ac1e384 commit b776a69
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs_src/examples/use_cases/example_resnet_all_in_one.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def forward(self, x):

print("Do the individual gradients match?")
for name, parameter in model.named_parameters():
match = allclose(parameter.grad_batch[sample_to_check], parameter.grad, atol=5e-6)
match = allclose(parameter.grad_batch[sample_to_check], parameter.grad, atol=1e-6)
print(f"{name:>20}: {match}")
if not match:
raise AssertionError("Individual gradients don't match!")
Expand Down

0 comments on commit b776a69

Please sign in to comment.