Unverified Commit c5e9a10d authored by Philip Meier's avatar Philip Meier Committed by GitHub
Browse files

add error for max_size with size sequence in resize (#7253)

parent 0e0a5dc7
...@@ -148,6 +148,11 @@ def _compute_resized_output_size( ...@@ -148,6 +148,11 @@ def _compute_resized_output_size(
) -> List[int]: ) -> List[int]:
if isinstance(size, int): if isinstance(size, int):
size = [size] size = [size]
elif max_size is not None and len(size) != 1:
raise ValueError(
"max_size should only be passed if size specifies the length of the smaller edge, "
"i.e. size should be an int or a sequence of length 1 in torchscript mode."
)
return __compute_resized_output_size(spatial_size, size=size, max_size=max_size) return __compute_resized_output_size(spatial_size, size=size, max_size=max_size)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment