Unverified Commit 1947d87d authored by Xin Yao's avatar Xin Yao Committed by GitHub
Browse files

fix unpinning when tensoradaptor is not available (#4450)

parent 7a41c126
......@@ -67,6 +67,7 @@ struct NDArray::Internal {
ptr->mem = nullptr;
} else if (ptr->dl_tensor.data != nullptr) {
// if the array is still pinned before freeing, unpin it.
if (ptr->pinned_by_dgl_)
UnpinContainer(ptr);
dgl::runtime::DeviceAPI::Get(ptr->dl_tensor.ctx)->FreeDataSpace(
ptr->dl_tensor.ctx, ptr->dl_tensor.data);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment