Skip to content

Commit

Permalink
Remove warning filter in transforms test (#8523)
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasHug committed Jul 12, 2024
1 parent 8f9d810 commit 87d05c6
Showing 1 changed file with 1 addition and 9 deletions.
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

0 comments on commit 87d05c6

Please sign in to comment.