Conversation
NicolasHug
approved these changes
Feb 15, 2023
Member
NicolasHug
left a comment
There was a problem hiding this comment.
Thank you Philip, if it fixes the original failure then let's get this in
Comment on lines
+238
to
+247
| ImageOrVideoTypeJIT, | ||
| ImageOrVideoTypeJIT, | ||
| ImageOrVideoTypeJIT, | ||
| ImageOrVideoTypeJIT, | ||
| ImageOrVideoTypeJIT, | ||
| ImageOrVideoTypeJIT, | ||
| ImageOrVideoTypeJIT, | ||
| ImageOrVideoTypeJIT, | ||
| ImageOrVideoTypeJIT, | ||
| ImageOrVideoTypeJIT, |
Comment on lines
+1982
to
+1991
| torch.Tensor, | ||
| torch.Tensor, | ||
| torch.Tensor, | ||
| torch.Tensor, | ||
| torch.Tensor, | ||
| torch.Tensor, | ||
| torch.Tensor, | ||
| torch.Tensor, | ||
| torch.Tensor, | ||
| torch.Tensor, |
pmeier
commented
Feb 15, 2023
| def _transform( | ||
| self, inpt: Union[datapoints.ImageType, datapoints.VideoType], params: Dict[str, Any] | ||
| ) -> Union[List[datapoints.ImageTypeJIT], List[datapoints.VideoTypeJIT]]: | ||
| ) -> Tuple[ |
Contributor
Author
There was a problem hiding this comment.
Yes, all of this is ugly and verbose AF. We can also try to keep the List annotation (which we should have gone for in the first place).
Comment on lines
+2027
to
+2029
| flipped = five_crop_image_pil(image, size) | ||
|
|
||
| return non_flipped + flipped |
Contributor
Author
There was a problem hiding this comment.
This is the actual functional fix. v1 returned a tuple and so should v2.
Contributor
Author
|
Test failures are unrelated. |
facebook-github-bot
pushed a commit
that referenced
this pull request
Mar 28, 2023
Reviewed By: vmoens Differential Revision: D44416586 fbshipit-source-id: e506d56435133a7761f59a3ac9d0208f1fab4884
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Towards #7159. Although we annotated as
List[torch.Tensor]vision/torchvision/transforms/functional.py
Line 830 in 0e0a5dc
the addition of two tuples
vision/torchvision/transforms/functional.py
Lines 870 to 871 in 0e0a5dc
vision/torchvision/transforms/functional.py
Line 785 in 0e0a5dc
will also be a tuple.
Our docstrings also say as much:
vision/torchvision/transforms/functional.py
Lines 848 to 849 in 0e0a5dc
vision/torchvision/transforms/transforms.py
Lines 1073 to 1074 in c5e9a10
It seems the automagic handling described in #7252 also kicks in for return types or otherwise the v1 script tests should have never passed.
cc @vfdev-5 @bjuncek