forked from mindspore-Ecosystem/mindspore
fix bug of CPU workspace address must not be nullptr
This commit is contained in:
parent
04956a776c
commit
863e25913e
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue