From 6dd64b0a3008d8a879728dfc9db95115490758d0 Mon Sep 17 00:00:00 2001 From: zhupengyang Date: Tue, 20 Oct 2020 16:14:02 +0800 Subject: [PATCH] randperm run error in multi-gpus (#27942) --- paddle/fluid/operators/randperm_op.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddle/fluid/operators/randperm_op.h b/paddle/fluid/operators/randperm_op.h index 02aabb9a7b5..3446c4785bd 100644 --- a/paddle/fluid/operators/randperm_op.h +++ b/paddle/fluid/operators/randperm_op.h @@ -57,7 +57,7 @@ class RandpermKernel : public framework::OpKernel { tmp_tensor.Resize(framework::make_ddim({n})); T* tmp_data = tmp_tensor.mutable_data(platform::CPUPlace()); random_permate(tmp_data, n, seed); - framework::TensorCopy(tmp_tensor, platform::CUDAPlace(), out_tensor); + framework::TensorCopy(tmp_tensor, ctx.GetPlace(), out_tensor); } } }; -- GitLab