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

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

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