code: def variable_summaries(var):
      """Attach summaries to a tensor (for TensorBoard visualizations)."""
      name = var.name[var.name.rfind("/") + 1 : var.name.rfind(":")]
      with tf.name_scope(name):
          mean = tf.reduce_mean(var)
          tf.summary.scalar("mean", mean)
          with tf.name_scope("stddev"):
              stddev = tf.sqrt(tf.reduce_mean(tf.square(var - mean)))
          tf.summary.scalar("stddev", stddev)
          tf.summary.scalar("max", tf.reduce_max(var))
          tf.summary.scalar("min", tf.reduce_min(var))
          tf.summary.histogram("histogram", var)
  
file_path: neural-structured-learning/research/gam/gam/trainer/trainer_base.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import abc
  import numpy
  import tensorflow
label_desc: Use image node_id 2 for calling a global function with example usage: variable_summaries(var) without return types