-
Notifications
You must be signed in to change notification settings - Fork 489
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
fix squeeze op lowering issue when dim is not in sorted order #5751
Conversation
@@ -49,6 +49,9 @@ xla::XlaOp BuildMaskedFillScalar(xla::XlaOp input, xla::XlaOp mask, | |||
std::vector<int64_t> BuildSqueezedDimensions( |
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.
The above one should be a special case of the 2nd one, shall we just keep the second one?
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.
Thanks for the point, I leave the original signature there in case program still relays on the 1st one. However, I just made the update in 1st one function to call 2nd function to simplify the coding.
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.
LGTM, thanks!
…h#5751) * fix squeeze op lowering issue when dim is not in sorted order * remove debug info * remove debug info * refactor BuildSqueezedDimensions
* fix squeeze op lowering issue when dim is not in sorted order * remove debug info * remove debug info * refactor BuildSqueezedDimensions
* fix squeeze op lowering issue when dim is not in sorted order * remove debug info * remove debug info * refactor BuildSqueezedDimensions
…h#5751) * fix squeeze op lowering issue when dim is not in sorted order * remove debug info * remove debug info * refactor BuildSqueezedDimensions
* fix squeeze op lowering issue when dim is not in sorted order * remove debug info * remove debug info * refactor BuildSqueezedDimensions
* fix squeeze op lowering issue when dim is not in sorted order * remove debug info * remove debug info * refactor BuildSqueezedDimensions
We notice that torch.ops.aten.sequeeze(tensor, dims) will throw out an error if the dims is not in sorted order after we convert it to Canonical dimensions. Meanwhile if the dims = [-1], it will also throw out an error.
The issue is mostly due to the logic here.
We make the logic fix and add the test case in the pr.