class_docstr: Computes and stores the average and current value.
  
  Parameters
  ----------
  name : str
      Name to display.
  fmt : str
      Format string to print the values.
class_docstr_tok: ["Computes","and","stores","the","average","and","current","value",".","Parameters","--","--","--","--","--","name",":","str","Name","to","display",".","fmt",":","str","Format","string","to","print","the","values","."]
docstr: Update with value and weight.
  
  Parameters
  ----------
  val : float or int
      The new value to be accounted in.
  n : int
      The weight of the new value.
docstr_tok: ["Update","with","value","and","weight",".","Parameters","--","--","--","--","--","val",":","float","or","int","The","new","value","to","be","accounted","in",".","n",":","int","The","weight","of","the","new","value","."]
code: def update(self, val, n=1):
      """
      Update with value and weight.
  
      Parameters
      ----------
      val : float or int
          The new value to be accounted in.
      n : int
          The weight of the new value.
      """
      self.val = val
      self.sum += val * n
      self.count += n
      self.avg = self.sum / self.count
  
imports: import logging
  from collections import OrderedDict
  import time
  import numpy
  import torch
  import nni.retiarii.nn.pytorch
  from nni.nas.pytorch.mutables import Mutable, InputChoice, LayerChoice
label_desc: Use image node_id 3 for calling the AverageMeter obj's underlying member method code with example usage: obj.update(val, n) without return types