tvm
tvm copied to clipboard
[CRT] Fix graph executor params loading
Currently, graph executor loads params directly into data entries while those should be only 'views' of data from storage created with TVMNDArray_CreateView.
When graph executor is being released, the data stored in entries is not freed. The only released thing is entry's shape, since the params data in entries should be maintained by graph executor's storage pool.
Due to that, data in entries created without TVMNDArray_CreateView is not released and causes memory leaks.
To fix this issue the graph executor params loading function is changed to load params into storage.
There is also minor issue with is_linked_param addressed in this commit. This value is uninitialized and because of that, in some cases the storage data is not freed during graph executor release.