Skip to content

Commit 75c2dd9

Browse files
committed
reformat nb::sigs and add nb::args
1 parent 43da9a2 commit 75c2dd9

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

mlir/lib/Bindings/Python/Rewrite.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,10 @@ void mlir::python::populateRewriteSubmodule(nb::module_ &m) {
233233
"replace_op",
234234
[](PyPatternRewriter &self, MlirOperation op,
235235
MlirOperation newOp) { self.replaceOp(op, newOp); },
236-
"Replace an operation with a new operation.",
236+
"Replace an operation with a new operation.", nb::arg("op"),
237+
nb::arg("new_op"),
237238
// clang-format off
238-
nb::sig("def replace_op(self, op: " MAKE_MLIR_PYTHON_QUALNAME("ir.Operation")
239-
", new_op: " MAKE_MLIR_PYTHON_QUALNAME("ir.Operation") ") -> None")
239+
nb::sig("def replace_op(self, op: " MAKE_MLIR_PYTHON_QUALNAME("ir.Operation") ", new_op: " MAKE_MLIR_PYTHON_QUALNAME("ir.Operation") ") -> None")
240240
// clang-format on
241241
)
242242
.def(
@@ -245,13 +245,14 @@ void mlir::python::populateRewriteSubmodule(nb::module_ &m) {
245245
const std::vector<MlirValue> &values) {
246246
self.replaceOp(op, values);
247247
},
248-
"Replace an operation with a list of values.",
248+
"Replace an operation with a list of values.", nb::arg("op"),
249+
nb::arg("values"),
249250
// clang-format off
250-
nb::sig("def replace_op(self, op: " MAKE_MLIR_PYTHON_QUALNAME("ir.Operation")
251-
", values: list[" MAKE_MLIR_PYTHON_QUALNAME("ir.Value") "]) -> None")
251+
nb::sig("def replace_op(self, op: " MAKE_MLIR_PYTHON_QUALNAME("ir.Operation") ", values: list[" MAKE_MLIR_PYTHON_QUALNAME("ir.Value") "]) -> None")
252252
// clang-format on
253-
nb::arg("op"), nb::arg("values"))
253+
)
254254
.def("erase_op", &PyPatternRewriter::eraseOp, "Erase an operation.",
255+
nb::arg("op"),
255256
// clang-format off
256257
nb::sig("def erase_op(self, op: " MAKE_MLIR_PYTHON_QUALNAME("ir.Operation") ") -> None")
257258
// clang-format on

0 commit comments

Comments
 (0)