Skip to content

Commit 61c982f

Browse files
committed
Reduce diff to upstream
1 parent 48b573b commit 61c982f

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1579,7 +1579,7 @@ def Tosa_ConcatOp : Tosa_InferTensorTypeOp<"concat"> {
15791579
//===----------------------------------------------------------------------===//
15801580
// Operator: pad
15811581
//===----------------------------------------------------------------------===//
1582-
def Tosa_PadOp : Tosa_InferShapedTypeOp<"pad", [InferTensorType]> {
1582+
def Tosa_PadOp : Tosa_InferShapedTypeOp<"pad"> {
15831583
let summary = "Pads a tensor with value specified.";
15841584

15851585
let description = [{
@@ -1619,13 +1619,6 @@ def Tosa_PadOp : Tosa_InferShapedTypeOp<"pad", [InferTensorType]> {
16191619
let hasCanonicalizer = 1;
16201620
let hasFolder = 1;
16211621
let hasVerifier = 1;
1622-
1623-
let extraClassDeclaration = [{
1624-
/// Returns true when two result types are compatible for this op;
1625-
/// Method used by InferTypeOpInterface.
1626-
static bool isCompatibleReturnTypes(TypeRange l, TypeRange r);
1627-
}];
1628-
16291622
}
16301623

16311624
//===----------------------------------------------------------------------===//

mlir/lib/Dialect/Tosa/IR/TosaOps.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -800,8 +800,6 @@ LogicalResult tosa::PadOp::inferReturnTypeComponents(
800800
MLIRContext *context, ::std::optional<Location> location,
801801
PadOp::Adaptor adaptor,
802802
SmallVectorImpl<ShapedTypeComponents> &inferredReturnShapes) {
803-
804-
Type inputType = getElementTypeOrSelf(adaptor.getInput1());
805803
ShapeAdaptor inputShape(adaptor.getInput1().getType());
806804
ShapeAdaptor paddingShape(adaptor.getPadding().getType());
807805
SmallVector<int64_t> outputShape;
@@ -822,17 +820,15 @@ LogicalResult tosa::PadOp::inferReturnTypeComponents(
822820
}
823821

824822
outputShape.resize(paddingShape.getDimSize(0), ShapedType::kDynamic);
825-
inferredReturnShapes.push_back(
826-
ShapedTypeComponents(outputShape, inputType));
823+
inferredReturnShapes.push_back(ShapedTypeComponents(outputShape));
827824
return success();
828825
}
829826

830827
DenseIntElementsAttr paddings;
831828
// If the paddings value is not a constant, all dimensions must be dynamic.
832829
if (!matchPattern(adaptor.getPadding(), m_Constant(&paddings))) {
833830
outputShape.resize(inputShape.getRank(), ShapedType::kDynamic);
834-
inferredReturnShapes.push_back(
835-
ShapedTypeComponents(outputShape, inputType));
831+
inferredReturnShapes.push_back(ShapedTypeComponents(outputShape));
836832
return success();
837833
}
838834

@@ -852,7 +848,7 @@ LogicalResult tosa::PadOp::inferReturnTypeComponents(
852848
paddingValues[i * 2 + 1]);
853849
}
854850

855-
inferredReturnShapes.push_back(ShapedTypeComponents(outputShape, inputType));
851+
inferredReturnShapes.push_back(ShapedTypeComponents(outputShape));
856852
return success();
857853
}
858854

@@ -1423,7 +1419,6 @@ REDUCE_SHAPE_INFER(tosa::ReduceProdOp)
14231419
REDUCE_SHAPE_INFER(tosa::ReduceSumOp)
14241420
#undef REDUCE_SHAPE_INFER
14251421
COMPATIBLE_RETURN_TYPES(tosa::ConcatOp)
1426-
COMPATIBLE_RETURN_TYPES(tosa::PadOp)
14271422
#undef COMPATIBLE_RETURN_TYPES
14281423

14291424
template <typename T>

0 commit comments

Comments
 (0)