()
| 33 | start_time = None |
| 34 | |
| 35 | def start_timer(): |
| 36 | global start_time |
| 37 | gc.collect() |
| 38 | torch.cuda.empty_cache() |
| 39 | torch.cuda.reset_max_memory_allocated() |
| 40 | torch.cuda.synchronize() |
| 41 | start_time = time.time() |
| 42 | |
| 43 | def end_timer_and_print(local_msg): |
| 44 | torch.cuda.synchronize() |