-
Notifications
You must be signed in to change notification settings - Fork 26.3k
fix #10838 incorrect bidirectional output format #11368
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
|
@tengyifei have you tested this patch with your use-case? |
|
@soumith Correct. The use case was converting the exported ONNX model to other formats e.g. TensorFlow, which typically assume the |
torch/onnx/symbolic.py
Outdated
| # We have to convert to match pytorch's expected | ||
| # seq_len, batch, hidden_size * num_directions | ||
| # seq_len, batch, num_directions * hidden_size | ||
| # by first moving num_directions to the end with |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
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.
soumith is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
thank you! |
Summary: Fixes the issue discussed in pytorch#10838. `hidden_size` should be the last dimension regardless if we're in ONNX or PyTorch. Pull Request resolved: pytorch#11368 Differential Revision: D9734814 Pulled By: soumith fbshipit-source-id: 7f69947a029964e092c7b88d1d79b188a417bf5f
Fixes the issue discussed in #10838.
hidden_sizeshould be the last dimension regardless if we're in ONNX or PyTorch.