Skip to content

Commit d8ca036

Browse files
committed
fix upon review
1 parent 737d4a4 commit d8ca036

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

mlir/lib/Dialect/Linalg/Transforms/ElementwiseOpFusion.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,17 +1304,8 @@ struct FoldReshapeWithProducerPadOpByCollapsing
13041304
}
13051305

13061306
SmallVector<int64_t> staticCollapsedShape;
1307-
for (OpFoldResult dim : collapsedShape) {
1308-
if (auto attr = dyn_cast<Attribute>(dim)) {
1309-
if (auto intAttr = dyn_cast<IntegerAttr>(attr)) {
1310-
staticCollapsedShape.push_back(intAttr.getInt());
1311-
} else {
1312-
staticCollapsedShape.push_back(ShapedType::kDynamic);
1313-
}
1314-
} else {
1315-
staticCollapsedShape.push_back(ShapedType::kDynamic);
1316-
}
1317-
}
1307+
std::tie(staticCollapsedShape, std::ignore) =
1308+
decomposeMixedValues(collapsedShape);
13181309

13191310
auto newCollapseType = RankedTensorType::get(
13201311
staticCollapsedShape, padOp.getSource().getType().getElementType());

0 commit comments

Comments
 (0)