class_docstr: Hook executed after every parameters update step. Logs training
  stats like: LR, iteration, ETA, batch time etc to logger streams.
class_docstr_tok: ["Hook","executed","after","every","parameters","update","step",".","Logs","training","stats","like",":","LR",",","iteration",",","ETA",",","batch","time","etc","to","logger","streams","."]
docstr: Args:
      checkpoint_folder: checkpoint directory where we will write the stdout.json
      btime_freq: if specified, logs average batch time of rolling_freq
                    batches also.
docstr_tok: ["Args",":","checkpoint_folder",":","checkpoint","directory","where","we","will","write","the","stdout.json","btime_freq",":","if","specified",",","logs","average","batch","time","of","rolling_freq","batches","also","."]
code: def __init__(
      self, checkpoint_folder: str, btime_freq: Optional[int] = None
  ) -> None:
      """
      Args:
          checkpoint_folder: checkpoint directory where we will write the stdout.json
          btime_freq: if specified, logs average batch time of rolling_freq
                        batches also.
      """
      super().__init__()
      self.btime_freq: Optional[int] = btime_freq
      self.json_stdout_logger = None
      if is_primary():
          self.json_stdout_logger = g_pathmgr.open(
              f"{checkpoint_folder}/stdout.json",
              mode="a",
              buffering=1,  # line buffer - flush each line
          )
          atexit.register(self.json_stdout_logger.close)
  
imports: import atexit
  import datetime
  import json
  import logging
  import time
  from typing import List, Optional
  import torch
  from classy_vision import meters, tasks
  from classy_vision.generic.distributed_util import get_rank, is_primary
  from classy_vision.hooks.classy_hook import ClassyHook
  from fairscale.nn.data_parallel import FullyShardedDataParallel
  from iopath.common.file_io import g_pathmgr
  from vissl.models.model_helpers import model_output_has_nan
  from vissl.utils.checkpoint import CheckpointWriter, is_checkpoint_phase
  from vissl.utils.env import get_machine_local_and_dist_rank
  from vissl.utils.io import save_file
  from vissl.utils.logger import log_gpu_stats
  from vissl.utils.perf_stats import PerfStats
label_desc: Use image node_id 1 to create a new LogLossLrEtaHook object from inherited base classes: ClassyHook with example: obj = LogLossLrEtaHook(checkpoint_folder, btime_freq)