class_docstr: A callback which logs iteration times as scalars to TensorBoard.
  
  Args:
      logger: Either a :class:`torchtnt.loggers.tensorboard.TensorBoardLogger`
          or a :class:`torch.utils.tensorboard.SummaryWriter` instance.
      moving_avg_window: an optional int to control the moving average window
      log_every_n_steps: an optional int to control the log frequency
code: def on_predict_step_end(
      self, state: State, unit: TPredictUnit
  ) -> None:
      timer = none_throws(state.predict_state).iteration_timer
      if writer := self._writer:
          self._log_step_metrics(
              writer,
              "predict_iteration_time",
              timer,
              unit.predict_progress.num_steps_completed,
          )
  
file_path: tnt/torchtnt/framework/callbacks/iteration_time_logger.py
imports: from typing import Optional, Union
  from pyre_extensions import none_throws
  from torch.utils.tensorboard import SummaryWriter
  from torchtnt.framework.callback import Callback
  from torchtnt.framework.state import State
  from torchtnt.framework.unit import TEvalUnit, TPredictUnit, TTrainUnit
  from torchtnt.utils.distributed import get_global_rank
  from torchtnt.utils.loggers.tensorboard import TensorBoardLogger
  from torchtnt.utils.timer import TimerProtocol
label_desc: Use image node_id 5 for calling the IterationTimeLogger obj's underlying member method code with example usage: obj.on_predict_step_end(state, unit) without return types