code: def add_activation_summary(
      x, types=None, name=None, collections=None
  ):
      """
      Call :func:`add_tensor_summary` under a reused 'activation-summary' name scope.
      This function is a no-op if not calling from main training tower.
  
      Args:
          x (tf.Tensor): the tensor to summary.
          types (list[str]): summary types, defaults to ``['sparsity', 'rms', 'histogram']``.
          name (str): if is None, use x.name.
          collections (list[str]): collections of the summary ops.
      """
      ndim = x.get_shape().ndims
      if ndim < 2:
          logger.warn(
              "Cannot summarize scalar activation {}".format(x.name)
          )
          return
      if types is None:
          types = ["sparsity", "rms", "histogram"]
      with cached_name_scope("activation-summary"):
          add_tensor_summary(
              x, types, name=name, collections=collections
          )
  
file_path: tensorpack/tensorpack/tfutils/summary.py
imports: import re
  from contextlib import contextmanager
  import six
  from six.moves import range
  from tensorflow.python.training import moving_averages
  from ..compat import tfv1
  from ..utils import logger
  from ..utils.argtools import graph_memoized
  from ..utils.naming import MOVING_SUMMARY_OPS_KEY
  from .scope_utils import cached_name_scope
  from .symbolic_functions import rms
  from .tower import get_current_tower_context
label_desc: Use image node_id 6 for calling a global function with example usage: add_activation_summary(x, types, name, collections) without return types