class_docstr: Computes and stores the average and current value
code: def update(self, val, n=1, epoch=0):
      # make sure the history is of the same len as epoch
      while len(self.history) <= epoch:
          self.history.append([])
  
      self.history[epoch].append(val / n)
      self.val = val
      self.sum += val * n
      self.count += n
      self.avg = self.sum / self.count
  
imports: import gzip
  import json
  import logging
  import time
  import warnings
  from collections.abc import Iterable
  from itertools import cycle
  import matplotlib
  import matplotlib.pyplot
  import numpy
  from matplotlib import colors
  from pytorch3d.implicitron.tools.vis_utils import get_visdom_connection
label_desc: Use image node_id 3 for calling the AverageMeter obj's underlying member method code with example usage: obj.update(val, n, epoch) without return types