[Mlir-commits] [mlir] [mlir][python] Expose transform param types (PR #67421)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Tue Sep 26 05:24:20 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(),
----------------
ftynse wrote:

What happens if "type" is None here? I don't think we can construct a parameter type around a null type, can we?

https://github.com/llvm/llvm-project/pull/67421


More information about the Mlir-commits mailing list