access2rohit commented on a change in pull request #14365: Fix memory leak for 
size-zero ndarray
URL: https://github.com/apache/incubator-mxnet/pull/14365#discussion_r264813281
 
 

 ##########
 File path: src/ndarray/ndarray.cc
 ##########
 @@ -134,9 +134,8 @@ void NDArray::Chunk::CheckAndAllocData(const mxnet::TShape 
&shape, int dtype) {
       << "data is expected to be allocated after aux_data";
   auto dbytes = shape.Size() * mshadow::mshadow_sizeof(dtype);
   if (shandle.size < dbytes) {
-    // free storage if necessary and alloc again
-    if (shandle.size > 0) Storage::Get()->Free(shandle);
-    // init storage
 
 Review comment:
   nit: same as above

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to