Fix bugs in handling of negative slice + gather indices#10973
Fix bugs in handling of negative slice + gather indices#10973jamesr66a wants to merge 1 commit intopytorch:masterfrom
Conversation
629ad8e to
b01f6e1
Compare
houseroad
left a comment
There was a problem hiding this comment.
LG, could you also add some test cases in test_pytorch_onnx_caffe2.py? Also update the doc https://github.com/pytorch/pytorch/blob/master/caffe2/python/onnx/ONNXOpCoverage.md
|
expect files need to be updated. Also we need to make sure that it works on the cases which axis is higher than 2 (according to the doc, c2 gather has problem with higher axis) |
b01f6e1 to
bb0bd9d
Compare
facebook-github-bot
left a comment
There was a problem hiding this comment.
jamesr66a has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
houseroad
left a comment
There was a problem hiding this comment.
Can we check the axis, if it 0 or 1, we emit Gather, otherwise, we emit Sliceand Squeeze.
bb0bd9d to
f88edfc
Compare
torch/onnx/symbolic.py
Outdated
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.
ccaab3d to
39359c6
Compare
facebook-github-bot
left a comment
There was a problem hiding this comment.
jamesr66a has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
39359c6 to
f16f72a
Compare
|
@jamesr66a thanks for adding the fall back :-) agree, best solution is extending caffe2's kernels. |
facebook-github-bot
left a comment
There was a problem hiding this comment.
jamesr66a is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Summary: This fixes multiple bugs in the handling of negative indices in both slicing and gather operations. These were uncovered by @[1466077526:Elias Ellison]'s diff D9493614, which made it so that we actually emit negative indices when we see them in PyTorch code. Pull Request resolved: pytorch#10973 Reviewed By: jhcross Differential Revision: D9546183 Pulled By: jhcross fbshipit-source-id: 32b0362eee757e67c5a09144131b1d4eadb9f760
f16f72a to
dbb0043
Compare
Summary: This fixes multiple bugs in the handling of negative indices in both slicing and gather operations. These were uncovered by @[1466077526:Elias Ellison]'s diff D9493614, which made it so that we actually emit negative indices when we see them in PyTorch code. Pull Request resolved: pytorch#10973 Reviewed By: jhcross Differential Revision: D9546183 Pulled By: jamesr66a fbshipit-source-id: 6cb0e84e8ad399e47e24a96c44025f644c17b375
Summary: This fixes multiple bugs in the handling of negative indices in both slicing and gather operations. These were uncovered by @[1466077526:Elias Ellison]'s diff D9493614, which made it so that we actually emit negative indices when we see them in PyTorch code.
Differential Revision: D9546183