-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
【new ir】add ir pybind api #55745
【new ir】add ir pybind api #55745
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
paddle/fluid/pybind/ir.cc
Outdated
@@ -64,6 +64,8 @@ void BindProgram(py::module *m) { | |||
void BindBlock(py::module *m) { | |||
py::class_<Block> block(*m, "Block"); | |||
block.def("front", &Block::front, return_value_policy::reference) | |||
.def("get_program", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议:get_parent_program
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
paddle/fluid/pybind/ir.cc
Outdated
@@ -81,9 +83,11 @@ void BindBlock(py::module *m) { | |||
void BindOperation(py::module *m) { | |||
py::class_<Operation> op(*m, "Operation"); | |||
op.def("name", &Operation::name) | |||
.def("get_parent", &Operation::GetParent, return_value_policy::reference) | |||
.def("get_block", &Operation::GetParent, return_value_policy::reference) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议:get_parent_block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
paddle/fluid/pybind/ir.cc
Outdated
.def("result", &Operation::result) | ||
.def("operand", &Operation::op_operand) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修改c++端op_operand命名为operand
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
c9eb1f9
e23e74a
to
94b3930
Compare
for opresult in matmul_op.results(): | ||
result_set.add(opresult) | ||
|
||
# self.assertTrue(add_op.operands()[0].source() in result_set) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里是否还需要?注释代码如果还需要,建议也加注释说明
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这些代码依赖一些实现,下一个pr会解掉注释
PR types
Others
PR changes
Others
Description
pcard-67164
增加部分pybind 接口
修改c++ operand 函数的 op_operand 为 operand ; operand 为 operand_source , 以明确返回值语义