diff --git a/paddle/fluid/operators/detail/checkpoint.cc b/paddle/fluid/operators/detail/checkpoint.cc index 78506a0a72e422f5c6e41bba84a71f8b5e37a6c3..38e46532e6e18b733fa06a91cfb57aa21978f4af 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 0f0f450ce17bb5ba64c64823abe614599e3867ee..dfa41979734ec36376a50b94d32472c2751e58a2 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(); }