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

Remove warning filter in transforms test #8523

Merged
merged 1 commit into from
Jul 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions test/test_transforms_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,15 +394,7 @@ def _check_transform_sample_input_smoke(transform, input, *, adapter):


def check_transform(transform, input, check_v1_compatibility=True, check_sample_input=True):
# TODO: remove this cm once https://github.com/pytorch/vision/issues/8517
# and https://github.com/pytorch/pytorch/issues/130242 are resolved.
if isinstance(transform, (transforms.RandomResizedCrop, transforms.LinearTransformation)):
cm = pytest.warns(FutureWarning, match="You are using `torch.load`")
else:
cm = contextlib.nullcontext()

with cm:
pickle.loads(pickle.dumps(transform))
pickle.loads(pickle.dumps(transform))

output = transform(input)
assert isinstance(output, type(input))
Expand Down
Loading