Reduce sample inputs for prototype transform kernels#6714
Merged
pmeier merged 12 commits intopytorch:mainfrom Oct 6, 2022
Merged
Reduce sample inputs for prototype transform kernels#6714pmeier merged 12 commits intopytorch:mainfrom
pmeier merged 12 commits intopytorch:mainfrom
Conversation
pmeier
commented
Oct 6, 2022
|
|
||
|
|
||
| def xfail_python_scalar_arg_jit(name, *, reason=None): | ||
| def xfail_jit_python_scalar_arg(name, *, reason=None): |
Contributor
Author
There was a problem hiding this comment.
Just a rename that moves the jit term to the front of the name to make it clear this is only a JIT issue.
Comment on lines
+164
to
+165
| # TODO: check if this is a regression since it seems that should be supported if `int` is ok | ||
| xfail_jit_list_of_ints("fill"), |
Contributor
Author
There was a problem hiding this comment.
We have a few of these. I'm not sure if this is a regression of #6636. Will check and send a follow-up PR since this is one is only test changes.
| kernel = _get_gaussian_kernel2d(kernel_size, sigma, dtype=dtype, device=img.device) | ||
| kernel = kernel.expand(img.shape[-3], 1, kernel.shape[0], kernel.shape[1]) | ||
|
|
||
| img, need_cast, need_squeeze, out_dtype = _cast_squeeze_in( |
Contributor
Author
There was a problem hiding this comment.
Just a formatting change like #5880 that I saw while going through the kernels.
vfdev-5
reviewed
Oct 6, 2022
| and args_kwargs.kwargs.get("padding_mode", "constant") == "constant", | ||
| ) | ||
| ), | ||
| xfail_jit_python_scalar_arg("padding"), |
Contributor
There was a problem hiding this comment.
I wonder why all this xfail appeared in this PR and not before ?
Contributor
Author
There was a problem hiding this comment.
Because we didn't test scalar padding before
Thus, while reducing the number of sample inputs now, the tests are actually more comprehensive.
vfdev-5
approved these changes
Oct 6, 2022
facebook-github-bot
pushed a commit
that referenced
this pull request
Oct 17, 2022
Summary:
* pad_image_tensor
* pad_mask and pad_bounding_box
* resize_{image_tensor, mask, bounding_box}
* center_crop_{image_tensor, mask}
* {five, ten}_crop_image_tensor
* crop_{image_tensor, mask}
* convert_color_space_image_tensor
* affine_{image_tensor, mask, bounding_box}
* rotate_{image_tensor, mask}
* gaussian_blur_image_tensor
* cleanup
Reviewed By: NicolasHug
Differential Revision: D40427478
fbshipit-source-id: 4954886d7d0b8212ea92847b07092a8dfad809cb
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.
Addresses 3. from #6622.
This PR achieves a significant reduction of the number of sample inputs. Only for the bounding box kernels, the number goes up slightly. After manual inspection, it became clear that our previous sample inputs were not sufficient.
mainpad_image_tensorresize_image_tensorpad_maskcenter_crop_image_tensorresize_maskcenter_crop_maskaffine_image_tensorten_crop_image_tensorrotate_image_tensorcrop_image_tensoraffine_maskconvert_color_space_image_tensorcrop_maskgaussian_blur_image_tensoraffine_bounding_boxfive_crop_image_tensorpad_bounding_boxrotate_maskresize_bounding_boxIn total we cut the number of tests (and approximately the runtime) roughly to a third of what is was before. Plus, we even increase the coverage ever so slightly:
main: