[PTen]Support XPU for Flatten Kernel#36957
Merged
chenwhql merged 163 commits intoPaddlePaddle:developfrom Nov 5, 2021
Merged
Conversation
…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 <[email protected]>
…into op2func_refactor
|
Thanks for your contribution! |
chenwhql
reviewed
Nov 3, 2021
paddle/fluid/operators/flatten_op.cc
Outdated
| framework::OperatorWithKernel::IndicateVarDataType(ctx, "X"); | ||
|
|
||
| //#ifdef PADDLE_WITH_MKLDNN | ||
| // #ifdef PADDLE_WITH_MKLDNN |
|
|
||
| namespace pten { | ||
|
|
||
| using XPUDeviceContext = paddle::platform::XPUDeviceContext; |
Contributor
There was a problem hiding this comment.
按照晓伟的设计,这里命名应该没有Device,为XPUContext
zyfncg
reviewed
Nov 3, 2021
| DenseTensor* out, | ||
| DenseTensor* xshape) { | ||
| Flatten<T>(dev_ctx, x, start_axis, stop_axis, out); | ||
| const auto& in_dims = x.meta().dims; |
zyfncg
approved these changes
Nov 5, 2021
Shixiaowei02
approved these changes
Nov 5, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR types
Others
PR changes
OPs
Describe
Support XPU for Flatten Kernel and Optimize Pten Flatten to be compatible with old Kernel