diversify parameter types for a couple of prototype kernels#6635
diversify parameter types for a couple of prototype kernels#6635pmeier merged 13 commits intopytorch:mainfrom
Conversation
| features.BoundingBox: F.resize_bounding_box, | ||
| features.Mask: F.resize_mask, | ||
| }, | ||
| skips=[ |
There was a problem hiding this comment.
These skips currently don't do anything since we don't have integer sizes, but will be necessary as soon that happens.
| def _get_resize_sizes(image_size): | ||
| height, width = image_size | ||
| length = max(image_size) | ||
| # yield length |
There was a problem hiding this comment.
@datumbox uncomment this to see if your fix worked.
| # This is just a dummy value to avoid raising an error in `_affine_parse_args` although we don't have an | ||
| # interpolation mode for bounding boxes. | ||
| interpolation = InterpolationMode.NEAREST | ||
| angle, translate, shear, center = _affine_parse_args(angle, translate, scale, shear, interpolation, center) |
There was a problem hiding this comment.
I have explicitly avoided calling this method on my other PR. See #6636 (comment). Thoughts?
There was a problem hiding this comment.
Well, I used it, since the old parsing, i.e.
vision/torchvision/prototype/transforms/functional/_geometry.py
Lines 291 to 306 in 2d92728
failed for some of the new sample inputs. Meaning, the bounding box kernel did not support some parameters that the other kernels supported. This is why I used this to make sure that every kernel does the same. If you have speed concerns, I can look into what exactly caused the failure and only fix this.
There was a problem hiding this comment.
I've reverted the changes in 6dfc965 and added skips for the tests. They should actually be xfails, but the test framework currently doesn't support that. #6653 adds support for xfails. @datumbox you need to remove the skips in your PR, because the tests otherwise will not start to fail, even if you did something wrong.
…6635) Summary: * add more size types for prototype resize sample inputs * add skip for dispatcher * add more sizes to resize kernel info * add more skips * add more diversity to gaussian_blur parameters * diversify affine parameters and fix bounding box kernel * fix center_crop dispatcher info * revert kernel fixes * add skips for scalar shears in affine_bounding_box Reviewed By: YosuaMichael Differential Revision: D39885425 fbshipit-source-id: 4262e95aae47790f0776e172782b04fc00f158dd
This is preparation for #6636. It diversifies the parameter type inputs for the kernels that are handled there.
This PR only skips some JIT tests for
intorfloatinputs while we have annotatedList[int]andList[float]. All inputs that otherwise provide a tuple instead of a list work.