diff --git a/mindspore/ccsrc/ps/ps_cache/ps_cache_manager.cc b/mindspore/ccsrc/ps/ps_cache/ps_cache_manager.cc index 6984ab7b3c..0edce62208 100644 --- a/mindspore/ccsrc/ps/ps_cache/ps_cache_manager.cc +++ b/mindspore/ccsrc/ps/ps_cache/ps_cache_manager.cc @@ -222,8 +222,9 @@ void PsCacheManager::AllocMemForHashTable() { device_address.addr = addr; auto &host_address = item.second.host_address; - host_address = - std::shared_ptr(new float[host_vocab_cache_size_ * embedding_size], std::default_delete()); + std::unique_ptr host_hash_table_addr = std::make_unique(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;