File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -1109,16 +1109,15 @@ LogicalResult tosa::ScatterOp::inferReturnTypeComponents(
1109
1109
static LogicalResult ReduceInferReturnTypes (
1110
1110
ShapeAdaptor operandShape, Type inputType, IntegerAttr axis,
1111
1111
SmallVectorImpl<ShapedTypeComponents> &inferredReturnShapes) {
1112
- if (!operandShape.hasRank () || operandShape.getRank () == 0 ) {
1112
+ int64_t axisVal = axis.getValue ().getSExtValue ();
1113
+ if (!operandShape.hasRank () || operandShape.getRank () <= axisVal) {
1113
1114
inferredReturnShapes.push_back (ShapedTypeComponents (inputType));
1114
1115
return success ();
1115
1116
}
1116
1117
1117
1118
SmallVector<int64_t > outputShape;
1118
1119
operandShape.getDims (outputShape);
1119
- int64_t axisVal = axis.getValue ().getSExtValue ();
1120
- if (axisVal < operandShape.getRank ())
1121
- outputShape[axisVal] = 1 ;
1120
+ outputShape[axisVal] = 1 ;
1122
1121
inferredReturnShapes.push_back (ShapedTypeComponents (outputShape, inputType));
1123
1122
return success ();
1124
1123
}
You can’t perform that action at this time.
0 commit comments