code: def add_activation_summary(x, types=None, name=None, collections=None):
      
      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)
docs: 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.