(self, trainer: Trainer, pl_module: LightningModule, stage: str)
| 368 | self.total_lengths: int = 0 |
| 369 | |
| 370 | def setup(self, trainer: Trainer, pl_module: LightningModule, stage: str) -> None: |
| 371 | if self.speed_monitor is not None: |
| 372 | return # already setup |
| 373 | # TODO: this will not work properly if a precision plugin is passed to Trainer |
| 374 | flops_available = get_flops_available( |
| 375 | trainer.strategy.root_device, trainer._accelerator_connector._precision_flag |
| 376 | ) |
| 377 | self.speed_monitor = SpeedMonitorBase( |
| 378 | flops_available, trainer.logger.log_metrics, **self.speed_monitor_kwargs |
| 379 | ) |
| 380 | |
| 381 | @trainer_rank_zero_only |
| 382 | def on_train_start(self, trainer: Trainer, pl_module: LightningModule) -> None: |
nothing calls this directly
no test coverage detected