Skip to content

Commit fd89481

Browse files
committed
"fix unique_ptr copy"
1 parent d9ad8cb commit fd89481

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

paddle/operators/merge_lod_tensor_op.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class MergeLoDTensorOp : public framework::OperatorBase {
4545
cpu_mask->ShareDataWith(mask);
4646
} else if (platform::is_gpu_place(mask.place())) {
4747
#ifdef PADDLE_WITH_CUDA
48-
framework::CopyFrom(mask, platform::CPUPlace(), dev_ctx, &cpu_mask);
48+
framework::CopyFrom(mask, platform::CPUPlace(), dev_ctx, cpu_mask.get());
4949
#else
5050
PADDLE_THROW("Not supported GPU, Please compile WITH_GPU option");
5151
#endif

paddle/operators/multiplex_op.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class MultiplexGPUKernel : public framework::OpKernel<T> {
3333
auto cols = ins[0]->numel() / rows;
3434
// copy index to cpu
3535
Tensor index_t_cpu;
36-
index_t_cpu.CopyFrom(*ids, platform::CPUPlace(), ctx.device_context());
36+
CopyFrom(*ids, platform::CPUPlace(), ctx.device_context(), &index_t_cpu);
3737
auto* index = index_t_cpu.data<int32_t>();
3838
auto stream = ctx.cuda_device_context().stream();
3939
Place place = boost::get<Place>(ctx.GetPlace());
@@ -68,7 +68,7 @@ class MultiplexGradGPUKernel : public framework::OpKernel<T> {
6868
auto cols = ins[0]->numel() / rows;
6969
// copy index to cpu
7070
Tensor index_t_cpu;
71-
index_t_cpu.CopyFrom(*ids, platform::CPUPlace(), ctx.device_context());
71+
CopyFrom(*ids, platform::CPUPlace(), ctx.device_context(), &index_t_cpu);
7272
auto* index = index_t_cpu.data<int32_t>();
7373

7474
auto stream = ctx.cuda_device_context().stream();

paddle/operators/split_lod_tensor_op.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class SplitLoDTensorOp : public framework::OperatorBase {
4949
cpu_mask->ShareDataWith(mask);
5050
} else if (platform::is_gpu_place(mask.place())) {
5151
#ifdef PADDLE_WITH_CUDA
52-
framework::CopyFrom(mask, platform::CPUPlace(), dev_ctx, &cpu_mask);
52+
framework::CopyFrom(mask, platform::CPUPlace(), dev_ctx, cpu_mask.get());
5353
#else
5454
PADDLE_THROW("Not supported GPU, Please compile WITH_GPU option");
5555
#endif

0 commit comments

Comments
 (0)