def accuracy(input, targs):
    """Computes accuracy with `targs` when `input` is bs * n_classes."""
    n = targs.shape[0]
    input = input.argmax(dim=-1).view(n, -1)
    targs = targs.view(n, -1)
    return (input == targs).float().mean()
