-
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
[PTen]Support XPU for Flatten Kernel #36957
[PTen]Support XPU for Flatten Kernel #36957
Conversation
… op2func_refactor
… op2func_refactor
…into flatten_refactor
* add a candidate dense tensor class, test=develop * remove TensorBase::backend(), test=develop * remove some ops, test=develop * cherry-pick the pr of tensor meta, test=develop * moves the dense tensor and some ops, test=develop * update the linalg operator, test=develop * update other operators, test=develop * fix errors, test=develop * fix bugs, test=develop * try to resolve the problem of windows ci, test=develop * updates codes, test=develop * fix the tensor_utils.cc, test=develop * modify the dense tensor, test=develop * fix the data type, test=develop Co-authored-by: shixiaowei02 <39303645+Shixiaowei02@users.noreply.github.com>
…into op2func_refactor
Thanks for your contribution! |
paddle/fluid/operators/flatten_op.cc
Outdated
@@ -80,13 +80,13 @@ class FlattenOp : public framework::OperatorWithKernel { | |||
auto input_data_type = | |||
framework::OperatorWithKernel::IndicateVarDataType(ctx, "X"); | |||
|
|||
//#ifdef PADDLE_WITH_MKLDNN | |||
// #ifdef PADDLE_WITH_MKLDNN |
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.
这些注释能否移除?
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!
|
||
namespace pten { | ||
|
||
using XPUDeviceContext = paddle::platform::XPUDeviceContext; |
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.
按照晓伟的设计,这里命名应该没有Device,为XPUContext
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!
DenseTensor* out, | ||
DenseTensor* xshape) { | ||
Flatten<T>(dev_ctx, x, start_axis, stop_axis, out); | ||
const auto& in_dims = x.meta().dims; |
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.
推荐使用x.dims()获取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.
done!
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
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
PR types
Others
PR changes
OPs
Describe
Support XPU for Flatten Kernel and Optimize Pten Flatten to be compatible with old Kernel