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
+ print(string.format('%s %s %.02fs%s', indent, l, t, s))
end
if torch.isTypeOf(model, nn.Container) then