Skip to content

Commit

Permalink
[fbsync] Remove warning filter in transforms test (#8523)
Browse files Browse the repository at this point in the history
Reviewed By: vmoens

Differential Revision: D60596237

fbshipit-source-id: 009b6b6c4581623964bac3c53b5226a5dcec009e
  • Loading branch information
NicolasHug authored and facebook-github-bot committed Aug 2, 2024
1 parent bf04da0 commit 9f8380b
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 9f8380b

Please sign in to comment.