import tensorflow as tf

  Returns:
      A tensor with the log loss.
  """
  with tf.name_scope(name):
    predictions = tf.to_float(predictions)
    labels = tf.to_float(labels)
    predictions = tf.clip_by_value(predictions, eps, 1 - eps)
    predictions.get_shape().assert_is_compatible_with(labels.get_shape())
    loss = -tf.reduce_mean(labels * tf.log(predictions))
    return loss


