Skip to content
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

port test_models_detection_utils.py to pytest #4036

Merged

Conversation

AnirudhDagar
Copy link
Contributor

Port test_models_detection_utils.py to pytest. See #4033 for more details.

Copy link
Member

@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 when green, thanks :)

@AnirudhDagar
Copy link
Contributor Author

CI timed out again.

Btw what do you suggest for assertAlmostEqual in something like this. I guess pytest.approx will be a good choice here. Or maybe we can go to torch.testing.assert_close defining some tolerance.

@NicolasHug
Copy link
Member

For numbers, assert x == pytest.approx(y) is preferable. For iterables (lists, tensors, etc.) we can use torch.testing.assert_close

@NicolasHug NicolasHug merged commit 59833e7 into pytorch:master Jun 10, 2021
@NicolasHug
Copy link
Member

Thanks!!

@AnirudhDagar
Copy link
Contributor Author

For numbers, assert x == pytest.approx(y) is preferable. For iterables (lists, tensors, etc.) we can use torch.testing.assert_close

Yeah, Thanks for the clarification!

@AnirudhDagar AnirudhDagar deleted the refactor-test_models_detection_utils branch June 10, 2021 12:42
@NicolasHug NicolasHug mentioned this pull request Jun 10, 2021
8 tasks
facebook-github-bot pushed a commit that referenced this pull request Jun 14, 2021
Reviewed By: fmassa

Differential Revision: D29097723

fbshipit-source-id: 386f52d36dac8a5b6256b87280e846d4a89b1d27
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.

3 participants