MCPcopy Create free account
hub / github.com/JasonLSC/GSCodec_Studio / timeit

Function timeit

profiling/main.py:28–37  ·  view source on GitHub ↗
(repeats: int, f: Callable, *args, **kwargs)

Source from the content-addressed store, hash-verified

26
27
28def timeit(repeats: int, f: Callable, *args, **kwargs) -> float:
29 for _ in range(5): # warmup
30 f(*args, **kwargs)
31 torch.cuda.synchronize()
32 start = time.time()
33 for _ in range(repeats):
34 results = f(*args, **kwargs)
35 torch.cuda.synchronize()
36 end = time.time()
37 return (end - start) / repeats, results
38
39
40def main(

Callers 1

mainFunction · 0.70

Calls 1

fFunction · 0.85

Tested by

no test coverage detected