MCPcopy
hub / github.com/tinygrad/tinygrad / fmt

Function fmt

examples/tools/bandwidth_test.py:26–28  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

24 bw[i][j] = SZ / t / 1e9 # GB/s
25
26 def fmt(x):
27 c = "green" if x > 50 else "yellow" if x > 20 else "red"
28 return colored(f"{x:6.1f}", c)
29
30 # header
31 print(" " * 8 + " ".join(f"{'d'+str(j):>6}" for j in range(GPUS)))

Callers 1

bandwidth_test.pyFile · 0.85

Calls 1

coloredFunction · 0.90

Tested by

no test coverage detected