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

fix Resize for JIT single value sequences (#7139)

parent 1496ff0c
......@@ -74,6 +74,7 @@ CONSISTENCY_CONFIGS = [
legacy_transforms.Resize,
[
ArgsKwargs(32),
ArgsKwargs([32]),
ArgsKwargs((32, 29)),
ArgsKwargs((31, 28), interpolation=prototype_transforms.InterpolationMode.NEAREST),
ArgsKwargs((33, 26), interpolation=prototype_transforms.InterpolationMode.BICUBIC),
......
......@@ -46,11 +46,16 @@ class Resize(Transform):
) -> None:
super().__init__()
self.size = (
[size]
if isinstance(size, int)
else _setup_size(size, error_msg="Please provide only two dimensions (h, w) for size.")
if isinstance(size, int):
size = [size]
elif isinstance(size, (list, tuple)) 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."
)
self.size = size
self.interpolation = interpolation
self.max_size = max_size
self.antialias = antialias
......
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