mirror of
https://github.com/intel/llvm.git
synced 2026-01-13 19:08:21 +08:00
[MLIR] [Python] Add owner to mlir.ir.Block
Provides a way for python users to access the owning Operation from a Block.
This commit is contained in:
@@ -2200,6 +2200,12 @@ void mlir::python::populateIRCore(py::module &m) {
|
||||
// Mapping of PyBlock.
|
||||
//----------------------------------------------------------------------------
|
||||
py::class_<PyBlock>(m, "Block")
|
||||
.def_property_readonly(
|
||||
"owner",
|
||||
[](PyBlock &self) {
|
||||
return self.getParentOperation()->createOpView();
|
||||
},
|
||||
"Returns the owning operation of this block.")
|
||||
.def_property_readonly(
|
||||
"arguments",
|
||||
[](PyBlock &self) {
|
||||
|
||||
Reference in New Issue
Block a user