Skip to content
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

Merged
merged 11 commits into from
Aug 2, 2023

Conversation

xiaoguoguo626807
Copy link
Contributor

@xiaoguoguo626807 xiaoguoguo626807 commented Jul 27, 2023

PR types

Others

PR changes

Others

Description

pcard-67164
增加部分pybind 接口
修改c++ operand 函数的 op_operand 为 operand ; operand 为 operand_source , 以明确返回值语义

@paddle-bot
Copy link

paddle-bot bot commented Jul 27, 2023

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@@ -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",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议:get_parent_program

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议:get_parent_block

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

.def("result", &Operation::result)
.def("operand", &Operation::op_operand)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

修改c++端op_operand命名为operand

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

YuanRisheng
YuanRisheng previously approved these changes Jul 28, 2023
zhangbo9674
zhangbo9674 previously approved these changes Jul 28, 2023
winter-wang
winter-wang previously approved these changes Jul 28, 2023
Copy link
Contributor

@winter-wang winter-wang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Aurelius84
Aurelius84 previously approved these changes Jul 31, 2023
Copy link
Contributor

@Aurelius84 Aurelius84 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

for opresult in matmul_op.results():
result_set.add(opresult)

# self.assertTrue(add_op.operands()[0].source() in result_set)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里是否还需要?注释代码如果还需要,建议也加注释说明

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这些代码依赖一些实现,下一个pr会解掉注释

@xiaoguoguo626807 xiaoguoguo626807 merged commit ef29468 into PaddlePaddle:develop Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants