From 09d669ba40aa900920dea84eb07aa868c44831b0 Mon Sep 17 00:00:00 2001 From: heqiaozhi Date: Fri, 14 Dec 2018 14:16:43 +0800 Subject: [PATCH] fix static_cast to const_cast --- paddle/fluid/framework/CMakeLists.txt | 2 +- paddle/fluid/framework/async_executor.cc | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/paddle/fluid/framework/CMakeLists.txt b/paddle/fluid/framework/CMakeLists.txt index ab237f768a..3575080c99 100644 --- a/paddle/fluid/framework/CMakeLists.txt +++ b/paddle/fluid/framework/CMakeLists.txt @@ -138,7 +138,7 @@ nv_test(op_registry_test SRCS op_registry_test.cc DEPS op_registry) py_proto_compile(framework_py_proto SRCS framework.proto data_feed.proto) #Generate an empty \ - __init__.py to make framework_py_proto as a valid python module. + #__init__.py to make framework_py_proto as a valid python module. add_custom_target(framework_py_proto_init ALL COMMAND ${CMAKE_COMMAND} -E touch __init__.py) add_dependencies(framework_py_proto framework_py_proto_init) if (NOT WIN32) diff --git a/paddle/fluid/framework/async_executor.cc b/paddle/fluid/framework/async_executor.cc index e2756cafa2..ee3c5e01f8 100644 --- a/paddle/fluid/framework/async_executor.cc +++ b/paddle/fluid/framework/async_executor.cc @@ -81,9 +81,8 @@ void AsyncExecutor::InitWorker(const std::string& dist_desc, int node_num, int index) { _pslib_ptr = std::shared_ptr( new paddle::distributed::PSlib()); - _pslib_ptr->init_worker(dist_desc, - static_cast(host_sign_list.data()), - node_num, index); + _pslib_ptr->init_worker( + dist_desc, const_cast(host_sign_list.data()), node_num, index); InitParamConfig(); } @@ -94,7 +93,7 @@ void AsyncExecutor::StopServer() { _pslib_ptr->stop_server(); } void AsyncExecutor::GatherServers(const std::vector& host_sign_list, int node_num) { - _pslib_ptr->gather_servers(static_cast(host_sign_list.data()), + _pslib_ptr->gather_servers(const_cast(host_sign_list.data()), node_num); } -- GitLab