@@ -3056,7 +3056,7 @@ static LogicalResult verifyReduceOp(T op) {
3056
3056
int64_t inputRank = inputType.getRank ();
3057
3057
// We allow for a special case where the input/output shape has rank 0 and
3058
3058
// axis is also 0.
3059
- if (reduceAxis >= inputRank && ! (reduceAxis == 0 && inputRank = = 0 )) {
3059
+ if (reduceAxis >= inputRank && (reduceAxis != 0 || inputRank ! = 0 )) {
3060
3060
op.emitOpError (" expect input tensor rank (" )
3061
3061
<< inputRank << " ) to be larger than reduce axis (" << reduceAxis
3062
3062
<< " )" ;
@@ -3070,7 +3070,7 @@ static LogicalResult verifyReduceOp(T op) {
3070
3070
" expect output tensor rank to be equal to input tensor rank" );
3071
3071
return failure ();
3072
3072
}
3073
- if (reduceAxis >= outputRank && ! (reduceAxis == 0 && outputRank = = 0 )) {
3073
+ if (reduceAxis >= outputRank && (reduceAxis != 0 || outputRank ! = 0 )) {
3074
3074
op.emitOpError (" expect output tensor rank (" )
3075
3075
<< outputRank << " ) to be larger than reduce axis (" << reduceAxis
3076
3076
<< " )" ;
@@ -4105,7 +4105,7 @@ LogicalResult ReverseOp::verify() {
4105
4105
int64_t inputRank = inputType.getRank ();
4106
4106
// We allow for a special case where the input/output shape has rank 0 and
4107
4107
// axis is also 0.
4108
- if (reverseAxis >= inputRank && ! (reverseAxis == 0 && inputRank = = 0 ))
4108
+ if (reverseAxis >= inputRank && (reverseAxis != 0 || inputRank ! = 0 ))
4109
4109
return emitOpError (" expect input tensor rank (" )
4110
4110
<< inputRank << " ) to be larger than reverse axis (" << reverseAxis
4111
4111
<< " )" ;
@@ -4115,7 +4115,7 @@ LogicalResult ReverseOp::verify() {
4115
4115
if (inputType.hasRank () && outputRank != inputType.getRank ())
4116
4116
return emitOpError (
4117
4117
" expect output tensor rank to be equal to input tensor rank" );
4118
- if (reverseAxis >= outputRank && ! (reverseAxis == 0 && outputRank = = 0 ))
4118
+ if (reverseAxis >= outputRank && (reverseAxis != 0 || outputRank ! = 0 ))
4119
4119
return emitOpError (" expect output tensor rank (" )
4120
4120
<< outputRank << " ) to be larger than reverse axis ("
4121
4121
<< reverseAxis << " )" ;
@@ -4330,7 +4330,7 @@ LogicalResult tosa::ConstShapeOp::verify() {
4330
4330
// check that number of elements in values attr equal to rank of result shape
4331
4331
auto count = getValues ().getNumElements ();
4332
4332
auto rank = (cast<tosa::shapeType>(getResult ().getType ())).getRank ();
4333
- if (!( count == rank || (count == 1 && rank == 0 ) )) {
4333
+ if (count != rank && (count != 1 || rank != 0 )) {
4334
4334
return emitOpError (" expect number of elements in attribute values (" )
4335
4335
<< count << " ) to be equal to the rank (" << rank
4336
4336
<< " ) for the result shape type" ;
0 commit comments