未验证 提交 b7d44eb9 编写于 作者: W wangxiaoning 提交者: GitHub

[fix code style]fix cpplint code style (#49811)

上级 0355bb90
...@@ -67,7 +67,7 @@ class PSClient { ...@@ -67,7 +67,7 @@ class PSClient {
PSClient(PSClient &&) = delete; PSClient(PSClient &&) = delete;
PSClient(const PSClient &) = delete; PSClient(const PSClient &) = delete;
virtual int32_t Configure( virtual int32_t Configure( // NOLINT
const PSParameter &config, const PSParameter &config,
const std::map<uint64_t, std::vector<paddle::distributed::Region>> const std::map<uint64_t, std::vector<paddle::distributed::Region>>
&regions, &regions,
......
...@@ -31,7 +31,7 @@ class PsLocalServer : public PSServer { ...@@ -31,7 +31,7 @@ class PsLocalServer : public PSServer {
virtual int32_t Stop() { return 0; } virtual int32_t Stop() { return 0; }
virtual int32_t Configure( virtual int32_t Configure(
const PSParameter &config, const PSParameter &config,
PSEnvironment &env, PSEnvironment &env, // NOLINT
size_t server_rank, size_t server_rank,
const std::vector<framework::ProgramDesc> &server_sub_program = {}) { const std::vector<framework::ProgramDesc> &server_sub_program = {}) {
return 0; return 0;
......
...@@ -39,7 +39,7 @@ using paddle::distributed::PsService; ...@@ -39,7 +39,7 @@ using paddle::distributed::PsService;
class PSCore { class PSCore {
public: public:
explicit PSCore() {} PSCore() {}
virtual ~PSCore() {} virtual ~PSCore() {}
virtual int InitServer( virtual int InitServer(
......
...@@ -60,7 +60,7 @@ struct PullSparseValue { ...@@ -60,7 +60,7 @@ struct PullSparseValue {
std::vector<int>* offset_shard) const { std::vector<int>* offset_shard) const {
offset_shard->reserve(numel_ / shard_num + 1); offset_shard->reserve(numel_ / shard_num + 1);
for (int x = 0; x < numel_; ++x) { for (int x = 0; x < numel_; ++x) {
if (int(feasigns_[x] % shard_num) == shard_id) { if (static_cast<int>(feasigns_[x] % shard_num) == shard_id) {
offset_shard->push_back(x); offset_shard->push_back(x);
} }
} }
......
...@@ -55,10 +55,12 @@ class WeightedSampler : public Sampler { ...@@ -55,10 +55,12 @@ class WeightedSampler : public Sampler {
const std::shared_ptr<std::mt19937_64> rng); const std::shared_ptr<std::mt19937_64> rng);
private: private:
int sample(float query_weight, int sample(
std::unordered_map<WeightedSampler *, float> &subtract_weight_map, float query_weight,
std::unordered_map<WeightedSampler *, int> &subtract_count_map, std::unordered_map<WeightedSampler *, float>
float &subtract); &subtract_weight_map, // NOLINT
std::unordered_map<WeightedSampler *, int> &subtract_count_map, // NOLINT
float &subtract); // NOLINT
}; };
} // namespace distributed } // namespace distributed
} // namespace paddle } // namespace paddle
...@@ -157,7 +157,8 @@ void GetDownpourSparseTableProto( ...@@ -157,7 +157,8 @@ void GetDownpourSparseTableProto(
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
std::string ip_ = "127.0.0.1", ip2 = "127.0.0.1"; const char* ip_ = "127.0.0.1";
const char* ip2 = "127.0.0.1";
uint32_t port_ = 5209, port2 = 5210; uint32_t port_ = 5209, port2 = 5210;
std::vector<std::string> host_sign_list_; std::vector<std::string> host_sign_list_;
...@@ -203,10 +204,10 @@ void RunServer2() { ...@@ -203,10 +204,10 @@ void RunServer2() {
pserver_ptr2->build_peer2peer_connection(1); pserver_ptr2->build_peer2peer_connection(1);
} }
void RunClient( void RunClient(std::map<uint64_t, std::vector<paddle::distributed::Region>>&
std::map<uint64_t, std::vector<paddle::distributed::Region>>& dense_regions, dense_regions, // NOLINT
int index, int index,
paddle::distributed::PsBaseService* service) { paddle::distributed::PsBaseService* service) {
::paddle::distributed::PSParameter worker_proto = GetWorkerProto(); ::paddle::distributed::PSParameter worker_proto = GetWorkerProto();
paddle::distributed::PaddlePSEnvironment _ps_env; paddle::distributed::PaddlePSEnvironment _ps_env;
auto servers_ = host_sign_list_.size(); auto servers_ = host_sign_list_.size();
......
...@@ -15,7 +15,7 @@ limitations under the License. */ ...@@ -15,7 +15,7 @@ limitations under the License. */
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "paddle/fluid/distributed/ps/table/memory_dense_table.h" #include "paddle/fluid/distributed/ps/table/memory_dense_table.h"
#include "paddle/fluid/distributed/the_one_ps.pb.h" #include "paddle/fluid/distributed/the_one_ps.pb.h"
//#include "paddle/fluid/distributed/ps/table/sparse_geo_table.h" // #include "paddle/fluid/distributed/ps/table/sparse_geo_table.h"
namespace paddle { namespace paddle {
namespace distributed { namespace distributed {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册