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

github.com/torch/nn.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoumith Chintala <soumith@fb.com>2015-09-14 07:57:13 +0300
committerSoumith Chintala <soumith@fb.com>2015-09-14 07:57:13 +0300
commit948074d0e6ca52eb8816c9c440096478fe2adee8 (patch)
tree0dd7518d2d6d88f5328f1af390ff495e21753541 /ConcatTable.lua
parent267cfd911b54adccc2841148a1cb750b56d05b78 (diff)
fixing bug in ConcatTable variable length
Diffstat (limited to 'ConcatTable.lua')
-rw-r--r--ConcatTable.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/ConcatTable.lua b/ConcatTable.lua
index 93d9ad5..7d49af1 100644
--- a/ConcatTable.lua
+++ b/ConcatTable.lua
@@ -14,13 +14,16 @@ function ConcatTable:updateOutput(input)
end
local function retable(t1, t2, f)
- for k, v in pairs(t2) do
+ for k, v in ipairs(t2) do
if (torch.type(v) == "table") then
t1[k] = retable(t1[k] or {}, t2[k], f)
else
f(t1, k, v)
end
end
+ for i=#t2+1, #t1 do
+ t1[i] = nil
+ end
return t1
end