diff options
author | Soumith Chintala <soumith@gmail.com> | 2014-09-11 01:54:08 +0400 |
---|---|---|
committer | Soumith Chintala <soumith@gmail.com> | 2014-09-21 03:51:04 +0400 |
commit | ecd1ca60adb49dab5eaa317dbb17bf80c540c8ef (patch) | |
tree | 0f08e1be714e7418096f5b2b78d4c41929361128 /SpatialMaxPooling.lua | |
parent | 4b3f518fcbc21055f60bb7e18fa5b278d9cc8c79 (diff) |
fixes #1
Diffstat (limited to 'SpatialMaxPooling.lua')
-rw-r--r-- | SpatialMaxPooling.lua | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/SpatialMaxPooling.lua b/SpatialMaxPooling.lua index 43891f8..e3f9fe4 100644 --- a/SpatialMaxPooling.lua +++ b/SpatialMaxPooling.lua @@ -17,15 +17,16 @@ function SpatialMaxPooling:__init(kW, kH, dW, dH) errcheck('cudnnSetPoolingDescriptor', self.poolDesc[0], 'CUDNN_POOLING_MAX', self.kH, self.kW, self.dH, self.dW); local function destroyPoolDesc(d) - errcheck('cudnnDestroyPoolingDescriptor', self.poolDesc[0]); + errcheck('cudnnDestroyPoolingDescriptor', d[0]); end ffi.gc(self.poolDesc, destroyPoolDesc) end function SpatialMaxPooling:createIODescriptors(input) - if input:size(1) ~= self.iSize:size(1) or input:size(2) ~= self.iSize:size(2) - or input:size(3) ~= self.iSize:size(3) or input:size(4) ~= self.iSize:size(4) then + if input:size(1) ~= self.iSize[1] or input:size(2) ~= self.iSize[2] + or input:size(3) ~= self.iSize[3] or input:size(4) ~= self.iSize[4] then + self.iSize = input:size() -- resize gradInput self.gradInput:resizeAs(input) -- resize output |