Skip to content

Commit

Permalink
Merge branch 'main' into transform-sample-test
Browse files Browse the repository at this point in the history
  • Loading branch information
pmeier committed Sep 28, 2023
2 parents d2f21fd + f33e387 commit 99e5506
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test/test_transforms_v2_refactored.py
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ def test_interpolation_int(self, interpolation, make_input):
assert_equal(actual, expected)

def test_transform_unknown_size_error(self):
with pytest.raises(ValueError, match="size can either be an integer or a list or tuple of one or two integers"):
with pytest.raises(ValueError, match="size can either be an integer or a sequence of one or two integers"):
transforms.Resize(size=object())

@pytest.mark.parametrize(
Expand Down
4 changes: 2 additions & 2 deletions torchvision/transforms/v2/_geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,11 @@ def __init__(

if isinstance(size, int):
size = [size]
elif isinstance(size, (list, tuple)) and len(size) in {1, 2}:
elif isinstance(size, Sequence) and len(size) in {1, 2}:
size = list(size)
else:
raise ValueError(
f"size can either be an integer or a list or tuple of one or two integers, " f"but got {size} instead."
f"size can either be an integer or a sequence of one or two integers, but got {size} instead."
)
self.size = size

Expand Down

0 comments on commit 99e5506

Please sign in to comment.