!15318 Fix CodeDex warnings

From: @zyli2020
Reviewed-by: @cristoval,@limingqi107
Signed-off-by: @limingqi107
This commit is contained in:
mindspore-ci-bot 2021-04-17 17:58:58 +08:00 committed by Gitee
commit 3e7b23547e
1 changed files with 3 additions and 2 deletions

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;