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

github.com/soumith/cudnn.torch.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsoumith <soumith@gmail.com>2016-01-26 18:17:14 +0300
committersoumith <soumith@gmail.com>2016-01-26 18:17:14 +0300
commit0f2d96a6bb565a3e0cfd890d15d828808ebad39b (patch)
tree745e6c0da7bc2ea4647a977d755cebbc38bc18ac /SpatialConvolution.lua
parentae0c2e3d897aa5fa699530e25d026d7ba301965c (diff)
syncing uptil master/R3 9bc3cbac4f054438f5e77824f868cd94e9e22f81
Diffstat (limited to 'SpatialConvolution.lua')
-rw-r--r--SpatialConvolution.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/SpatialConvolution.lua b/SpatialConvolution.lua
index f7348d6..e13b1be 100644
--- a/SpatialConvolution.lua
+++ b/SpatialConvolution.lua
@@ -26,7 +26,6 @@ function SpatialConvolution:__init(nInputPlane, nOutputPlane,
self:reset()
-- should nil for serialization, the reset will still work
self.reset = nil
- self.iSize = torch.LongStorage(4):fill(0)
end
-- if you change the configuration of the module manually, call this
@@ -60,6 +59,7 @@ end
function SpatialConvolution:fastest(mode)
if mode == nil then mode = true end
self.fastest_mode = mode
+ self.iSize = self.iSize or torch.LongStorage(4)
self.iSize:fill(0)
return self
end
@@ -74,6 +74,7 @@ function SpatialConvolution:setMode(fmode, bdmode, bwmode)
if bwmode ~= nil then
self.bwmode = bwmode
end
+ self.iSize = self.iSize or torch.LongStorage(4)
self.iSize:fill(0)
return self
end
@@ -92,6 +93,7 @@ function SpatialConvolution:createIODescriptors(input)
batch = false
end
assert(input:dim() == 4 and input:isContiguous());
+ self.iSize = self.iSize or torch.LongStorage(4):fill(0)
if not self.iDesc or not self.oDesc or
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