Browse Source

!6533 Fix code warning

Merge pull request !6533 from ZPaC/master-fix-code-warning
tags/v1.0.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
97c3127944
2 changed files with 5 additions and 2 deletions
  1. +3
    -0
      mindspore/ccsrc/ps/util.cc
  2. +2
    -2
      mindspore/ccsrc/ps/worker_proxy.h

+ 3
- 0
mindspore/ccsrc/ps/util.cc View File

@@ -122,6 +122,9 @@ int Util::LocalShard(int first_dim, int rank_id, int server_num) {
}

std::map<int, int> Util::AllRankLocalShard(int first_dim, int rank_id, int server_num) {
if (first_dim <= 0 || server_num <= 0 || rank_id < 0) {
MS_LOG(EXCEPTION) << "Input values are invalid.";
}
if (rank_id >= server_num) {
MS_LOG(EXCEPTION) << "The rank ID " << rank_id << " should be less than the number of servers " << server_num;
}


+ 2
- 2
mindspore/ccsrc/ps/worker_proxy.h View File

@@ -548,8 +548,8 @@ void WorkerProxy<T>::PrepareSparseGradient(const size_t begin, const size_t end,
int offset = 0;
int index = 0;
size_t segment_data_size = segment_size * sizeof(T);
size_t dst_size = 0;
size_t src_size = 0;
size_t dst_size;
size_t src_size;
void *dst_data = nullptr;
void *src_data = nullptr;
for (auto &pair : indice_to_grads) {


Loading…
Cancel
Save