Skip to content

Set coordinate_transformation_mode=asymmetric when rewriting Upsample to Reshape to get same output. #3096

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jorickert
Copy link
Collaborator

@jorickert jorickert commented Mar 17, 2025

Edit: Need to investigate why onnx-runtime and the backend tests have different results

Before the rewrite would rewrite to an reshape with the default coordinate_transformation_mode = "half_pixel", but this leads to a different output when comparing with onnx runtime.
Tested using onnx runtime, with one model having a Reshape Op and one an Upsample. With coordinate_transformation_mode = "half_pixel" the output had some differences, with coordinate_transformation_mode = "asymmetric" the output was the same.
Comment in ORT about this: microsoft/onnxruntime#1179 (comment)

IMO the onnx documentation for Upsample is not very detailed and its hard to know how to do the Upsample -> Reshape rewrite when just looking at the documentation.

… to Reshape, to get same output as onnx runtime

Signed-off-by: Rickert, Jonas <[email protected]>
@jorickert jorickert requested a review from philass March 17, 2025 12:22
@jorickert jorickert marked this pull request as draft March 17, 2025 16:38
@jorickert jorickert removed the request for review from philass March 17, 2025 16:38
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.

1 participant