Skip to content

Use torch.testing.assert_close in test_ops.py #3883

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

Merged
merged 26 commits into from
May 21, 2021

Conversation

NicolasHug
Copy link
Member

part of #3865

@@ -860,20 +865,11 @@ def test_bbox_same(self):
exp_xyxy = torch.tensor([[0, 0, 100, 100], [0, 0, 0, 0],
[10, 15, 30, 35], [23, 35, 93, 95]], dtype=torch.float)

box_same = ops.box_convert(box_tensor, in_fmt="xyxy", out_fmt="xyxy")
self.assertEqual(exp_xyxy.size(), torch.Size([4, 4]))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that we shoudn't remove self.assertEqual(exp_xyxy.size(), torch.Size([4, 4])) as it's not the same as comparing exp_xyxy.size() vs box_tensor.size(), so I'll put these back

Copy link
Member Author

@NicolasHug NicolasHug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@datumbox datumbox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stamping

@NicolasHug NicolasHug merged commit 55150bf into pytorch:master May 21, 2021
facebook-github-bot pushed a commit that referenced this pull request May 25, 2021
Summary: Co-authored-by: Philip Meier <[email protected]>

Reviewed By: vincentqb, cpuhrsch

Differential Revision: D28679978

fbshipit-source-id: 1699926c8d738e904603e40f87b6b3087d3d37bd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants