X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=profiler-torch.git;a=blobdiff_plain;f=profiler.lua;fp=profiler.lua;h=f57c9d885f5aa7681e4efbc60ac5ee1442ee00e1;hp=4fec2582ceb8635f34a69ab24f651b240ee67e83;hb=3debf6e5063b03dc620d2ed67c6c155245bfedd8;hpb=a5f00c98459afa86205650ac4d4b474efe2d1949 diff --git a/profiler.lua b/profiler.lua index 4fec258..f57c9d8 100644 --- 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