@@ -352,7 +352,7 @@ static LogicalResult verifyConvOp(T op) {
352352
353353LogicalResult tosa::ConstOp::verify () {
354354
355- auto attrType = llvm::dyn_cast<TensorType>(getValueAttr ().getType ());
355+ auto attrType = llvm::dyn_cast<TensorType>(getValuesAttr ().getType ());
356356 auto outputType = llvm::dyn_cast<TensorType>(getOutput ().getType ());
357357
358358 if (!attrType || !outputType) {
@@ -1179,8 +1179,8 @@ LogicalResult tosa::PadOp::inferReturnTypeComponents(
11791179
11801180 SmallVector<int64_t > paddingValues;
11811181 // If the paddings value is not a constant, all dimensions must be dynamic.
1182- if (!tosa::getConstShapeValue (adaptor.getPadding ().getDefiningOp (),
1183- paddingValues)) {
1182+ if (!tosa::getConstShapeValues (adaptor.getPadding ().getDefiningOp (),
1183+ paddingValues)) {
11841184 outputShape.resize (inputShape.getRank (), ShapedType::kDynamic );
11851185 inferredReturnShapes.push_back (ShapedTypeComponents (outputShape));
11861186 return success ();
@@ -1252,8 +1252,8 @@ LogicalResult tosa::SliceOp::inferReturnTypeComponents(
12521252 SmallVector<int64_t > start;
12531253 SmallVector<int64_t > size;
12541254
1255- if (!tosa::getConstShapeValue (adaptor.getStart ().getDefiningOp (), start) ||
1256- !tosa::getConstShapeValue (adaptor.getSize ().getDefiningOp (), size)) {
1255+ if (!tosa::getConstShapeValues (adaptor.getStart ().getDefiningOp (), start) ||
1256+ !tosa::getConstShapeValues (adaptor.getSize ().getDefiningOp (), size)) {
12571257 auto rank = cast<tosa::shapeType>(adaptor.getSize ().getType ()).getRank ();
12581258 SmallVector<int64_t > fallback (rank, ShapedType::kDynamic );
12591259 inferredReturnShapes.push_back (ShapedTypeComponents (fallback, inputType));
@@ -1561,8 +1561,8 @@ LogicalResult tosa::ReshapeOp::inferReturnTypeComponents(
15611561 ShapeAdaptor inputShape (adaptor.getInput1 ().getType ());
15621562 Type inputType = getElementTypeOrSelf (adaptor.getInput1 ().getType ());
15631563 llvm::SmallVector<int64_t > newShapeValue;
1564- if (!tosa::getConstShapeValue (adaptor.getShape ().getDefiningOp (),
1565- newShapeValue)) {
1564+ if (!tosa::getConstShapeValues (adaptor.getShape ().getDefiningOp (),
1565+ newShapeValue)) {
15661566 auto rank = cast<tosa::shapeType>(adaptor.getShape ().getType ()).getRank ();
15671567 SmallVector<int64_t > fallback (rank, ShapedType::kDynamic );
15681568 inferredReturnShapes.push_back (ShapedTypeComponents (fallback, inputType));
@@ -1611,7 +1611,7 @@ llvm::LogicalResult tosa::ReshapeOp::verify() {
16111611 RankedTensorType outputType = getType ();
16121612
16131613 SmallVector<int64_t > shapeValues;
1614- if (!tosa::getConstShapeValue (getShape ().getDefiningOp (), shapeValues)) {
1614+ if (!tosa::getConstShapeValues (getShape ().getDefiningOp (), shapeValues)) {
16151615 // skip following checks if shape is not constant
16161616 return mlir::success ();
16171617 }
@@ -1916,11 +1916,12 @@ LogicalResult tosa::ResizeOp::inferReturnTypeComponents(
19161916 return failure ();
19171917
19181918 SmallVector<int64_t > scaleInt, offsetInt, borderInt;
1919- if (!tosa::getConstShapeValue (adaptor.getScale ().getDefiningOp (), scaleInt) ||
1920- !tosa::getConstShapeValue (adaptor.getOffset ().getDefiningOp (),
1921- offsetInt) ||
1922- !tosa::getConstShapeValue (adaptor.getBorder ().getDefiningOp (),
1923- borderInt)) {
1919+ if (!tosa::getConstShapeValues (adaptor.getScale ().getDefiningOp (),
1920+ scaleInt) ||
1921+ !tosa::getConstShapeValues (adaptor.getOffset ().getDefiningOp (),
1922+ offsetInt) ||
1923+ !tosa::getConstShapeValues (adaptor.getBorder ().getDefiningOp (),
1924+ borderInt)) {
19241925 return failure ();
19251926 }
19261927
@@ -1960,9 +1961,9 @@ LogicalResult tosa::ResizeOp::verify() {
19601961 SmallVector<int64_t > scaleValues;
19611962 SmallVector<int64_t > offsetValues;
19621963 SmallVector<int64_t > borderValues;
1963- if (!tosa::getConstShapeValue (getScale ().getDefiningOp (), scaleValues) ||
1964- !tosa::getConstShapeValue (getOffset ().getDefiningOp (), offsetValues) ||
1965- !tosa::getConstShapeValue (getBorder ().getDefiningOp (), borderValues)) {
1964+ if (!tosa::getConstShapeValues (getScale ().getDefiningOp (), scaleValues) ||
1965+ !tosa::getConstShapeValues (getOffset ().getDefiningOp (), offsetValues) ||
1966+ !tosa::getConstShapeValues (getBorder ().getDefiningOp (), borderValues)) {
19661967 // Skip following checks if shape is not constant
19671968 return success ();
19681969 }
@@ -3051,14 +3052,14 @@ OpTrait::tosa::verifyTosaShapeOperatorWithSameRanks(Operation *op) {
30513052
30523053LogicalResult tosa::ConstShapeOp::verify () {
30533054 // check one dimensional rank
3054- auto valuesRank = getValue ().getType ().getRank ();
3055+ auto valuesRank = getValues ().getType ().getRank ();
30553056 if (valuesRank != 1 )
3056- return emitOpError (" expect elements in attribute value with rank 1" );
3057- // check that number of elements in value attr equal to rank of result shape
3058- auto count = getValue ().getNumElements ();
3057+ return emitOpError (" expect elements in attribute values with rank 1" );
3058+ // check that number of elements in values attr equal to rank of result shape
3059+ auto count = getValues ().getNumElements ();
30593060 auto rank = (cast<tosa::shapeType>(getResult ().getType ())).getRank ();
30603061 if (!(count == rank || (count == 1 && rank == 0 ))) {
3061- return emitOpError (" expect number of elements in attribute value (" )
3062+ return emitOpError (" expect number of elements in attribute values (" )
30623063 << count << " ) to be equal to the rank (" << rank
30633064 << " ) for the result shape type" ;
30643065 }
0 commit comments