import torch


def accuracy(y_pred, y_true):
    """ Computes the accuracy between 2 class tensors
    """
    y_pred = torch.round(y_pred)
    y_true = torch.round(y_true)
    right = (y_pred == y_true)
    return (torch.sum(right) / len(right)).item()