From 1f7f826a5234640986078ed4747374f12bffa784 Mon Sep 17 00:00:00 2001 From: Boris Fomitchev Date: Tue, 28 Feb 2017 16:35:27 -0800 Subject: Resolving luajit/lua5.2 conflict --- RNN.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/RNN.lua b/RNN.lua index dc8e543..2836228 100644 --- a/RNN.lua +++ b/RNN.lua @@ -613,7 +613,12 @@ local function retrieveLinearParams(self, cuDNNMethod) nbDims:data(), filterDimA:data()) - local offset = (tonumber(matrixPointer[0]) - tonumber(self.weight:data()))/self.weight:elementSize() + local offset + if type(jit) == 'table' then + offset = matrixPointer[0] - self.weight:data() + else + offset = (tonumber(matrixPointer[0]) - tonumber(self.weight:data()))/self.weight:elementSize() + end local params = torch.CudaTensor(self.weight:storage(), offset + self.weight:storageOffset(), filterDimA:prod()) table.insert(layerInfo, params) end -- cgit v1.2.3