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: add tf.Tensors to be evaluated to dictionary
  The dictionaries will be retrieved and evaluated
  by application driver in the train/infer loops
  
  :param var: tf.Tensor to be evaluated by tf.Session()
  :param name: name of the variable (for displaying purposes)
  :param average_over_devices:
  :param collection: in choices of
      [CONSOLE, TF_SUMMARIES, NETWORK_OUTPUT]
  :param summary_type: if adding to TF_SUMMARIES, there are
      a few possible ways to visualise the Tensor value
      see SUPPORTED_SUMMARY
  :return:
docstr_tok: ["add","tf.Tensors","to","be","evaluated","to","dictionary","The","dictionaries","will","be","retrieved","and","evaluated","by","application","driver","in","the","train\/infer","loops",":","param","var",":","tf.Tensor","to","be","evaluated","by","tf.Session","(",")",":","param","name",":","name","of","the","variable","(","for","displaying","purposes",")",":","param","average_over_devices",":",":","param","collection",":","in","choices","of","[","CONSOLE",",","TF_SUMMARIES",",","NETWORK_OUTPUT","]",":","param","summary_type",":","if","adding","to","TF_SUMMARIES",",","there","are","a","few","possible","ways","to","visualise","the","Tensor","value","see","SUPPORTED_SUMMARY",":","return",":"]
code: def add_to_collection(
      self,
      var,
      name,
      average_over_devices=False,
      collection=CONSOLE,
      summary_type="scalar",
  ):
      """
      add tf.Tensors to be evaluated to dictionary
      The dictionaries will be retrieved and evaluated
      by application driver in the train/infer loops
  
      :param var: tf.Tensor to be evaluated by tf.Session()
      :param name: name of the variable (for displaying purposes)
      :param average_over_devices:
      :param collection: in choices of
          [CONSOLE, TF_SUMMARIES, NETWORK_OUTPUT]
      :param summary_type: if adding to TF_SUMMARIES, there are
          a few possible ways to visualise the Tensor value
          see SUPPORTED_SUMMARY
      :return:
      """
      if collection == CONSOLE:
          self._add_to_console(var, name, average_over_devices)
      elif collection == NETWORK_OUTPUT:
          self._add_to_network_output(var, name, average_over_devices)
      elif collection == TF_SUMMARIES:
          self._add_to_tf_summary(
              var, name, average_over_devices, summary_type
          )
      else:
          raise ValueError(
              "unknown variable collection {}.".format(collection)
          )
  
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 3 for calling the OutputsCollector obj's underlying member method code with example usage: obj.add_to_collection(var, name, average_over_devices, collection, summary_type) without return types