未验证 提交 516317cf 编写于 作者: C chengduo 提交者: GitHub

use sync copy (#17291)

test=develop
上级 2c446271
...@@ -63,8 +63,7 @@ void FetchOpHandle::RunImpl() { ...@@ -63,8 +63,7 @@ void FetchOpHandle::RunImpl() {
auto &t = var->Get<framework::LoDTensor>(); auto &t = var->Get<framework::LoDTensor>();
if (platform::is_gpu_place(t.place())) { if (platform::is_gpu_place(t.place())) {
#ifdef PADDLE_WITH_CUDA #ifdef PADDLE_WITH_CUDA
TensorCopy(t, cpu, *dev_ctxes_.at(t.place()), &tensors_[i]); TensorCopy(t, cpu, &tensors_[i]);
dev_ctxes_.at(t.place())->Wait();
#endif #endif
} else { } else {
tensors_[i].ShareDataWith(t); tensors_[i].ShareDataWith(t);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册