class_docstr: Compute average for torch.Tensor, used for loss average.
class_docstr_tok: ["Compute","average","for","torch.Tensor",",","used","for","loss","average","."]
code: def add(self, v):
      count = v.data.numel()
      v = v.data.sum()
      self.n_count += count
      self.sum += v
  
imports: import torch
  import pickle
  import numpy
label_desc: Use image node_id 2 for calling the Averager obj's underlying member method code with example usage: obj.add(v) without return types