From 8f4476b893b498684fa236ce2727f56319dc8ae9 Mon Sep 17 00:00:00 2001 From: Yu Yang Date: Thu, 26 Oct 2017 19:11:32 -0700 Subject: [PATCH] Add device.Wait() in fetch_op (#5141) --- paddle/operators/fetch_op.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/paddle/operators/fetch_op.cc b/paddle/operators/fetch_op.cc index c35d7d49e31..f1086e3dc77 100644 --- a/paddle/operators/fetch_op.cc +++ b/paddle/operators/fetch_op.cc @@ -52,6 +52,7 @@ class FetchOp : public framework::OperatorBase { // FIXME(yuyang18): Should we assume the fetch operator always generate // CPU outputs? dst_item.CopyFrom(src_item, platform::CPUPlace(), dev_ctx); + dev_ctx.Wait(); dst_item.set_lod(src_item.lod()); VLOG(3) << "Fetch variable " << fetch_var_name << " to " << out_name; -- GitLab