class_docstr: Stats logging object useful for gathering statistics of training
  a deep network in PyTorch.
  
  Example:
      ```
      # Init stats structure that logs statistics 'objective' and 'top1e'.
      stats = Stats( ('objective','top1e') )
  
      network = init_net()  # init a pytorch module (=neural network)
      dataloader = init_dataloader()  # init a dataloader
  
      for epoch in range(10):
  
          # start of epoch -> call new_epoch
          stats.new_epoch()
  
          # Iterate over batches.
          for batch in dataloader:
              # Run a model and save into a dict of output variables "output"
              output = network(batch)
  
              # stats.update() automatically parses the 'objective' and 'top1e'
              # from the "output" dict and stores this into the db.
              stats.update(output)
              stats.print() # prints the averages over given epoch
  
          # Stores the training plots into '/tmp/epoch_stats.pdf'
          # and plots into a visdom server running at localhost (if running).
          stats.plot_stats(plot_file='/tmp/epoch_stats.pdf')
      ```
docstr: Print the current values of all stored stats.
  
  Args:
      max_it: Maximum iteration number to be displayed.
          If None, the maximum iteration number is not displayed.
      stat_set: The set of statistics to be printed.
docstr_tok: ["Print","the","current","values","of","all","stored","stats",".","Args",":","max_it",":","Maximum","iteration","number","to","be","displayed",".","If","None",",","the","maximum","iteration","number","is","not","displayed",".","stat_set",":","The","set","of","statistics","to","be","printed","."]
code: def print(
      self, max_it: Optional[int] = None, stat_set: str = "train"
  ) -> None:
      """
      Print the current values of all stored stats.
  
      Args:
          max_it: Maximum iteration number to be displayed.
              If None, the maximum iteration number is not displayed.
          stat_set: The set of statistics to be printed.
      """
  
      epoch = self.epoch
      stats = self.stats
  
      str_out = ""
  
      it = self.it[stat_set]
      stat_str = ""
      stats_print = sorted(stats[stat_set].keys())
      for stat in stats_print:
          if stats[stat_set][stat].count == 0:
              continue
          stat_str += " {0:.12}: {1:1.3f} |".format(
              stat, stats[stat_set][stat].avg
          )
  
      head_str = f"[{stat_set}] | epoch {epoch} | it {it}"
      if max_it:
          head_str += f"/ {max_it}"
  
      str_out = f"{head_str} | {stat_str}"
  
      print(str_out)
  
imports: import time
  import warnings
  from itertools import cycle
  from typing import List, Optional
  import matplotlib
  import matplotlib.pyplot
  import numpy
  from matplotlib import colors
  from visdom import Visdom
label_desc: Use image node_id 7 for calling the Stats obj's underlying member method code with example usage: obj.print(max_it, stat_set) without return types