We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 08cd318 commit 4776b61Copy full SHA for 4776b61
torchvision/prototype/transforms/functional/_geometry.py
@@ -148,6 +148,11 @@ def _compute_resized_output_size(
148
) -> List[int]:
149
if isinstance(size, int):
150
size = [size]
151
+ elif max_size is not None and len(size) != 1:
152
+ raise ValueError(
153
+ "max_size should only be passed if size specifies the length of the smaller edge, "
154
+ "i.e. size should be an int or a sequence of length 1 in torchscript mode."
155
+ )
156
return __compute_resized_output_size(spatial_size, size=size, max_size=max_size)
157
158
0 commit comments