Skip to content

Commit

Permalink
global variable fixes (found via th -g)
Browse files Browse the repository at this point in the history
  • Loading branch information
soumith committed Nov 17, 2014
1 parent 49bb858 commit 61beacd
Show file tree
Hide file tree
Showing 2 changed files with 140 additions and 140 deletions.
12 changes: 6 additions & 6 deletions FlattenTable.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ local function checkMapping(output, input, input_map)
end
-- forward DFS order
for i = 1, #input do
ok = checkMapping(output, input[i], input_map[i])
if not ok then
return false
end
local ok = checkMapping(output, input[i], input_map[i])
if not ok then
return false
end
end
return true
else
Expand Down Expand Up @@ -77,7 +77,7 @@ function FlattenTable:updateOutput(input)
self.input_map = flatten(self.output, input)
end
return self.output
end
end

function FlattenTable:updateGradInput(input, gradOutput)
assert(type(input) == 'table', 'input must be a table')
Expand All @@ -90,7 +90,7 @@ function FlattenTable:updateGradInput(input, gradOutput)
if not checkMapping(gradOutput, self.gradInput, self.input_map) then
self.gradInput = inverseFlatten(gradOutput, self.input_map)
end

return self.gradInput
end

Expand Down
Loading

0 comments on commit 61beacd

Please sign in to comment.