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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ONNX][Complex] Support view_as_complex #49793

Closed
iou2much opened this issue Dec 23, 2020 · 9 comments
Closed

[ONNX][Complex] Support view_as_complex #49793

iou2much opened this issue Dec 23, 2020 · 9 comments
Labels
feature A request for a proper, new feature. module: onnx Related to torch.onnx triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@iou2much
Copy link

iou2much commented Dec 23, 2020

馃殌 Feature

would you support view_as_complex for converting to onnx model? Thanks a lot

Motivation

when I try to convert a nn contains complex tensor computation, it says:

Pytorch export onnx: RuntimeError Exporting the operator view_as_complex to ONNX opset version 9 is not supported. Please open a bug to request ONNX export support for the missing operator

also : onnx/onnx#3173

cc @houseroad @spandantiwari @lara-hdr @BowenBao @neginraoof

@iou2much
Copy link
Author

iou2much commented Dec 23, 2020

I'm also trying to do it myself, following this doc, but I'm quite new to pytorch. I'm not sure how to implement a new method which is not standardized in Onnx.

@mruberry mruberry added feature A request for a proper, new feature. module: onnx Related to torch.onnx triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module labels Dec 29, 2020
@spandantiwari
Copy link

@iou2much - We can put this on the backlog, but we do not have immediate plans for adding support for this. Please consider sending a PR for adding support. If you are trying to export this as custom op, I think this doc could be useful.
https://github.com/onnx/tutorials/tree/master/PyTorchCustomOperator

@iou2much
Copy link
Author

iou2much commented Jan 5, 2021

Thank you. Let me try

@urinieto
Copy link
Contributor

Is there still not enough interest to support this? Note that the STFT ONNX operator on PyTorch requires this and view_as_real for full compatibility (#92087).

@justinchuby
Copy link
Collaborator

@urinieto we will need new onnx operators to support this. I can create an issue when I鈥檓 back

@justinchuby
Copy link
Collaborator

Complex number support will be handled via the torch.onnx.dynamo_export exporter.

@mush42
Copy link

mush42 commented Nov 17, 2023

When will this be available in dev builds?

@justinchuby
Copy link
Collaborator

It is available. You can use the latest onnxscript

@jinhonglu
Copy link

It seems that there is still problem of exporting complex number with dynamo_export

#121100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A request for a proper, new feature. module: onnx Related to torch.onnx triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
Status: Done
Development

No branches or pull requests

7 participants