@@ -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)
14231419REDUCE_SHAPE_INFER(tosa::ReduceSumOp)
14241420#undef REDUCE_SHAPE_INFER
14251421COMPATIBLE_RETURN_TYPES (tosa::ConcatOp)
1426- COMPATIBLE_RETURN_TYPES(tosa::PadOp)
14271422#undef COMPATIBLE_RETURN_TYPES
14281423
14291424template <typename T>
0 commit comments