class_docstr: Callback for handling train/validation logistics, report summarization,
  logging etc.
class_docstr_tok: ["Callback","for","handling","train\/validation","logistics",",","report","summarization",",","logging","etc","."]
code: def on_update_end(self, **kwargs):
      if not kwargs["should_log"]:
          return
      extra = {}
      if "cuda" in str(self.trainer.device):
          extra["max mem"] = torch.cuda.max_memory_allocated() / 1024
          extra["max mem"] //= 1024
  
      if self.training_config.experiment_name:
          extra["experiment"] = self.training_config.experiment_name
  
      max_updates = getattr(self.trainer, "max_updates", None)
      num_updates = getattr(self.trainer, "num_updates", None)
      extra.update(
          {
              "epoch": self.trainer.current_epoch,
              "num_updates": num_updates,
              "iterations": self.trainer.current_iteration,
              "max_updates": max_updates,
              "lr": "{:.5f}".format(
                  self.trainer.optimizer.param_groups[0]["lr"]
              ).rstrip("0"),
              "ups": "{:.2f}".format(
                  self.log_interval
                  / self.train_timer.unix_time_since_start()
              ),
              "time": self.train_timer.get_time_since_start(),
              "time_since_start": self.total_timer.get_time_since_start(),
              "eta": calculate_time_left(
                  max_updates=max_updates,
                  num_updates=num_updates,
                  timer=self.train_timer,
                  num_snapshot_iterations=self.snapshot_iterations,
                  log_interval=self.log_interval,
                  eval_interval=self.evaluation_interval,
              ),
          }
      )
      self.train_timer.reset()
      summarize_report(
          current_iteration=self.trainer.current_iteration,
          num_updates=num_updates,
          max_updates=max_updates,
          meter=kwargs["meter"],
          extra=extra,
          tb_writer=self.tb_writer,
          wandb_logger=self.wandb_logger,
      )
  
file_path: mmf/mmf/trainers/callbacks/logistics.py
imports: import logging
  import torch
  from mmf.trainers.callbacks.base import Callback
  from mmf.utils.configuration import get_mmf_env
  from mmf.utils.logger import calculate_time_left, setup_output_folder, summarize_report, TensorboardLogger, WandbLogger
  from mmf.utils.timer import Timer
label_desc: Use image node_id 3 for calling the LogisticsCallback obj's underlying member method code with example usage: obj.on_update_end() without return types