MCPcopy Create free account
hub / github.com/OpenSparseLLMs/MoM / sizeof_fmt

Function sizeof_fmt

benchmarks/benchmark_training_throughput.py:24–29  ·  view source on GitHub ↗
(num, suffix='B')

Source from the content-addressed store, hash-verified

22
23
24def sizeof_fmt(num, suffix='B'):
25 for unit in ('', 'Ki', 'Mi', 'Gi', 'Ti', 'Pi', 'Ei', 'Zi'):
26 if abs(num) < 1024.0:
27 return f'{num:.2f}{unit}{suffix}'
28 num /= 1024.0
29 return f'{num:.2f}Yi{suffix}'
30
31
32def prepare_inputs(

Callers 1

profileFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected