Skip to content
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

Merged
merged 11 commits into from Nov 15, 2022
Merged

Conversation

liqunfu
Copy link
Contributor

@liqunfu liqunfu commented Nov 14, 2022

Description

type specified for GridSample is incorrect

Motivation and Context

fix the error

Signed-off-by: Liqun Fu <liqfu@microsoft.com>
@liqunfu liqunfu requested a review from a team as a code owner November 14, 2022 05:00
@p-wysocki
Copy link
Contributor

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>
@liqunfu liqunfu added this to the 1.13 milestone Nov 14, 2022
.TypeConstraint(
"T2",
{"tensor(float16)", "tensor(float)", "tensor(double)"},
"Constrain output types to float tensors.")
"Constrain grid and output types to float tensors.")
Copy link
Contributor

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>
@@ -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.
Copy link
Contributor

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`)

Copy link
Contributor

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.

Copy link
Contributor

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>
Signed-off-by: Liqun Fu <liqfu@microsoft.com>
@liqunfu liqunfu merged commit 8dc0ed5 into onnx:main Nov 15, 2022
@liqunfu liqunfu deleted the liqun/grid_sample branch November 15, 2022 00:02
justinchuby pushed a commit to justinchuby/onnx that referenced this pull request Jan 27, 2023
broune pushed a commit to broune/onnx that referenced this pull request May 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants