projects
/
profiler-torch.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4ed0c97
)
Tidied a bit the printing.
author
Francois Fleuret
<francois@fleuret.org>
Mon, 5 Dec 2016 16:25:38 +0000
(17:25 +0100)
committer
Francois Fleuret
<francois@fleuret.org>
Mon, 5 Dec 2016 16:25:38 +0000
(17:25 +0100)
profiler.lua
patch
|
blob
|
history
diff --git
a/profiler.lua
b/profiler.lua
index
b95d750
..
ad280d2
100644
(file)
--- a/
profiler.lua
+++ b/
profiler.lua
@@
-76,21
+76,14
@@
function profiler.print(model, nbSamples, indent)
print(string.format('%s* %s', indent, model.__typename))
print(string.format('%s* %s', indent, model.__typename))
- if nbSamples then
- for l, t in pairs(model.accTime) do
- print(string.format('%s %s %.02fs (%.01fmus/sample)',
- indent,
- l,
- t,
- 1e6 * t / nbSamples))
- end
- else
- for l, t in pairs(model.accTime) do
- print(string.format('%s %s %.02fs',
- indent,
- l,
- t))
+ for l, t in pairs(model.accTime) do
+ local s
+ if nbSamples then
+ s = string.format(' (%.01fmus/sample)', 1e6 * t / nbSamples)
+ else
+ s = ''
end
end
+ print(string.format('%s %s %.02fs%s', indent, l, t, s))
end
if torch.isTypeOf(model, nn.Container) then
end
if torch.isTypeOf(model, nn.Container) then