def batch_accuracy(pred, gt):
    """ Compute the accuracies for a batch of predictions and answers """
    pred = pred.detach().argmax(1)
    correctness = (pred == gt)
    return correctness.float()