Skip to content

Commit 36b9112

Browse files
Update src/runtime/memory/memory_manager.cc
Co-authored-by: Egor Churaev <egor.churaev@gmail.com>
1 parent 8058b75 commit 36b9112

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/runtime/memory/memory_manager.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ NDArray Allocator::Empty(ShapeTuple shape, DLDataType dtype, DLDevice dev,
168168
size_t size = DeviceAPI::Get(dev)->GetDataSize(container->dl_tensor);
169169
size_t alignment = GetDataAlignment(container->dl_tensor);
170170
Buffer* buffer = new Buffer;
171-
if (!mem_scope.defined() || mem_scope == "global") {
171+
if (!mem_scope.defined() || mem_scope.empty() || mem_scope == "global") {
172172
*buffer = this->Alloc(size, alignment, dtype);
173173
} else {
174174
*buffer = this->Alloc(shape, dtype, mem_scope.value());

0 commit comments

Comments
 (0)