fix Resize for JIT single value sequences #7139
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
prototype.transforms.Resize
is broken for single value sequence inputs. They are required by JIT1 and should behave the same way as regular integer inputsvision/torchvision/transforms/transforms.py
Lines 295 to 296 in 59dc938
However,
_setup_size
parses them to(size, size)
vision/torchvision/transforms/transforms.py
Lines 1819 to 1820 in 59dc938
which triggers a different path in the kernel.
This was not caught by our tests before, since we never bothered to test the "JIT variants" since the base assumption was that we won't keep support for it. Apart from #7135, this would be a BC break nevertheless since all users can rely on that syntax although it is only required for JIT.
cc @vfdev-5 @bjuncek
Footnotes
I've just discovered this while working on JIT. That is unrelated to this PR. ↩