import torch


def accuracy(y_pred: torch.Tensor, y: torch.Tensor) -> float:
    """
    Return predictive accuracy.

    Parameters
    ---
    y_pred: torch.Tensor (BATCH, NUM_CLASS)
        Predicted values.
    y: torch.Tensor (BATCH,)
        Real class values.
    """
    return (y_pred.argmax(dim=1) == y).float().mean().item()