-
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
[PTen]Separate origin Kernel and add Kernel for C++ API #39002
[PTen]Separate origin Kernel and add Kernel for C++ API #39002
Conversation
Thanks for your contribution! |
@@ -22,104 +22,126 @@ limitations under the License. */ | |||
|
|||
namespace pten { |
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.
math里面的这些kernel,raw_kernel, dev_api的顺序后面也许可以整理一下,kernel太多了找起来会有点麻烦
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.
好的
@@ -130,7 +127,6 @@ | |||
param : [x, y, -1] |
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参数对齐API以后InterMeta的参数是不是也有和API保持一致的可能?
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.
下个pr修改
@@ -172,7 +167,7 @@ | |||
param: [x, axis, keep_dim, dtype] | |||
kernel : | |||
func : sum | |||
param : [x, axis, keep_dim, false, DataType::UNDEFINED] | |||
param : [x, axis, keep_dim] |
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.
这里能否使sum kernel的参数和API保持一致?
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
@@ -142,24 +142,25 @@ class ElementwiseOp : public framework::OperatorWithKernel { | |||
const framework::ExecutionContext &ctx) const override { | |||
if (Type() == "elementwise_add") { | |||
if (ctx.InputVar("X")->IsType<framework::LoDTensor>()) { | |||
return framework::KernelSignature("add", {"X", "Y"}, {"axis"}, {"Out"}); | |||
return framework::KernelSignature("add_raw", {"X", "Y"}, {"axis"}, |
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.
这里要既能找到raw也能找到非raw的吧,axis值无效的时候,直接使用非raw,raw是用来保底的
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
PR types
Function optimization
PR changes
Others
Describe
对Kernel分层,为C++ API添加新的注册Kernel,原始xxxKernel更改为xxxRawKernel