def accuracy(preds, y):
    """
    Returns accuracy per batch, i.e. if you get 8/10 right, this returns 0.8, NOT 8
    """
    pred_t = preds.argmax(dim=1, keepdim=True)
    return  pred_t.eq(y.view_as(pred_t)).float().mean()