Skip to content

Commit 1c3eb32

Browse files
author
Shay Kleiman
committed
[mlir][tosa] Fix indexing in TosaToTensor
Changed the indexing used in the extractOp from one that is intended for 0d tensors to one that is intended for 1d tensors.
1 parent 8818728 commit 1c3eb32

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mlir/lib/Conversion/TosaToTensor/TosaToTensor.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,8 @@ class PadConverter : public OpConversionPattern<tosa::PadOp> {
362362
// Setup the default constantAttr.
363363

364364
Value padConstant = rewriter.createOrFold<tensor::ExtractOp>(
365-
loc, padOp.getPadConst(), ValueRange({}));
365+
loc, padOp.getPadConst(),
366+
ValueRange({rewriter.create<arith::ConstantIndexOp>(loc, 0)}));
366367

367368
if (!padConstant) {
368369
return rewriter.notifyMatchFailure(

0 commit comments

Comments
 (0)