fix #10838 incorrect bidirectional output format#11368
fix #10838 incorrect bidirectional output format#11368tengyifei wants to merge 2 commits intopytorch:masterfrom
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.
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.