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
Correct types in GridSample def.cc #4655
Conversation
Signed-off-by: Liqun Fu <liqfu@microsoft.com>
Hi! Should I add this PR to ONNX 1.13 milestone? The CF is on 18th November. |
Signed-off-by: Liqun Fu <liqfu@microsoft.com>
Signed-off-by: Liqun Fu <liqfu@microsoft.com>
onnx/defs/tensor/defs.cc
Outdated
.TypeConstraint( | ||
"T2", | ||
{"tensor(float16)", "tensor(float)", "tensor(double)"}, | ||
"Constrain output types to float tensors.") | ||
"Constrain grid and output types to float tensors.") |
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.
Only "grid"? Not "output"?
Signed-off-by: Liqun Fu <liqfu@microsoft.com>
Signed-off-by: Liqun Fu <liqfu@microsoft.com>
docs/Operators.md
Outdated
@@ -9325,6 +9325,10 @@ Other versions of this operator: <a href="Changelog.md#GreaterOrEqual-12">12</a> | |||
Given an `input` and a flow-field `grid`, computes the `output` using `input` values and pixel locations from `grid`. | |||
Currently, only spatial (4-D) inputs are supported. For `input` with shape (N, C, H, W) and `grid` with shape (N, H_out, W_out, 2), | |||
the `output` will have shape (N, C, H_out, W_out). | |||
|
|||
Input are pixels in 2-dimensional space with each pixel as a square whose value is at the square center. |
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 think this should be explained better. I personally like what PR 4089 says. But as a compromise and a short summary for now, how about:
The tensor `Input` describes the value of a function (over a 2-dimensional space), or pixel, at integer coordinates.
The tensor `grid` describes the grid-positions where the function-value is to be computed using a specified
interpolation method (the mode) and a padding mode (for grid positions falling outside the dimensions of `input`)
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.
May be contains
would be better than describes
in above.
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.
So, something like
The tensor `Input` contains the pixel-values at integer-coordinates. The tensor `grid` describes the grid-positions
(using floating-values) where the pixel-value is to be computed using ... etc. (as above).
Signed-off-by: Liqun Fu <liqfu@microsoft.com>
Signed-off-by: Liqun Fu <liqfu@microsoft.com>
Signed-off-by: Liqun Fu <liqfu@microsoft.com>
Signed-off-by: Liqun Fu <liqfu@microsoft.com>
Description
type specified for GridSample is incorrect
Motivation and Context
fix the error