class_docstr: Statistics of some scalar tensor.
  The value will be averaged over all given datapoints.
  
  Note that the average of accuracy over all batches is not necessarily the
  accuracy of the whole dataset. See :class:`ClassificationError` for details.
code: def _after_inference(self):
      if len(self.stats):
          self.stats = np.mean(self.stats, axis=0)
          assert len(self.stats) == len(self.names)
  
      ret = {}
      for stat, name in zip(self.stats, self.names):
          opname, _ = get_op_tensor_name(name)
          name = (
              "{}_{}".format(self.prefix, opname)
              if self.prefix
              else opname
          )
          ret[name] = stat
      return ret
  
imports: import numpy
  from abc import ABCMeta
  import six
  from ..tfutils.common import get_op_tensor_name
  from ..utils import logger
  from ..utils.stats import BinaryStatistics, RatioCounter
  from .base import Callback
label_desc: Use image node_id 5 for calling the ScalarStats obj's underlying member method code with example usage: obj._after_inference() and returns: ret