-
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
Provide opoperands(), opresults() methods for the Operation module #55903
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
paddle/ir/core/operation_utils.h
Outdated
@@ -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; |
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.
其实这个任务是期望给 operation.h 的 Operation 里加两个接口的[捂脸],不是这里utils里的OperationArgument~~
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.
其实这个任务是期望给 operation.h 的 Operation 里加两个接口的[捂脸],不是这里utils里的OperationArgument~~
Done
paddle/ir/core/operation_utils.h
Outdated
@@ -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; } |
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.
其实在pybind层已经有实现了。可以把这个两个函数的实现分别copy到Operation类里面,然后把pybind ir.cc文件里直接改为类似.def("result", &Operation::result)这样的直接函数映射形态即可~~
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.
其实在pybind层已经有实现了。可以把这个两个函数的实现分别copy到Operation类里面,然后把pybind ir.cc文件里直接改为类似.def("result", &Operation::result)这样的直接函数映射形态即可~~
Done
Signed-off-by: jjyaoao <[email protected]>
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
PR types
Others
PR changes
Others
Description
#55205 case 1.2