[NPU] add NPU ops of stack and unstack, test=develop #34084
Merged
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
New features
PR changes
OPs
Describe
(1) 新增了unstack, unstack_grad 和 stack_grad 三个 NPU OP Kernel,以及 test_unstack_op_npu.py 的单测
(2) 改动了 stack 的 NPU OP Kernel, 在 axis != 0 的情况下可以直接调用Pack, 不需要先Pack再Transpose,(原PR #31711)
(3) 增加了test_stack_op_npu.py里面的单测内容,保持单测与 test_stack_op.py一致,且单测通过
(4) PR 里面没有提,但是手动测试增加stack和unstack的C++单测,位于
- https://github.com/qili93/Paddle/blob/test_npu_stack/paddle/fluid/operators/stack_op_npu_test.cc
- https://github.com/qili93/Paddle/blob/test_npu_stack/paddle/fluid/operators/unstack_op_npu_test.cc