(func)
| 19 | |
| 20 | |
| 21 | def 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 | |
| 36 | def prepare_logits_processor( |
nothing calls this directly
no outgoing calls
no test coverage detected