src/transformers/modeling_tf_utils.py/TFMultipleChoiceLoss/compute_loss
class TFMultipleChoiceLoss:    def compute_loss(self, labels, logits):
        loss_fn = tf.keras.losses.SparseCategoricalCrossentropy(
            from_logits=True, reduction=tf.keras.losses.Reduction.NONE
        )
        return loss_fn(labels, logits)