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

Test cleanups + add new tests for datapoints #7828

Merged
merged 3 commits into from
Aug 14, 2023

Conversation

NicolasHug
Copy link
Member

@NicolasHug NicolasHug commented Aug 14, 2023

Mostly just parametrization + new tests

cc @pmeier

@pytorch-bot
Copy link

pytorch-bot bot commented Aug 14, 2023

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/7828

Note: Links to docs will display an error until the docs builds have been completed.

❌ 1 New Failure

As of commit 89b9dff:

NEW FAILURE - The following job has failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

image = datapoints.Image(torch.rand(3, 16, 16))
@pytest.mark.parametrize("make_input", [make_image, make_bounding_box, make_segmentation_mask, make_video])
def test_to_wrapping(make_input):
dp = make_input()
Copy link
Member Author

Choose a reason for hiding this comment

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

we can also call it datapoint, although it's very close to the datapoints module. Or inpt. Or input. Or foo. Or aejfbnakejfbk (preferred). I don't care.

Comment on lines +299 to +301
# Exiting a context manager will restore the return type as it was prior to entering it,
# regardless of whether the "global" datapoints.set_return_type() was called within the context manager.
assert type(img + 3) is datapoints.Image
Copy link
Member Author

Choose a reason for hiding this comment

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

BTW This part of the test is more for illustration purpose of what happens, rather than something we want to enforce. It's not something we need to prevent either - really not worth it.

Copy link
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

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

Good to me, thanks!

@vfdev-5
Copy link
Collaborator

vfdev-5 commented Aug 14, 2023

@NicolasHug just to make sure, this PR will fix currently failing python lint issue on main: https://github.com/pytorch/vision/actions/runs/5856785721/job/15877262395 ?

@NicolasHug NicolasHug merged commit 6ab8a96 into pytorch:main Aug 14, 2023
62 of 63 checks passed
facebook-github-bot pushed a commit that referenced this pull request Aug 25, 2023
Reviewed By: matteobettini

Differential Revision: D48642283

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