Skip to content

Commit fd8b78a

Browse files
committed
fix after rebase
1 parent 435eace commit fd8b78a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

mlir/include/mlir/Bindings/Python/IRCore.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1852,12 +1852,12 @@ class PyOpResult : public PyConcreteValue<PyOpResult> {
18521852
static void bindDerived(ClassTy &c) {
18531853
c.def_prop_ro(
18541854
"owner",
1855-
[](PyOpResult &self) -> nanobind::typed<nanobind::object, PyOperation> {
1855+
[](PyOpResult &self) -> nanobind::typed<nanobind::object, PyOpView> {
18561856
assert(mlirOperationEqual(self.getParentOperation()->get(),
18571857
mlirOpResultGetOwner(self.get())) &&
18581858
"expected the owner of the value in Python to match that in "
18591859
"the IR");
1860-
return self.getParentOperation().getObject();
1860+
return self.getParentOperation()->createOpView();
18611861
},
18621862
"Returns the operation that produces this result.");
18631863
c.def_prop_ro(

mlir/lib/Bindings/Python/MainModule.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1993,15 +1993,15 @@ static void populateIRCore(nb::module_ &m) {
19931993
kDumpDocstring)
19941994
.def_prop_ro(
19951995
"owner",
1996-
[](PyValue &self) -> nb::object {
1996+
[](PyValue &self) -> nb::typed<nb::object, PyOpView> {
19971997
MlirValue v = self.get();
19981998
if (mlirValueIsAOpResult(v)) {
19991999
assert(mlirOperationEqual(self.getParentOperation()->get(),
20002000
mlirOpResultGetOwner(self.get())) &&
20012001
"expected the owner of the value in Python to match "
20022002
"that in "
20032003
"the IR");
2004-
return self.getParentOperation().getObject();
2004+
return self.getParentOperation()->createOpView();
20052005
}
20062006

20072007
if (mlirValueIsABlockArgument(v)) {

0 commit comments

Comments
 (0)