- print(string.format('acc_time %.02fs (%.01fmus/sample)',
- model.accTime,
- 1e6 * model.accTime / nbSamples))
+ s = s .. string.format(profiler.colors('green') .. ' (%.01fmus/sample)', 1e6 * t / nbSamples)
+ end
+ s = s .. profiler.colors('black')
+ return s
+end
+
+function profiler.print(model, nbSamples, totalTime, indent)
+ local indent = indent or ''
+ local hint
+
+ local localTotal = 0
+ for _, t in pairs(model.accTime) do
+ localTotal = localTotal + t
+ end
+
+ if torch.isTypeOf(model, nn.Container) then
+ hint = ' '