From 28482f81a8ad8d7f5e11b987337b5ba164eb856e Mon Sep 17 00:00:00 2001 From: tangwei12 Date: Tue, 19 Jun 2018 19:49:02 +0800 Subject: [PATCH] bug fix --- paddle/fluid/operators/listen_and_serv_op.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/paddle/fluid/operators/listen_and_serv_op.cc b/paddle/fluid/operators/listen_and_serv_op.cc index b0eec2eb443..463677c75e2 100644 --- a/paddle/fluid/operators/listen_and_serv_op.cc +++ b/paddle/fluid/operators/listen_and_serv_op.cc @@ -269,16 +269,16 @@ void ListenAndServOp::RunImpl(const framework::Scope &scope, rpc_service_->RegisterRPC(detail::kRequestCheckpoint, request_checkpoint_handler_.get()); + auto *optimize_block = Attr(kOptimizeBlock); + auto *program = optimize_block->Program(); + framework::Executor executor(dev_place); + std::shared_ptr ckpt_pre_context = nullptr; if (checkpoint_notify_id != -1) { auto ctx = executor.Prepare(*program, checkpoint_notify_id); ckpt_pre_context = std::move(ctx); } - auto *optimize_block = Attr(kOptimizeBlock); - auto *program = optimize_block->Program(); - framework::Executor executor(dev_place); - // prepare for prefetch std::vector prefetch_block_id_list; std::unordered_map block_id_to_prefetch_var_name; -- GitLab