-
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
[IR] OpTrait & OpInterface & OpInfo #52846
[IR] OpTrait & OpInterface & OpInfo #52846
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
… dev/new_ir_op_system
@@ -60,9 +60,9 @@ DictionaryAttributeStorage::ParamKey DictionaryAttributeStorage::GetAsKey() | |||
|
|||
Attribute DictionaryAttributeStorage::GetValue(const StrAttribute &name) const { | |||
if (size_ > 0) { |
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.
这儿的二分是不是可以直接 left = 0, right = size, 没必要判断size>0啊?
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, tks!
paddle/ir/builtin_op.h
Outdated
/// interface functions, and Model is a template class that defines the specific | ||
/// implementation of interface functions based on template parameters. | ||
/// | ||
class InferShapeInterface : public OpInterfaceBase<InferShapeInterface> { |
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.
这个InferShapeInterface需要想办法跟paddle里面的phi里面的infershpe关联起来。
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.
好的,该内容已记录 Todo,Program 表示阶段进行开发。
paddle/ir/ir_context.cc
Outdated
registed_operations_.emplace(type_id, opinfo); | ||
} | ||
|
||
OpInfoImpl *GetOperation(ir::TypeId type_id) { |
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.
这个函数名是不是改成GetOpInfo更合适一点?
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, ths!
paddle/ir/op_info_impl.h
Outdated
template <typename T> | ||
static void PlacementConstrctInterface( | ||
std::pair<TypeId, void *> *&p_interface) { // NOLINT | ||
void *ptmp = malloc(sizeof(typename T::template Model<ConcreteOp>)); |
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.
这儿为啥不直接p_interface->second = malloc(.......)呢?
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.
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
4464df4
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
Sorry to inform you that 4464df4's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
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
New features
PR changes
Others
Description
1. 主要内容
2. 各数据结构关系
Other
Pcard-67164