From 1fabbbade28d4a642700c0df9ac6c4a0be0d4a66 Mon Sep 17 00:00:00 2001 From: tangwei12 Date: Thu, 10 May 2018 12:33:33 +0800 Subject: [PATCH] modify const to const & --- paddle/fluid/operators/detail/checkpoint.cc | 2 +- paddle/fluid/operators/detail/checkpoint.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/operators/detail/checkpoint.cc b/paddle/fluid/operators/detail/checkpoint.cc index 78506a0a72e..38e46532e6e 100644 --- a/paddle/fluid/operators/detail/checkpoint.cc +++ b/paddle/fluid/operators/detail/checkpoint.cc @@ -22,7 +22,7 @@ namespace framework { namespace details { Checkpoint::Save(const framework::Scope& scope, const platform::Place& place, const std::string& save_dir, const std::string& var_name, - const bool overwrite) { + const bool& overwrite) { auto* var = scope.FindVar(var_name); PADDLE_ENFORCE(var != nullptr, "Cannot find variable %s for save_op", var_name); diff --git a/paddle/fluid/operators/detail/checkpoint.h b/paddle/fluid/operators/detail/checkpoint.h index 0f0f450ce17..dfa41979734 100644 --- a/paddle/fluid/operators/detail/checkpoint.h +++ b/paddle/fluid/operators/detail/checkpoint.h @@ -24,7 +24,7 @@ class Checkpoint { public: static void Save(const framework::Scope& scope, const platform::Place& place, const std::string& save_dir, const std::string& var_name, - const bool overwrite); + const bool& overwrite); static void Load(); } -- GitLab