-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
torch.Tensor.as_strided
yields not the same results after conversion to ONNX with CPUExecutionProvider
#13920
Comments
Oh did not know we could click on there. Awesome! Yes, you can find the model exported as in my original post here and a preview in netron here. I suspect that the
Edit: oh, yes, it seems the graph is wrong. There are hard-coded values in |
Yes, please open an issue on torch and mention me. Thanks for doing the hard work to isolate the issue! |
Great thanks! |
Describe the issue
Exporting a very simple PyTorch model with a
tensor.as_strided()
operation, no warning or error is raised during the export.However, the results are different compared to PyTorch when running with ONNX Runtime. It could be related to a limited dynamic shape support.
To reproduce
Define the model:
Export to ONNX:
No warning or error whatsoever is shown during the export.
Then, compare the inference between PyTorch and ONNX Runtime with CPUExecutionProvider:
Prints:
Same issue doing the export with opset 15, 16, 17.
PyTorch version: 1.13.1
@justinchuby https://www.justinchuby.com/torch-onnx-op-matrix/ shows
Broken support
foras_strided
, is it related to my issue? In pytorch/pytorch#80039as_strided
is marked as supported so not sure.Thanks everyone!
Urgency
mediumish
Platform
Linux
OS Version
Linux 5.15.0-56-generic #62-Ubuntu SMP Tue Nov 22 19:54:14 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
ONNX Runtime Installation
Released Package
ONNX Runtime Version or Commit ID
1.13.1
ONNX Runtime API
Python
Architecture
X64
Execution Provider
Default CPU
Execution Provider Library Version
No response
The text was updated successfully, but these errors were encountered: