Hi,
I current use PackedFunc directly to get the model infered result like “xx=vm->GetFunction(“yy”); out = xx()”. Things goes well, except the output would continuously alloc new memory, which at last cause oom.
I think the logic here is that I shall relaim the memory inside out explictly by myself, but I haven’t find any useful API to server this purpose. So anyone knows how to reclaim the output memory properly?
[UPDATE] The full code is as:
ObjectRef ret = func(xx)
NDArray out = Downcast<NDArray>(ret);
DLManagedTensor *tensor = out.ToDLPack();
Without ToDLPack conversion, it seems to me that it works fine. But with ToDLPack, it would increase storage obj ref cnt, so that it could not be reclaimed. So for this case, how to properly dec the storage obj again?..
Thx~