Skip to content

Commit 170ac72

Browse files
committed
remove unnecessary tensor copy in save op
1 parent 8b1918f commit 170ac72

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

paddle/fluid/operators/load_op.cc

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,6 @@ class LoadOp : public framework::OperatorBase {
4646
auto *tensor = out_var->GetMutable<framework::LoDTensor>();
4747

4848
DeserializeFromStream(fin, tensor, *dev_ctx);
49-
50-
if (platform::is_gpu_place(place)) {
51-
// copy CPU to GPU
52-
framework::LoDTensor cpu_tensor;
53-
cpu_tensor.ShareDataWith(*tensor);
54-
cpu_tensor.set_lod(tensor->lod());
55-
56-
// reset tensor
57-
out_var->Clear();
58-
tensor = out_var->GetMutable<framework::LoDTensor>();
59-
tensor->set_lod(cpu_tensor.lod());
60-
TensorCopy(cpu_tensor, place, *dev_ctx, tensor);
61-
}
6249
}
6350
};
6451

0 commit comments

Comments
 (0)