-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Reduce sample inputs for prototype transform kernels #6714
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
||
|
|
||
| def xfail_python_scalar_arg_jit(name, *, reason=None): | ||
| def xfail_jit_python_scalar_arg(name, *, reason=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a rename that moves the jit term to the front of the name to make it clear this is only a JIT issue.
| # TODO: check if this is a regression since it seems that should be supported if `int` is ok | ||
| xfail_jit_list_of_ints("fill"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a formatting change like #5880 that I saw while going through the kernels.
| and args_kwargs.kwargs.get("padding_mode", "constant") == "constant", | ||
| ) | ||
| ), | ||
| xfail_jit_python_scalar_arg("padding"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder why all this xfail appeared in this PR and not before ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we didn't test scalar padding before
| padding=[[1], [1, 1], [1, 1, 2, 2]], |
Thus, while reducing the number of sample inputs now, the tests are actually more comprehensive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @pmeier !
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
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: