-
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] transpose #54155
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
✅ This PR's description meets the template requirements! |
@@ -34,5 +34,3 @@ PD_REGISTER_BASE_KERNEL_NAME(transpose2_grad, transpose_grad); | |||
PD_REGISTER_ARG_MAPPING_FN(transpose2, phi::TransposeOpArgumentMapping); | |||
PD_REGISTER_ARG_MAPPING_FN(transpose2_grad, | |||
phi::TransposeGradOpArgumentMapping); | |||
PD_REGISTER_ARG_MAPPING_FN(transpose, phi::TransposeOpArgumentMapping); | |||
PD_REGISTER_ARG_MAPPING_FN(transpose_grad, phi::TransposeGradOpArgumentMapping); |
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.
不要修改transpose
,应该修改transpose2
相关的内容
auto &data_format = ctx.Attr<std::string>("data_format"); | ||
phi::DataLayout layout_ = phi::StringToDataLayout(data_format); | ||
return phi::KernelKey( | ||
ctx.GetPlace(), layout_, phi::TransToPhiDataType(data_type)); |
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.
不要修改transpose
,应该修改transpose2
相关的内容
paddle/phi/api/yaml/static_ops.yaml
Outdated
- op : transpose | ||
args : (Tensor x, int[] perm) | ||
output : Tensor | ||
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.
配置到ops.yaml
- backward_op : transpose_grad | ||
forward : transpose (Tensor x, int[] perm) -> Tensor(out) | ||
args : (Tensor out_grad, int[] perm) | ||
output : Tensor(x_grad) |
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.
配置到 backward.yaml
# Conflicts: # paddle/phi/api/yaml/static_ops.yaml
paddle/phi/api/yaml/ops.yaml
Outdated
@@ -2242,6 +2242,15 @@ | |||
func : trace | |||
backward : trace_grad | |||
|
|||
- op : transpose (transpose2) |
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 : transpose (transpose2)
-->- op : transpose
Sorry to inform you that 11d9e9a's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
@@ -2242,6 +2242,15 @@ | |||
func : trace | |||
backward : trace_grad | |||
|
|||
- op : transpose | |||
args : (Tensor x, int[] perm) | |||
output : Tensor |
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.
output : Tensor(out), Tensor(xshape)
intermediate : xshape
@@ -107,138 +107,6 @@ class TransposeOpGrad : public framework::OperatorWithKernel { | |||
} | |||
}; | |||
|
|||
void Transpose2Op::InferShape(framework::InferShapeContext *ctx) const { | |||
using CompatMetaTensor = framework::CompatMetaTensor; |
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.
Transpose2Op
跟FusedTransposeOpMaker
耦合,而且infershape
也需要修改支持,建议这个任务可以先行关闭。
很抱歉,经过我们的反复讨论,你的PR暂未达到合入标准,请阅读飞桨原生算子开发规范,你可以重新提交新的PR,我们先将此PR关闭,感谢你的贡献。 |
PR types
Others
PR changes
Others
Description
#53267 case1