-
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
[static op generation] tile #53317
[static op generation] tile #53317
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
❌ The PR is not created using PR's template. You can refer to this Demo. |
# Conflicts: # paddle/fluid/operators/tile_op.cc
args : (Tensor x, IntArray repeat_times = {}) | ||
output : Tensor(out) | ||
infer_meta : | ||
func : TileInferMeta |
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.
在op_compat.yaml
中增加
manual_signature : [tile]
表示tile的signature保持手写,但是tle_grad和tile_double_grad不需要保持手写,所以需要删除paddle/phi/ops/compat/tile_sig.cc
中grad的相关代码,保留tile的代码
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.
应该写 manual_signature : [tile, tile_grad]
吧, tle_grad 也需要保持手写
Paddle/paddle/phi/ops/compat/tile_sig.cc
Line 34 in 0fac328
KernelSignature TileGradOpArgumentMapping(const ArgumentMappingContext& ctx) { |
infer_meta : | ||
func : TileInferMeta | ||
kernel : | ||
func : tile |
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.
增加data_type : x
AddAttr<std::vector<int>>("repeat_times", | ||
"The number of repeat times for each dimension.") | ||
.SetDefault({}) | ||
.SupportTensor(); |
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.
目前看来这里存在一个特殊的情况,repeat_times
这个attr既有SupportTensor
属性,又支持RepeatTimes
和repeat_times_tensor
,极度不规范,这个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.
确实, 如果在op_compat.yaml
添加support_tensor : true
- op : tile
backward : tile_grad, tile_double_grad
inputs :
x : X
outputs :
out : Out
int_array:
repeat_times :
data_type : int
tensor_name : RepeatTimes
tensors_name : repeat_times_tensor
support_tensor : true
manual_signature : [tile, tile_grad]
将会变成
class TileOpMaker : public framework::OpProtoAndCheckerMaker {
public:
void Make() override {
AddInput("X", "(Tensor), input 0 of tile op.");
AddOutput("Out", "(Tensor), output 0 of tile op.");
AddAttr<std::vector<int>>("repeat_times", "(std::vector<int>), attribute 0 for tile op.")
.SetDefault({})
.SupportTensor();
AddComment(R"DOC(
TODO: Documentation of tile op.
)DOC");
}
};
Sorry to inform you that a24890d's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
很抱歉,经过我们的反复讨论,你的PR暂未达到合入标准,请阅读飞桨原生算子开发规范,你可以重新提交新的PR,我们先将此PR关闭,感谢你的贡献。 |
PR types
Others
PR changes
Others
Description
相关链接