(fn)
| 66 | # in seconds. We use CUDA events and synchronization for the most accurate |
| 67 | # measurements. |
| 68 | def timed(fn): |
| 69 | start = torch.cuda.Event(enable_timing=True) |
| 70 | end = torch.cuda.Event(enable_timing=True) |
| 71 | start.record() |
| 72 | result = fn() |
| 73 | end.record() |
| 74 | torch.cuda.synchronize() |
| 75 | return result, start.elapsed_time(end) / 1000 |
| 76 | |
| 77 | |
| 78 | # Generates random input and targets data for the model, where `b` is |
no test coverage detected