diff --git a/mlir/test/mlir-tblgen/op-python-bindings.td b/mlir/test/mlir-tblgen/op-python-bindings.td index 9355fc4aeb3a..b5c824e66299 100644 --- a/mlir/test/mlir-tblgen/op-python-bindings.td +++ b/mlir/test/mlir-tblgen/op-python-bindings.td @@ -405,11 +405,11 @@ def VariadicAndNormalRegionOp : TestOp<"variadic_and_normal_region"> { let regions = (region AnyRegion:$region, AnyRegion, VariadicRegion:$variadic); // CHECK: @builtins.property - // CHECK: def region(): + // CHECK: def region(self): // CHECK: return self.regions[0] // CHECK: @builtins.property - // CHECK: def variadic(): + // CHECK: def variadic(self): // CHECK: return self.regions[2:] } @@ -429,7 +429,7 @@ def VariadicRegionOp : TestOp<"variadic_region"> { let regions = (region VariadicRegion:$Variadic); // CHECK: @builtins.property - // CHECK: def Variadic(): + // CHECK: def Variadic(self): // CHECK: return self.regions[0:] } diff --git a/mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp b/mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp index 039827ecf083..f55f0508a58b 100644 --- a/mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp +++ b/mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp @@ -254,7 +254,7 @@ constexpr const char *attributeDeleterTemplate = R"Py( constexpr const char *regionAccessorTemplate = R"PY( @builtins.property - def {0}(): + def {0}(self): return self.regions[{1}] )PY";