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: Executed after after parameter update. If the current phase is training,
  and it's a logging iteration, we compute and log several helpul training
  stats to keep track of ongoing training.
  
  For monitoring the batch size (average training iteration time), we allow
  monitoring the stats (optionally) for every N iterations to get better
  idea about the batch time and training eta.
  
  Set the btime_freq input using cfg.HOOKS.PERF_STATS.PERF_STAT_FREQUENCY=N
  ensuring that cfg.HOOKS.PERF_STATS.MONITOR_PERF_STATS = True.
docstr_tok: ["Executed","after","after","parameter","update",".","If","the","current","phase","is","training",",","and","it","'s","a","logging","iteration",",","we","compute","and","log","several","helpul","training","stats","to","keep","track","of","ongoing","training",".","For","monitoring","the","batch","size","(","average","training","iteration","time",")",",","we","allow","monitoring","the","stats","(","optionally",")","for","every","N","iterations","to","get","better","idea","about","the","batch","time","and","training","eta",".","Set","the","btime_freq","input","using","cfg.HOOKS.PERF_STATS.PERF_STAT_FREQUENCY=N","ensuring","that","cfg.HOOKS.PERF_STATS.MONITOR_PERF_STATS","=","True","."]
code: def on_update(self, task: "tasks.ClassyTask") -> None:
      """
      Executed after after parameter update. If the current phase is training,
      and it's a logging iteration, we compute and log several helpul training
      stats to keep track of ongoing training.
  
      For monitoring the batch size (average training iteration time), we allow
      monitoring the stats (optionally) for every N iterations to get better
      idea about the batch time and training eta.
  
      Set the btime_freq input using cfg.HOOKS.PERF_STATS.PERF_STAT_FREQUENCY=N
      ensuring that cfg.HOOKS.PERF_STATS.MONITOR_PERF_STATS = True.
      """
      if is_primary() and task.train:
          # Only log during training and on primary
          self._log_training_epoch(task)
      task.additional_log_data.clear()
  
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 3 for calling the LogLossLrEtaHook obj's underlying member method code with example usage: obj.on_update(task) without return types