Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/cunn.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Paszke <adam.paszke@gmail.com>2017-01-31 00:13:59 +0300
committerAdam Paszke <adam.paszke@gmail.com>2017-01-31 01:23:07 +0300
commita3440e4882158f95722284a0aefc57e4b9fbb4b6 (patch)
tree6bfdecf012829b34a32fb4d68db035bd8cb19cab
parentfbef6e7732bfb4b449833971e3964f71c3d5a369 (diff)
Fix memory leak in SpatialMaxUnpooling
-rw-r--r--lib/THCUNN/generic/SpatialMaxUnpooling.cu3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/THCUNN/generic/SpatialMaxUnpooling.cu b/lib/THCUNN/generic/SpatialMaxUnpooling.cu
index 579b8b2..ff4b6ac 100644
--- a/lib/THCUNN/generic/SpatialMaxUnpooling.cu
+++ b/lib/THCUNN/generic/SpatialMaxUnpooling.cu
@@ -46,7 +46,7 @@ void THNN_(SpatialMaxUnpooling_updateOutput)(
THCTensor_(resize3d)(state, output, nInputPlane, oheight, owidth);
THCTensor_(free)(state, input);
-
+ THCIndexTensor_(free)(state, indices);
}
void THNN_(SpatialMaxUnpooling_updateGradInput)(
@@ -97,6 +97,7 @@ void THNN_(SpatialMaxUnpooling_updateGradInput)(
// clean
THCTensor_(free)(state, input);
+ THCIndexTensor_(free)(state, indices);
THCTensor_(free)(state, gradOutput);
}