-
Notifications
You must be signed in to change notification settings - Fork 14.4k
[mlir][tosa] Fix indexing in TosaToTensor #140906
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
[mlir][tosa] Fix indexing in TosaToTensor #140906
Conversation
@llvm/pr-subscribers-mlir @llvm/pr-subscribers-mlir-tosa Author: Shay Kleiman (shay-kl) ChangesChanged the indexing used in the extractOp from one that is intended for 0d tensors to one that is intended for 1d tensors. Full diff: https://github.com/llvm/llvm-project/pull/140906.diff 1 Files Affected:
diff --git a/mlir/lib/Conversion/TosaToTensor/TosaToTensor.cpp b/mlir/lib/Conversion/TosaToTensor/TosaToTensor.cpp
index 5f23a33049f87..4f565607e2167 100644
--- a/mlir/lib/Conversion/TosaToTensor/TosaToTensor.cpp
+++ b/mlir/lib/Conversion/TosaToTensor/TosaToTensor.cpp
@@ -362,7 +362,8 @@ class PadConverter : public OpConversionPattern<tosa::PadOp> {
// Setup the default constantAttr.
Value padConstant = rewriter.createOrFold<tensor::ExtractOp>(
- loc, padOp.getPadConst(), ValueRange({}));
+ loc, padOp.getPadConst(),
+ ValueRange({rewriter.create<arith::ConstantIndexOp>(loc, 0)}));
if (!padConstant) {
return rewriter.notifyMatchFailure(
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
Changed the indexing used in the extractOp from one that is intended for 0d tensors to one that is intended for 1d tensors.
1c3eb32
to
216a5f2
Compare
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.
f755b61
to
8cc4f3b
Compare
I don't have permissions, can you please land it? |
8cc4f3b
to
41151d6
Compare
Changed the indexing used in the extractOp from one that is intended for 0d tensors to one that is intended for 1d tensors. --------- Co-authored-by: Shay Kleiman <[email protected]>
Changed the indexing used in the extractOp from one that is intended for 0d tensors to one that is intended for 1d tensors. --------- Co-authored-by: Shay Kleiman <[email protected]>
Changed the indexing used in the extractOp from one that is intended for 0d tensors to one that is intended for 1d tensors.