!19767 fix bug of CPU kernel address must not be nullptr

Merge pull request !19767 from limingqi107/r1.3
This commit is contained in:
i-robot 2021-07-09 09:44:52 +00:00 committed by Gitee
commit f0d33532bb
1 changed files with 2 additions and 2 deletions

View File

@ -30,7 +30,7 @@ void MemoryManagerActor::AllocateMemory(std::vector<DeviceTensor *> *alloc_list,
for (auto &device_tensor : *alloc_list) {
MS_EXCEPTION_IF_NULL(device_tensor);
if ((device_tensor->GetPtr() != nullptr) || (device_tensor->GetSize() == 0)) {
if (device_tensor->GetPtr() != nullptr) {
continue;
}
// Allocate memory through the device context.
@ -97,7 +97,7 @@ void MemoryManagerActor::AllocateBatchMemory(std::vector<DeviceTensor *> *alloc_
auto &device_context = (*device_contexts)[i];
MS_EXCEPTION_IF_NULL(device_tensor);
MS_EXCEPTION_IF_NULL(device_context);
if ((device_tensor->GetPtr() != nullptr) || (device_tensor->GetSize() == 0)) {
if (device_tensor->GetPtr() != nullptr) {
continue;
}