def _add_loss_summaries(total_loss):
    'Add summaries for losses in CIFAR-10 model.\n\n  Generates moving average for all losses and associated summaries for\n  visualizing the performance of the network.\n\n  Args:\n    total_loss: Total loss from loss().\n  Returns:\n    loss_averages_op: op for generating moving averages of losses.\n  '
    loss_averages = tf.train.ExponentialMovingAverage(0.9, name='avg')
    losses = tf.get_collection('losses')
    loss_averages_op = loss_averages.apply((losses + [total_loss]))
    for l in (losses + [total_loss]):
        tf.summary.scalar((l.op.name + ' (raw)'), l)
        tf.summary.scalar(l.op.name, loss_averages.average(l))
    return loss_averages_op
Add summaries for losses in CIFAR-10 model.

Generates moving average for all losses and associated summaries for
visualizing the performance of the network.

Args:
  total_loss: Total loss from loss().
Returns:
  loss_averages_op: op for generating moving averages of losses.
def _add_loss_summaries(total_loss):
    'Add summaries for losses in CIFAR-10 model.\n\n  Generates moving average for all losses and associated summaries for\n  visualizing the performance of the network.\n\n  Args:\n    total_loss: Total loss from loss().\n  Returns:\n    loss_averages_op: op for generating moving averages of losses.\n  '
    loss_averages = tf.train.ExponentialMovingAverage(0.9, name='avg')
    losses = tf.get_collection('losses')
    loss_averages_op = loss_averages.apply((losses + [total_loss]))
    for l in (losses + [total_loss]):
        tf.summary.scalar((l.op.name + ' (raw)'), l)
        tf.summary.scalar(l.op.name, loss_averages.average(l))
    return loss_averages_op