class_docstr: Reporter class.
  
  Examples:
  
      >>> reporter = Reporter()
      >>> with reporter.observe('train') as sub_reporter:
      ...     for batch in iterator:
      ...         stats = dict(loss=0.2)
      ...         sub_reporter.register(stats)
class_docstr_tok: ["Reporter","class",".","Examples",":",">",">",">","reporter","=","Reporter","(",")",">",">",">","with","reporter.observe","(","'train","'",")","as","sub_reporter",":","...","for","batch","in","iterator",":","...","stats","=","dict","(","loss=0.2",")","...","sub_reporter.register","(","stats",")"]
code: def __init__(self, epoch: int = 0):
      assert check_argument_types()
      if epoch < 0:
          raise ValueError(f"epoch must be 0 or more: {epoch}")
      self.epoch = epoch
      # stats: Dict[int, Dict[str, Dict[str, float]]]
      # e.g. self.stats[epoch]['train']['loss']
      self.stats = {}
  
imports: import dataclasses
  import datetime
  import logging
  import time
  import warnings
  from collections import defaultdict
  from contextlib import contextmanager
  from pathlib import Path
  from typing import ContextManager, Dict, List, Optional, Sequence, Tuple, Union
  import humanfriendly
  import numpy
  import torch
  from packaging.version import parse
  from typeguard import check_argument_types, check_return_type
label_desc: Use image node_id 1 to create a new Reporter object  with example: obj = Reporter(epoch)