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 val(self):
      res = 0
      if self.n_count != 0:
          res = self.sum / float(self.n_count)
      return res
  
imports: import torch
  import pickle
  import numpy
label_desc: Use image node_id 4 for calling the Averager obj's underlying member method code with example usage: obj.val() and returns: res