(self, exc_type, exc_val, exc_tb)
| 375 | return self |
| 376 | |
| 377 | def __exit__(self, exc_type, exc_val, exc_tb): |
| 378 | torch.cuda.synchronize() |
| 379 | self.end_time = time() |
| 380 | msg = f'Elapsed time for {self.name}: {self.elapsed_time:.3f} s' |
| 381 | if self.logger is not None: |
| 382 | self.logger.info(msg, main_process_only=True) |
| 383 | else: |
| 384 | print(msg) |
| 385 | |
| 386 | |
| 387 | # https://github.com/hpcaitech/Open-Sora/blob/main/opensora/utils/train_utils.py#L44 |
nothing calls this directly
no outgoing calls
no test coverage detected