Define custom op for grid points generator of single level feature map (#4395)
Summary:
Pull Request resolved: https://github.com/pytorch/executorch/pull/4395
In order to lower `grid_priors` function that generate grids to Vulkan, we plan to implement this function in one shader due to several reasons like compilation issue of meshgrid, and reduce data copy.
Define this function into one operator and will implement this op in the following diff.
The spec of this op is:
```
(int height, int width, int stride, float offset) -> Tensor
```
Example:
```
height = 2
width = 3
stride = 1
offset = 0
output.shape = [3x2, 2]
output = tensor([[0, 0],
[1, 0],
[2, 0],
[0, 1],
[1, 1],
[2, 1]])
```
Reviewed By: jorgep31415
Differential Revision: D60141165
fbshipit-source-id: f56f04671eb5ca75c6a06c4b70b4067a0dc43e2a Y
Yujie Hui committed
77c905d13b40f5dfab1cdb3e8eed06491ee8b59b
Parent: dbf87b0
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
on 7/25/2024, 6:52:01 PM