class_docstr: Collect all tf.Tensor object, to be evaluated by tf.Session.run()
  These objects are grouped into::
  
      NETWORK_OUTPUT: to be decoded by an aggregator
      CONSOLE: to be printed on command line
      TF_SUMMARIES: to be added to tensorboard visualisation
docstr: update the dict, with item of either
  {name: variable} or {name: list of variable}
  
  return: key of the var_dict
docstr_tok: ["update","the","dict",",","with","item","of","either","{","name",":","variable","}","or","{","name",":","list","of","variable","}","return",":","key","of","the","var_dict"]
code: def _add_to_dict(self, var_dict, var, name, do_averaging=False):
      """
      update the dict, with item of either
      {name: variable} or {name: list of variable}
  
      return: key of the var_dict
      """
      assert isinstance(var, tf.Tensor), (
          "only supports adding one tf.Tensor at a time,"
          "but received {}".format(var)
      )
  
      assert name is not None, (
          "select a meaningful name for variable {}"
          "received {}".format(var, name)
      )
  
      if do_averaging and self.n_devices > 1:
          # collecting variables across devices as a list
          var_list = var_dict.get(name, [])
          try:
              var_list.append(var)
          except AttributeError:
              tf.logging.fatal(
                  "averaged variable name %s has been taken", name
              )
              raise
          var_dict[name] = var_list
          if len(var_list) > self.n_devices:
              tf.logging.fatal(
                  "averaged variable %s has been used "
                  "in the collector",
                  name,
              )
              raise ValueError
          return name
  
      # collecting variables and rename if exists
      new_name = name
      _uniq_id = 0
      while new_name in var_dict:
          _uniq_id += 1
          new_name = "{}_{}".format(name, _uniq_id)
      var_dict[new_name] = var
      return new_name
  
imports: from __future__ import absolute_import, print_function
  import tensorflow
  from tensorflow.contrib.framework import list_variables
  from niftynet.io.misc_io import image3_axial, image3_coronal, image3_sagittal, resolve_checkpoint
  from niftynet.utilities import util_common
  from niftynet.utilities.restore_initializer import restore_initializer
label_desc: Use image node_id 2 for calling the OutputsCollector obj's underlying member method code with example usage: obj._add_to_dict(var_dict, var, name, do_averaging) and returns: new_name, name