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
dataset/ETHPy150Open tflearn/tflearn/tflearn/summaries.py/add_activations_summary/original