profiler = {}
-function profiler.decor(model, functionsToDecorate)
+function profiler.decorate(model, functionsToDecorate)
local functionsToDecorate = functionsToDecorate or
{
if torch.isTypeOf(model, nn.Container) then
for _, m in ipairs(model.modules) do
- profiler.decor(m, functionsToDecorate)
+ profiler.decorate(m, functionsToDecorate)
end
end
-- Decor it for profiling
-profiler.decor(model)
+profiler.decorate(model)
print()
+torch.save('model.t7', model)
+
-- Create the data and criterion
local input = torch.Tensor(1000, 1000)