From 7fae9e0a7bb3663dc75f2f2dd9881fb8b675af9d Mon Sep 17 00:00:00 2001 From: tangwei12 Date: Fri, 22 Jun 2018 15:08:07 +0800 Subject: [PATCH] checkpoint feature optimized --- paddle/fluid/operators/detail/macros.h | 4 ---- paddle/fluid/operators/distributed/request_handler_impl.cc | 5 ++++- paddle/fluid/operators/save_op.cc | 5 ++++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/paddle/fluid/operators/detail/macros.h b/paddle/fluid/operators/detail/macros.h index 6e9f7beb93b..b9e385994ef 100644 --- a/paddle/fluid/operators/detail/macros.h +++ b/paddle/fluid/operators/detail/macros.h @@ -25,7 +25,3 @@ #define RPCSERVER_T distributed::AsyncBRPCServer #define RPCCLIENT_T distributed::BRPCClient #endif - -// define LOOKUP_TABLE_PATH for checkpoint notify to save lookup table variables -// to directory specified. -constexpr char LOOKUP_TABLE_PATH[] = "lookup_table_path"; diff --git a/paddle/fluid/operators/distributed/request_handler_impl.cc b/paddle/fluid/operators/distributed/request_handler_impl.cc index cd8059a96d3..b0d42be388f 100644 --- a/paddle/fluid/operators/distributed/request_handler_impl.cc +++ b/paddle/fluid/operators/distributed/request_handler_impl.cc @@ -20,7 +20,6 @@ #include "paddle/fluid/framework/lod_tensor.h" #include "paddle/fluid/framework/scope.h" #include "paddle/fluid/framework/selected_rows.h" -#include "paddle/fluid/operators/detail/macros.h" #include "paddle/fluid/operators/distributed/request_handler_impl.h" #include "paddle/fluid/operators/distributed/rpc_server.h" #include "paddle/fluid/string/printf.h" @@ -29,6 +28,10 @@ namespace paddle { namespace operators { namespace distributed { +// define LOOKUP_TABLE_PATH for checkpoint notify to save lookup table variables +// to directory specified. +constexpr char LOOKUP_TABLE_PATH[] = "lookup_table_path"; + bool RequestSendHandler::Handle(const std::string& varname, framework::Scope* scope, framework::Variable* invar, diff --git a/paddle/fluid/operators/save_op.cc b/paddle/fluid/operators/save_op.cc index bf8553ed557..493bb2ec890 100644 --- a/paddle/fluid/operators/save_op.cc +++ b/paddle/fluid/operators/save_op.cc @@ -24,12 +24,15 @@ limitations under the License. */ #include "paddle/fluid/framework/op_registry.h" #include "paddle/fluid/framework/selected_rows.h" #include "paddle/fluid/framework/variable.h" -#include "paddle/fluid/operators/detail/macros.h" #include "paddle/fluid/platform/device_context.h" namespace paddle { namespace operators { +// define LOOKUP_TABLE_PATH for checkpoint notify to save lookup table variables +// to directory specified. +constexpr char LOOKUP_TABLE_PATH[] = "lookup_table_path"; + // TODO(yuyang18): If the functions below are needed by other files, move them // to paddle::filesystem namespace. constexpr char kSEP = '/'; -- GitLab