-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Rounding behavior of Resize when interpolating on integral types is unspecified #3390
Comments
@pranav-prakash I'm the main author of resize op spec. If needed, I will take a look at how pytorch/tf/.. do int8 interpolation and update onnx spec |
@daquexian Thanks for looking into this. I did some brief experimentation and it seems like PyTorch does indeed round for interpolation. See the following sample case
|
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
I think this issue might still exist so I will reopen it to track. Thanks. |
Bug Report
When input to
Resize
operator is of integral type and interpolation is to be performed, the rounding mode for the intermediary floating-point interpolated value is unspecified. ONNXRuntime currently seems to cast the intermediate float to the output type. But this floor behavior can lead to large biases when you're interpolating between two close values. Instead, it seems that rounding-to-even then casting would produce output that more closely tracks with the floating-point version.Could the intended behavior be clarified?
The text was updated successfully, but these errors were encountered: