-
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
[Phi] Migrate unfold_op into phi #39778
Conversation
Thanks for your contribution! |
PADDLE_ENFORCE_GT( | ||
output_height, | ||
0, | ||
phi::errors::InvalidArgument( |
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.
一个讨论,话说其实正在phi里面,我们不用加这个phi的前缀,errors还有make_ddim,后面是不是统一把这些去掉让代码更简洁一些
namespace funcs { | ||
|
||
//////// CalcOutputSize Functor /////// | ||
inline int CalcOutputSize(int input_size, |
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.
common_shape.h的函数是多个Op公有的?这个CalcOutputSize函数是unfold单独用到的。另外后续common_shape.h 后续如果包含了超多函数,这里include会不会代码膨胀?
namespace funcs { | ||
|
||
//////// CalcOutputSize Functor /////// | ||
inline int CalcOutputSize(int input_size, |
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.
common_shape.h的函数是多个Op公有的?这个CalcOutputSize函数是unfold单独用到的。另外后续common_shape.h 后续如果包含了超多函数,这里include会不会代码膨胀?
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
namespace phi { | ||
|
||
template <typename T, typename Context> | ||
void UnfoldGradKernel(const Context& ctx, |
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.
目前kernel的Context模板参数变量名建议使用dev_ctx
namespace funcs { | ||
|
||
//////// CalcOutputSize Functor /////// | ||
inline int CalcOutputSize(int input_size, |
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.
如果这个函数只有unfold这个op使用的话,可以放到impl下,funcs下一般放的是多op使用的函数
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.
我在 #39796 这里会移动到impl目录里
PR types
Others
PR changes
OPs
Describe
[Phi] Migrate unfold_op into phi