-
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
Test cleanups + add new tests for datapoints #7828
Conversation
🔗 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 FailureAs of commit 89b9dff: 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() |
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.
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.
2bceac4
to
b681508
Compare
# 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 |
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.
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.
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.
Good to me, thanks!
@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 ? |
Reviewed By: matteobettini Differential Revision: D48642283 fbshipit-source-id: f506e94843e870c5861c24d6cf242aab1c04be42
Mostly just parametrization + new tests
cc @pmeier