MCPcopy Create free account
hub / github.com/SafeAILab/EAGLE / timer

Function timer

eagle/testbug/model/utils.py:21–33  ·  view source on GitHub ↗
(func)

Source from the content-addressed store, hash-verified

19
20
21def timer(func):
22 def wrapper(*args, **kwargs):
23 torch.cuda.synchronize()
24 start = time.perf_counter()
25
26 result = func(*args, **kwargs)
27
28 torch.cuda.synchronize()
29 elapsed = time.perf_counter() - start
30 print(f'{func.__name__} took {elapsed} seconds')
31 return result
32
33 return wrapper
34
35
36def prepare_logits_processor(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected