Index: mlir/test/mlir-linalg-ods-gen/test-linalg-ods-yaml-gen.yaml =================================================================== --- mlir/test/mlir-linalg-ods-gen/test-linalg-ods-yaml-gen.yaml +++ mlir/test/mlir-linalg-ods-gen/test-linalg-ods-yaml-gen.yaml @@ -84,6 +84,10 @@ # ODS: buildStructuredOp($_builder, $_state, resultTensorTypes, # ODS-NEXT: attributes, Test1Op::getRegionBuilder()) +# ODS: std::pair getDpsInitsPositionRange() { +# ODS-NEXT: int64_t getNumOperands = this->getNumOperands(); +# ODS-NEXT: return {getNumOperands - getOutputs().size(), getNumOperands}; +# ODS-NEXT: } # IMPL-LABEL: void Test1Op::regionBuilder(ImplicitLocOpBuilder &b, # IMPL-NEXT: Block &block, ArrayRef attrs) Index: mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp =================================================================== --- mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp +++ mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp @@ -565,7 +565,7 @@ std::pair getDpsInitsPositionRange() {{ int64_t getNumOperands = this->getNumOperands(); - return {{getNumOperands - 1, getNumOperands}; + return {{getNumOperands - getOutputs().size(), getNumOperands}; } // Generic methods.