You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2021/03/21 14:25:16 UTC

[GitHub] [tvm] tqchen commented on a change in pull request #7714: [METAL] Fix memory leaks in Metal runtime

tqchen commented on a change in pull request #7714:
URL: https://github.com/apache/tvm/pull/7714#discussion_r598287539



##########
File path: src/runtime/contrib/random/mt_random_engine.cc
##########
@@ -126,8 +126,10 @@ class RandomEngine {
     } else {
       runtime::NDArray local = runtime::NDArray::Empty(
           std::vector<int64_t>{data->shape, data->shape + data->ndim}, data->dtype, {kDLCPU, 0});
-      FillData(&local.ToDLPack()->dl_tensor, size);
-      runtime::NDArray::CopyFromTo(&local.ToDLPack()->dl_tensor, data);
+      DLManagedTensor* dmt = local.ToDLPack();

Review comment:
       DLManagedTensor is not needed, we can directly use local.operator->() to get the DLTensor pointer




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org