-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[ONNX] Support gather export with OneHot + Mul #21235
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
Conversation
facebook-github-bot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@houseroad has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
|
||
| @parse_args('v', 'i', 'v', 'v') | ||
| def gather(g, self, dim, index, sparse_grad=False): | ||
| # NOTE: Update this workaround if ONNX has native Gather support. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe rephrase to say that current onnx::Gather does not directly support torch.Gather.
|
|
||
|
|
||
| @parse_args('v', 'i', 'v', 'v') | ||
| def gather(g, self, dim, index, sparse_grad=False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should also support Opset 10 export, correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think so. Should be able to fall back to opset 9's symoblics.
facebook-github-bot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@houseroad has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
@pytorchbot retest this please |
|
@houseroad merged this pull request in 63a55d4. |
This could serve as a alternative solution to export
torch.gatherbefore something similar goes into ONNX spec. The exported model is verified to be correct against onnxruntime backend. We weren't able to test against Caffe2 backend because it doesn't seem to support OneHot opset9.