MCPcopy Create free account
hub / github.com/Pints-AI/1.5-Pints / __init__

Method __init__

lit_gpt/speed_monitor.py:358–368  ·  view source on GitHub ↗
(
        self, length_fn: Callable[[Any], int], batch_size: int, **kwargs: Any
    )

Source from the content-addressed store, hash-verified

356
357class SpeedMonitorCallback(Callback):
358 def __init__(
359 self, length_fn: Callable[[Any], int], batch_size: int, **kwargs: Any
360 ) -> None:
361 super().__init__()
362 self.speed_monitor: Optional[SpeedMonitorBase] = None
363 self.speed_monitor_kwargs = kwargs
364 self.length_fn = length_fn
365 self.batch_size = batch_size
366 self.eval_t0: int = 0
367 self.train_t0: int = 0
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:

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected