def get_num_correct(preds, labels):
    """
    calculates the number of correct predictions.

    Args:
        preds: the predictions tensor with shape (batch_size, num_classes)
        labels: the labels tensor with shape (batch_size, num_classes)

    Returns:
        int: sum of correct predictions across the batch
    """
    return preds.argmax(dim=1).eq(labels).sum().item()