def _add_loss_summaries(total_loss):
 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

def _add_loss_summaries ( total_loss ) : 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 .