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 Chintala <soumith@gmail.com>2016-06-29 21:43:12 +0300
committerGitHub <noreply@github.com>2016-06-29 21:43:12 +0300
commitaa7afe930690e2be6779650af0a1473716a93949 (patch)
treea5ff1ce0d3647eb424820b00ef95a252219dc228
parent09de630062b6d55688d5958d96f6d6d069474899 (diff)
parentfdef3826f243192e98a462208f7df06d07267290 (diff)
Merge pull request #213 from ngimel/master
workaround for :resize() issue
-rw-r--r--RNN.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/RNN.lua b/RNN.lua
index 2d415b1..c5e3efd 100644
--- a/RNN.lua
+++ b/RNN.lua
@@ -276,7 +276,13 @@ function RNN:updateOutput(input)
end
local x = self:makeContiguous(input)
- local y = self:resizeOutput(self.output)
+ local oSize = torch.LongStorage({self.seqLength, self.miniBatch, self.hiddenSize * self.numDirections})
+ if not self.output:isContiguous() then
+ self.output = self.output:transpose(1,2)
+ assert(self.output:isContiguous())
+ end
+ self.output:resize(oSize)
+ local y = self.output
local w = self.weight
local hy = self:resizeHidden(self.hiddenOutput):zero()
local cy = self:resizeHidden(self.cellOutput):zero()