From 260ef770e66028d6625834b1b8c77c9df22e8cdf Mon Sep 17 00:00:00 2001 From: Leo Chen Date: Tue, 13 Apr 2021 17:31:14 +0800 Subject: [PATCH] fix conditional block (#32243) --- paddle/fluid/operators/controlflow/conditional_block_op.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/paddle/fluid/operators/controlflow/conditional_block_op.h b/paddle/fluid/operators/controlflow/conditional_block_op.h index 2f8717c6c67..67e6394d94e 100644 --- a/paddle/fluid/operators/controlflow/conditional_block_op.h +++ b/paddle/fluid/operators/controlflow/conditional_block_op.h @@ -79,8 +79,7 @@ class ConditionalOp : public framework::OperatorBase { platform::DeviceContextPool::Instance().Get(ips[0]->place())->Wait(); res = cpu_tensor.data()[0]; #endif - } - if (platform::is_npu_place(ips[0]->place())) { + } else if (platform::is_npu_place(ips[0]->place())) { #ifdef PADDLE_WITH_ASCEND_CL framework::LoDTensor cpu_tensor; framework::TensorCopy(*ips[0], platform::CPUPlace(), &cpu_tensor); -- GitLab