[MLIR][python bindings] implement PyValue subclassing to enable operator overloading

Differential Revision: https://reviews.llvm.org/D147758
This commit is contained in:
max committed 2023-04-14 14:25:06 -05:00
1 parent bfa02523b2
commit 69cc3cfb21
7 files changed
+96 -1

No files matched your search

@@ -40,4 +40,7 @@ PYBIND11_MODULE(_mlirPythonTest, m) {
return cls(mlirPythonTestTestTypeGet(ctx));
},
py::arg("cls"), py::arg("context") = py::none());
mlir_value_subclass(m, "TestTensorValue",
mlirTypeIsAPythonTestTestTensorValue)
.def("is_null", [](MlirValue &self) { return mlirValueIsNull(self); });
}