Changeset View
Changeset View
Standalone View
Standalone View
mlir/lib/Bindings/Python/IRCore.cpp
Show First 20 Lines • Show All 2,020 Lines • ▼ Show 20 Lines | py::class_<PyModule>(m, "Module", py::module_local()) | ||||
return printAccum.join(); | return printAccum.join(); | ||||
}, | }, | ||||
kOperationStrDunderDocstring); | kOperationStrDunderDocstring); | ||||
//---------------------------------------------------------------------------- | //---------------------------------------------------------------------------- | ||||
// Mapping of Operation. | // Mapping of Operation. | ||||
//---------------------------------------------------------------------------- | //---------------------------------------------------------------------------- | ||||
py::class_<PyOperationBase>(m, "_OperationBase", py::module_local()) | py::class_<PyOperationBase>(m, "_OperationBase", py::module_local()) | ||||
.def_property_readonly(MLIR_PYTHON_CAPI_PTR_ATTR, | |||||
[](PyOperationBase &self) { | |||||
return self.getOperation().getCapsule(); | |||||
}) | |||||
.def("__eq__", | .def("__eq__", | ||||
[](PyOperationBase &self, PyOperationBase &other) { | [](PyOperationBase &self, PyOperationBase &other) { | ||||
return &self.getOperation() == &other.getOperation(); | return &self.getOperation() == &other.getOperation(); | ||||
}) | }) | ||||
.def("__eq__", | .def("__eq__", | ||||
[](PyOperationBase &self, py::object other) { return false; }) | [](PyOperationBase &self, py::object other) { return false; }) | ||||
.def_property_readonly("attributes", | .def_property_readonly("attributes", | ||||
[](PyOperationBase &self) { | [](PyOperationBase &self) { | ||||
▲ Show 20 Lines • Show All 502 Lines • Show Last 20 Lines |