diff options
author | Adam Paszke <adam.paszke@gmail.com> | 2017-01-31 00:13:59 +0300 |
---|---|---|
committer | Adam Paszke <adam.paszke@gmail.com> | 2017-01-31 01:23:07 +0300 |
commit | a3440e4882158f95722284a0aefc57e4b9fbb4b6 (patch) | |
tree | 6bfdecf012829b34a32fb4d68db035bd8cb19cab | |
parent | fbef6e7732bfb4b449833971e3964f71c3d5a369 (diff) |
Fix memory leak in SpatialMaxUnpooling
-rw-r--r-- | lib/THCUNN/generic/SpatialMaxUnpooling.cu | 3 |
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); } |