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:
a5f00c9
)
Added a proper error when trying to print the timing for an undecorated model.
author
Francois Fleuret
<francois@fleuret.org>
Tue, 6 Dec 2016 10:02:35 +0000
(11:02 +0100)
committer
Francois Fleuret
<francois@fleuret.org>
Tue, 6 Dec 2016 10:02:35 +0000
(11:02 +0100)
profiler.lua
patch
|
blob
|
history
diff --git
a/profiler.lua
b/profiler.lua
index
4fec258
..
f57c9d8
100644
(file)
--- a/
profiler.lua
+++ b/
profiler.lua
@@
-115,6
+115,10
@@
function profiler.print(model, nbSamples, totalTime, indent)
local indent = indent or ''
local hint
+ if not model.accTime then
+ error('The model does not seem decorated for profiling.')
+ end
+
local localTotal = 0
for _, t in pairs(model.accTime) do
localTotal = localTotal + t