def cross_entropy(labels, logits):
    """
    Calculate the cross_entropy.

    :param labels: A float tensor of shape [batch_size, ..., num_classes] representing the label class probabilities.
    :param logits: A float tensor of shape [batch_size, ..., num_classes] representing the logits.
    :return: A tensor representing the cross entropy.
    """
    with tf.variable_scope("cross_entropy"):
        return tf.nn.softmax_cross_entropy_with_logits(labels=labels, logits=logits)
Calculate the cross_entropy.

    :param labels: A float tensor of shape [batch_size, ..., num_classes] representing the label class probabilities.
    :param logits: A float tensor of shape [batch_size, ..., num_classes] representing the logits.
    :return: A tensor representing the cross entropy.