MCPcopy
hub / github.com/InternLM/lmdeploy / tab_row

Method tab_row

lmdeploy/profiler.py:109–114  ·  view source on GitHub ↗
(name, *items)

Source from the content-addressed store, hash-verified

107 width = header + digits * (1 + len(self.percentages))
108
109 def tab_row(name, *items):
110
111 def fmt(x):
112 return '{:>{d}.3f}'.format(x, d=digits) if isinstance(x, float) else '{:>{d}}'.format(x, d=digits)
113
114 print('{:<{p}}{}'.format(name, ''.join([fmt(x) for x in items]), p=header))
115
116 print('\n{s:{c}^{n}}'.format(s=f' {title} ', n=width, c='='))
117 tab_row('Benchmark duration', self.elapsed_time)

Callers

nothing calls this directly

Calls 3

fmtFunction · 0.85
formatMethod · 0.80
joinMethod · 0.80

Tested by

no test coverage detected