Skip to content

Commit

Permalink
fix multioutputs bug
Browse files Browse the repository at this point in the history
  • Loading branch information
MingMingShangTian committed Nov 1, 2021
1 parent cf5cc45 commit 059cb03
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion paddle/pten/core/kernel_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class KernelContext {

template <typename TensorType>
std::vector<TensorType*> MutableOutputAt(size_t start, size_t end) {
std::vector<TensorType> v;
std::vector<TensorType*> v;
for (size_t i = start; i < end; ++i) {
v.emplace_back(static_cast<TensorType*>(outputs_.at(i).get()));
}
Expand Down
4 changes: 2 additions & 2 deletions paddle/pten/core/kernel_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,15 @@ using XPUContext = paddle::platform::XPUDeviceContext;

#define PT_SPECIALIZE_KernelCallHelper_FOR_MULTI_OUTPUT(tensor_type) \
template <typename... Tail> \
struct KernelCallHelper<const std::vector<tensor_type*>&, Tail...> { \
struct KernelCallHelper<std::vector<tensor_type*>, Tail...> { \
template <int dev_ctx_idx, \
int in_idx, \
int attr_idx, \
int out_idx, \
typename... PreviousArgs> \
static void Compute(KernelContext* ctx, PreviousArgs&... pargs) { \
const std::pair<int, int> range = ctx->OutputRangeAt(out_idx); \
const std::vector<tensor_type*> arg = std::move( \
std::vector<tensor_type*> arg = std::move( \
ctx->MutableOutputAt<tensor_type>(range.first, range.second)); \
KernelCallHelper<Tail...>:: \
template Compute<dev_ctx_idx, in_idx, attr_idx, out_idx + 1>( \
Expand Down

1 comment on commit 059cb03

@paddle-bot-old
Copy link

@paddle-bot-old paddle-bot-old bot commented on 059cb03 Nov 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕵️ CI failures summary

🔍 PR: #36851 Commit ID: 059cb03 contains failed CI.

🔹 Failed: PR-CI-iScan-Python

Unknown Failed
Unknown Failed

🔹 Failed: PR-CI-iScan-C

Unknown Failed
Unknown Failed

🔹 Failed: PR-CI-Model-benchmark

failed in build-docker-image job
failed in build-docker-image job

🔹 Failed: PR-CI-musl

Unknown Failed
2021-11-01 17:04:11 + pwd
2021-11-01 17:04:11 /home/musl/Paddle
2021-11-01 17:04:11 + git fetch origin pull/36851/head
2021-11-01 17:04:41 From https://github.com/PaddlePaddle/Paddle
2021-11-01 17:04:41 * branch refs/pull/36851/head -> FETCH_HEAD
2021-11-01 17:04:41 + git checkout -b test FETCH_HEAD
2021-11-01 17:04:41 Switched to a new branch 'test'
2021-11-01 17:04:41 + git config --global user.name PaddleCI
2021-11-01 17:04:41 + git config --global user.email paddle_ci@example.com
2021-11-01 17:04:41 + git merge --no-edit develop
2021-11-01 17:04:42 Auto-merging python/paddle/incubate/nn/layer/fused_transformer.py
2021-11-01 17:04:42 Auto-merging python/paddle/incubate/nn/functional/fused_transformer.py
2021-11-01 17:04:42 Auto-merging python/paddle/distributed/auto_parallel/process_group.py
2021-11-01 17:04:42 Removing python/paddle/distributed/auto_parallel/context.py
2021-11-01 17:04:42 Removing python/paddle/distributed/auto_parallel/attribute.py
2021-11-01 17:04:42 Auto-merging paddle/fluid/operators/CMakeLists.txt
2021-11-01 17:04:42 CONFLICT (content): Merge conflict in paddle/fluid/operators/CMakeLists.txt
2021-11-01 17:04:42 Auto-merging paddle/fluid/framework/CMakeLists.txt
2021-11-01 17:04:42 Automatic merge failed; fix conflicts and then commit the result.

🔹 Failed: PR-CI-Windows

Unknown Failed
2021-11-01 17:01:30 Updating files: 100% (6359/6359), done.
2021-11-01 17:01:30 C:\Users\Administrator\Downloads\workspace\c81a6cc2-738f-40e2-a845-ce7afae55bd8\Paddle>if exist Paddle.git\index.lock del Paddle.git\index.lock
2021-11-01 17:01:30 C:\Users\Administrator\Downloads\workspace\c81a6cc2-738f-40e2-a845-ce7afae55bd8\Paddle>git config --global user.name "PaddleCI"
2021-11-01 17:01:30 C:\Users\Administrator\Downloads\workspace\c81a6cc2-738f-40e2-a845-ce7afae55bd8\Paddle>git config --global user.email "paddle_ci@example.com"
2021-11-01 17:01:30 C:\Users\Administrator\Downloads\workspace\c81a6cc2-738f-40e2-a845-ce7afae55bd8\Paddle>git fetch origin pull/36851/head
2021-11-01 17:07:57 From https://github.com/PaddlePaddle/Paddle
2021-11-01 17:07:57 * branch refs/pull/36851/head -> FETCH_HEAD
2021-11-01 17:07:57 C:\Users\Administrator\Downloads\workspace\c81a6cc2-738f-40e2-a845-ce7afae55bd8\Paddle>if 0 NEQ 0 exit /b 1
2021-11-01 17:07:57 C:\Users\Administrator\Downloads\workspace\c81a6cc2-738f-40e2-a845-ce7afae55bd8\Paddle>git checkout -b test_pr FETCH_HEAD
2021-11-01 17:07:57 Switched to a new branch 'test_pr'
2021-11-01 17:07:57 C:\Users\Administrator\Downloads\workspace\c81a6cc2-738f-40e2-a845-ce7afae55bd8\Paddle>if 0 NEQ 0 exit /b 1
2021-11-01 17:07:57 C:\Users\Administrator\Downloads\workspace\c81a6cc2-738f-40e2-a845-ce7afae55bd8\Paddle>git merge --no-edit develop
2021-11-01 17:07:58 Removing python/paddle/distributed/auto_parallel/context.py
2021-11-01 17:07:58 Removing python/paddle/distributed/auto_parallel/attribute.py
2021-11-01 17:07:58 Auto-merging paddle/fluid/operators/CMakeLists.txt
2021-11-01 17:07:58 CONFLICT (content): Merge conflict in paddle/fluid/operators/CMakeLists.txt
2021-11-01 17:07:58 Auto-merging paddle/fluid/framework/CMakeLists.txt
2021-11-01 17:07:58 Automatic merge failed; fix conflicts and then commit the result.
2021-11-01 17:07:58 C:\Users\Administrator\Downloads\workspace\c81a6cc2-738f-40e2-a845-ce7afae55bd8\Paddle>if 1 NEQ 0 exit /b 1

Please sign in to comment.