-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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] Refine PhiKernelOp attributes name and delete some unused code #54891
[IR] Refine PhiKernelOp attributes name and delete some unused code #54891
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
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
单测删除
} | ||
|
||
const std::string PhiKernelOp::op_name() { | ||
return operation() |
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.
这儿直接调用 attributes()就可以。没必要加 operation()吧。后面的类似。
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.
在 #54944 完成修改
@@ -26,6 +27,9 @@ class PhiKernelOp : public ir::Op<PhiKernelOp> { | |||
static const char *name() { return "phi.kernel"; } | |||
static constexpr uint32_t attributes_num = 3; | |||
static const char *attributes_name[attributes_num]; | |||
const std::string op_name(); |
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.
要么返回 const string& ,要么返回string。 返回const string感觉没啥意义。后面类似。
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.
在 #54944 完成修改
@@ -143,7 +143,7 @@ class {op_name} : public ir::Op<{op_name}{interfaces}{traits}> {{ | |||
}} | |||
""" | |||
OP_INFER_SHAPE_TEMPLATE = """ | |||
void {op_name}::InferShape( phi::InferMetaContext *infer_meta ) {{ |
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.
InferMeta的生成逻辑是不是可以类似verify, 单独抽一个python文件出来? 感觉op_gen.py里面内容有点太多了。
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.
在 #54944 完成修改
PR types
Function optimization
PR changes
APIs
Description
本 pr 完善了 IR 多个遗留问题,包括:
Others
Pcard-67164