import torch


def compute_accuracy_multitask(output, target):
    """
     Calculates the classification accuracy.
    :param target: Tensor of correct labels of size [batch_size, numClasses]
    :param output: Predicted scores (logits) by the model.
            It should have the same dimensions as target
    :return: accuracy: average accuracy over the samples of the current batch for each condition
    """
    num_samples = target.size(0)
    correct_pred = target.eq(output.round().long())
    accuracy = torch.sum(correct_pred, dim=0)
    return accuracy.cpu().numpy() * (100. / num_samples)