diff --git a/paddle/fluid/eager/backward.cc b/paddle/fluid/eager/backward.cc index f2d5f338bd4af6ce1f9858d35485a0b23dc5f61c..75ddfb92275524eece120e6f2aae4f41a3e67701 100644 --- a/paddle/fluid/eager/backward.cc +++ b/paddle/fluid/eager/backward.cc @@ -370,7 +370,7 @@ std::vector RunBackward( if (grad_tensors[i].is_initialized()) { // Deep copy paddle::experimental::Tensor tmp_tensor; - tmp_tensor.copy_(grad_tensors[i], true); + tmp_tensor.copy_(grad_tensors[i], grad_tensors[i].inner_place(), true); node_input_buffers_dict[grad_node]->add(input_info.first, input_info.second, tmp_tensor); } else {