MCPcopy Create free account
hub / github.com/ScalingIntelligence/tokasaurus / convert_unit

Function convert_unit

tokasaurus/utils.py:188–196  ·  view source on GitHub ↗
(milis: float, unit: str)

Source from the content-addressed store, hash-verified

186
187
188def convert_unit(milis: float, unit: str) -> float:
189 if unit == "ms":
190 return milis
191 elif unit == "s":
192 return milis / 1000
193 elif unit == "us":
194 return milis * 1000
195 else:
196 raise ValueError(f"Invalid unit: {unit}")
197
198
199@torch.no_grad()

Callers 2

timedFunction · 0.85
timed_with_graphFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected