def interval_loss_cce(prediction: "torch.Tensor", target: "torch.Tensor") -> "torch.Tensor":
        """
        Computes the categorical cross entropy loss with the correct class having the lower bound prediction,
        and the other classes having their upper bound predictions.

        :param prediction: model predictions.
        :param target: target classes. NB not one hot.
        :return: scalar loss value
        """
        upper_preds = prediction[:, 1, :]
        criterion = torch.nn.CrossEntropyLoss()
        for i, j in enumerate(target):
            # for the prediction corresponding to the target class, take the lower bound predictions
            upper_preds[i, j] = prediction[i, 0, j]
        return criterion(upper_preds, target)

        Computes the categorical cross entropy loss with the correct class having the lower bound prediction,
        and the other classes having their upper bound predictions.

        :param prediction: model predictions.
        :param target: target classes. NB not one hot.
        :return: scalar loss value
        
art/estimators/certification/interval/pytorch.py