import tensorflow as tf

        'triplet_loss/Anchor/%s/Distance/Mean' % tag:
            tf.math.reduce_mean(negative_distances),
        'triplet_loss/%s/Loss/All' % tag:
            loss,
        'triplet_loss/%s/Loss/Active' % tag:
            active_loss,
        'triplet_loss/%s/ActiveTripletNum' % tag:
            num_active_triplets,
        'triplet_loss/%s/ActiveTripletRatio' % tag:
            active_triplet_ratio,

        # Summaries related to triplet mining.
        'triplet_mining/Anchor/%s/Distance/Mean' % tag:
            tf.math.reduce_mean(negative_mining_distances),
        'triplet_mining/%s/Loss/All' % tag:
            mining_loss,
        'triplet_mining/%s/Loss/Active' % tag:
            active_mining_loss,
        'triplet_mining/%s/ActiveTripletNum' % tag:
            num_active_mining_triplets,
        'triplet_mining/%s/ActiveTripletRatio' % tag:
            active_mining_triplet_ratio,
    }
    if summarize_percentiles:
      summaries.update({
          'triplet_loss/Anchor/%s/Distance/Median' % tag:
