def classif_accuracy(labels, preds):
    """Gets the percentage of correct classified predictions.

    Parameters
    ----------
    labels : torch.tensor
        The true labels.
    preds : torch.tensor
        The prediction.

    Returns
    -------
    float
        Percentage of correct classified labels.

    """
    # care should be taken that both predictions and labels are class numbers and not one-hot vectors
    correct = labels.int().eq(preds.int()).sum()
    return (correct.float() / (len(labels))).item()