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

Provide opoperands(), opresults() methods for the Operation module #55903

Merged
merged 3 commits into from
Aug 8, 2023

Conversation

jjyaoao
Copy link
Contributor

@jjyaoao jjyaoao commented Aug 2, 2023

PR types

Others

PR changes

Others

Description

#55205 case 1.2

@paddle-bot
Copy link

paddle-bot bot commented Aug 2, 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.

@@ -37,6 +37,8 @@ struct OperationArgument {
std::vector<Type> output_types;
OpInfo info;
std::vector<std::unique_ptr<Region>> regions;
const std::vector<OpResult>& opoperands() const;
const std::vector<Type>& opresults() const;
Copy link
Contributor

Choose a reason for hiding this comment

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

其实这个任务是期望给 operation.h 的 Operation 里加两个接口的[捂脸],不是这里utils里的OperationArgument~~

Copy link
Contributor Author

Choose a reason for hiding this comment

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

其实这个任务是期望给 operation.h 的 Operation 里加两个接口的[捂脸],不是这里utils里的OperationArgument~~

Done

@@ -78,6 +80,11 @@ struct OperationArgument {
regions.emplace_back(new Region);
return regions.back().get();
}
// return all input
const std::vector<OpResult>& opoperands() const { return inputs; }
Copy link
Contributor

Choose a reason for hiding this comment

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

其实在pybind层已经有实现了。可以把这个两个函数的实现分别copy到Operation类里面,然后把pybind ir.cc文件里直接改为类似.def("result", &Operation::result)这样的直接函数映射形态即可~~

Copy link
Contributor Author

Choose a reason for hiding this comment

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

其实在pybind层已经有实现了。可以把这个两个函数的实现分别copy到Operation类里面,然后把pybind ir.cc文件里直接改为类似.def("result", &Operation::result)这样的直接函数映射形态即可~~

Done

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers HappyOpenSource 快乐开源活动issue与PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants