Browse Source

fix CodeDex warnings

pull/15326/head
lizhenyu 5 years ago
parent
commit
d3cd98984d
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      mindspore/ccsrc/ps/ps_cache/ps_cache_manager.cc

+ 3
- 2
mindspore/ccsrc/ps/ps_cache/ps_cache_manager.cc View File

@@ -222,8 +222,9 @@ void PsCacheManager::AllocMemForHashTable() {
device_address.addr = addr;

auto &host_address = item.second.host_address;
host_address =
std::shared_ptr<float[]>(new float[host_vocab_cache_size_ * embedding_size], std::default_delete<float[]>());
std::unique_ptr<float[]> host_hash_table_addr = std::make_unique<float[]>(host_vocab_cache_size_ * embedding_size);
MS_EXCEPTION_IF_NULL(host_hash_table_addr);
host_address = std::move(host_hash_table_addr);
MS_EXCEPTION_IF_NULL(host_address);

max_embedding_size = (embedding_size > max_embedding_size) ? embedding_size : max_embedding_size;


Loading…
Cancel
Save