forked from mindspore-Ecosystem/mindspore
!6533 Fix code warning
Merge pull request !6533 from ZPaC/master-fix-code-warning
This commit is contained in:
commit
97c3127944
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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…
Reference in New Issue