import tensorflow as tf

  logits.get_shape().assert_is_compatible_with(labels.get_shape())
  with tf.name_scope(name):
    num_classes = labels.get_shape()[-1].value
    labels = tf.cast(labels, logits.dtype)
    if label_smoothing > 0:
      smooth_positives = 1.0 - label_smoothing
