From 339be6254ea5e3432e4cbe44f35609bb45662e12 Mon Sep 17 00:00:00 2001 From: Liu Yiqun Date: Thu, 12 Apr 2018 05:58:26 +0000 Subject: [PATCH] Refine the order of arguments. --- paddle/fluid/framework/executor.cc | 5 ++--- paddle/fluid/framework/executor.h | 4 ++-- paddle/fluid/inference/tests/test_helper.h | 6 +++--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/paddle/fluid/framework/executor.cc b/paddle/fluid/framework/executor.cc index 910012927ba..34bba77f402 100644 --- a/paddle/fluid/framework/executor.cc +++ b/paddle/fluid/framework/executor.cc @@ -359,9 +359,8 @@ void Executor::RunPreparedContext(ExecutorPrepareContext* ctx, Scope* scope, void Executor::RunPreparedContext( ExecutorPrepareContext* ctx, Scope* scope, std::map& feed_targets, - std::map& fetch_targets, - const std::string& feed_holder_name, const std::string& fetch_holder_name, - bool create_vars) { + std::map& fetch_targets, bool create_vars, + const std::string& feed_holder_name, const std::string& fetch_holder_name) { auto& global_block = ctx->prog_.Block(ctx->block_id_); PADDLE_ENFORCE( diff --git a/paddle/fluid/framework/executor.h b/paddle/fluid/framework/executor.h index cbd70d9544c..8b3ea015425 100644 --- a/paddle/fluid/framework/executor.h +++ b/paddle/fluid/framework/executor.h @@ -73,9 +73,9 @@ class Executor { void RunPreparedContext(ExecutorPrepareContext* ctx, Scope* scope, std::map& feed_targets, std::map& fetch_targets, + bool create_vars = true, const std::string& feed_holder_name = "feed", - const std::string& fetch_holder_name = "fetch", - bool create_vars = true); + const std::string& fetch_holder_name = "fetch"); private: const platform::Place place_; diff --git a/paddle/fluid/inference/tests/test_helper.h b/paddle/fluid/inference/tests/test_helper.h index 09fe344ec7e..9875e438606 100644 --- a/paddle/fluid/inference/tests/test_helper.h +++ b/paddle/fluid/inference/tests/test_helper.h @@ -178,8 +178,8 @@ void TestInference(const std::string& dirname, std::unique_ptr ctx; if (PrepareContext) { ctx = executor.Prepare(*inference_program, 0); - executor.RunPreparedContext(ctx.get(), scope, feed_targets, - fetch_targets); + executor.RunPreparedContext(ctx.get(), scope, feed_targets, fetch_targets, + CreateVars); } else { executor.Run(*inference_program, scope, feed_targets, fetch_targets, CreateVars); @@ -198,7 +198,7 @@ void TestInference(const std::string& dirname, // Note: if you changed the inference_program, you need to call // executor.Prepare() again to get a new ExecutorPrepareContext. executor.RunPreparedContext(ctx.get(), scope, feed_targets, - fetch_targets); + fetch_targets, CreateVars); } else { executor.Run(*inference_program, scope, feed_targets, fetch_targets, CreateVars); -- GitLab