[Mlir-commits] [mlir] [mlir][python] Expose transform param types (PR #67421)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Tue Sep 26 06:15:59 PDT 2023
================
@@ -71,6 +85,28 @@ void populateDialectTransformSubmodule(const pybind11::module &m) {
return py::str(operationName.data, operationName.length);
},
"Get the name of the payload operation accepted by the handle.");
+
+ //===-------------------------------------------------------------------===//
+ // ParamType
+ //===-------------------------------------------------------------------===//
+
+ auto paramType =
+ mlir_type_subclass(m, "ParamType", mlirTypeIsATransformParamType);
+ paramType.def_classmethod(
+ "get",
+ [](py::object cls, MlirType type, MlirContext ctx) {
+ return cls(mlirTransformParamTypeGet(ctx, type));
+ },
+ "Get an instance of ParamType for the given type in the given context.",
+ py::arg("cls"), py::arg("type") = py::none(),
----------------
martin-luecke wrote:
In this case the bindings throw a `TypeError` Exception. I removed the default argument for `type` here as it is always required.
https://github.com/llvm/llvm-project/pull/67421
More information about the Mlir-commits
mailing list