code: def add_activations_summary(
      activation_ops,
      name_prefix="",
      name_suffix="",
      collection_key=None,
  ):
      """add_activations_summary.
  
      Add histogram summary for given activations.
  
      Arguments:
          activation_ops: A list of `Tensor`. The activations to summarize.
          name_prefix: `str`. A prefix to add to summary scope.
          name_suffix: `str`. A suffix to add to summary scope.
          collection_key: `str`. A collection to store the summaries.
  
      Returns:
          The list of created activation summaries.
      """
  
      summ = []
      for ao in activation_ops:
          ao_name = ao.op.name
          summ_name = format_scope_name(
              ao_name, name_prefix, "Activations/" + name_suffix
          )
          summ_exists = summary_exists(summ_name)
          if summ_exists is not None:
              tf.add_to_collection(collection_key, summ_exists)
          else:
              get_summary("histogram", summ_name, ao, collection_key)
  
          summ_name = format_scope_name(
              ao_name, name_prefix, "Sparsity/" + name_suffix
          )
          summ_exists = summary_exists(summ_name)
          if summ_exists is not None:
              tf.add_to_collection(collection_key, summ_exists)
              summ.append(summ_exists)
          else:
              summ.append(
                  get_summary(
                      "scalar",
                      summ_name,
                      tf.nn.zero_fraction(ao),
                      collection_key,
                  )
              )
      return summ
  
file_path: tflearn/tflearn/summaries.py
imports: from __future__ import division, print_function, absolute_import
  import tensorflow.compat.v1
  from tensorflow.core.framework import summary_pb2
  from .utils import format_scope_name
label_desc: Use image node_id 3 for calling a global function with example usage: add_activations_summary(activation_ops, name_prefix, name_suffix, collection_key) and returns: summ