Skip to content

Instantly share code, notes, and snippets.

@szagoruyko
Created February 5, 2016 13:45
Show Gist options
  • Save szagoruyko/c1f3b5022c4c5a84fb03 to your computer and use it in GitHub Desktop.
Save szagoruyko/c1f3b5022c4c5a84fb03 to your computer and use it in GitHub Desktop.
function nn.Module:replace(callback)
local out = callback(self)
if self.modules then
for i, module in ipairs(self.modules) do
self.modules[i] = module:replace(callback)
end
end
return out
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment