class_docstr: Hook executed at a specified iteration number and prints the
  memory summary for the primary device at several steps of training.
class_docstr_tok: ["Hook","executed","at","a","specified","iteration","number","and","prints","the","memory","summary","for","the","primary","device","at","several","steps","of","training","."]
code: def __init__(self, log_iteration_num: int = 1) -> None:
      super().__init__()
      self.log_iteration_num = log_iteration_num
  
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 LogGpuMemoryHook object from inherited base classes: ClassyHook with example: obj = LogGpuMemoryHook(log_iteration_num)