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 resize in test_transforms to pytest #3952

Merged
merged 3 commits into from
Jun 5, 2021

Conversation

AnirudhDagar
Copy link
Contributor

Refactor Group J as mentioned in #3945

  • test_randomresized_params
  • test_resize

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.

Thanks @AnirudhDagar , this looks great overall! I think we can make the tests more efficient with some parametrization, please see my comments below

test/test_transforms.py Outdated Show resolved Hide resolved
test/test_transforms.py Outdated Show resolved Hide resolved
test/test_transforms.py Outdated Show resolved Hide resolved
@AnirudhDagar
Copy link
Contributor Author

Thanks a lot @NicolasHug for the feedback, I'll make these changes and update the PR.

Btw, if possible, could you please help me with #3963 (Not Related to this PR)?

@AnirudhDagar
Copy link
Contributor Author

Sorry for the delay @NicolasHug. This is now ready for review. Please let me know if there are some changes you would like to suggest. Thanks a lot for being patient and guiding me through! :))

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.

This looks great!! thanks a lot @AnirudhDagar

Sorry for the delay

No worries at all, there's no real rush :)

t = transforms.Resize(osize, max_size=max_size)
result = t(img)

msg = "{}, {} - {} - {}".format(height, width, osize, max_size)
Copy link
Member

Choose a reason for hiding this comment

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

Just for info: we don't need these kind of error message anymore as they just print the compared values. Now that we're using pytest, we can just rely on pytest introspection. It's fine to leave as-is though ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Awesome! I'll keep this in mind with my future PRs.

@NicolasHug NicolasHug merged commit 366bf0a into pytorch:master Jun 5, 2021
@AnirudhDagar AnirudhDagar deleted the refactor-test-resize branch June 5, 2021 11:17
facebook-github-bot pushed a commit that referenced this pull request Jun 10, 2021
Reviewed By: NicolasHug

Differential Revision: D29027325

fbshipit-source-id: 934371047fc2baa2b61f17832f5b251f745b31dc
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