-
Notifications
You must be signed in to change notification settings - Fork 7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use torch.testing.assert_close in test_anchor_utils.py #3880
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comment but it's more about assert_close
than about the proposed changes in this PR, LGTM
torch.testing.assert_close(dboxes[0], dboxes_output, rtol=1e-5, atol=1e-8) | ||
torch.testing.assert_close(dboxes[1], dboxes_output, rtol=1e-5, atol=1e-8) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here it's a bit of a shame IMHO that we're forced to specify atol
as well. The default for atol
is 1e-5 and
torch.testing.assert_close(dboxes[0], dboxes_output, rtol=1e-5, atol=1e-5)
torch.testing.assert_close(dboxes[1], dboxes_output, rtol=1e-5, atol=1e-5)
passes just fine, so ideally we could just write
torch.testing.assert_close(dboxes[0], dboxes_output, rtol=1e-5)
torch.testing.assert_close(dboxes[1], dboxes_output, rtol=1e-5)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stamping
Summary: Co-authored-by: Philip Meier <github.pmeier@posteo.de> Reviewed By: vincentqb, cpuhrsch Differential Revision: D28679964 fbshipit-source-id: c53eb63031a4b965e870f3334d749e4d9d41ddad
part of #3865