
def accuracy(output, target):
    batch_size = target.size(0)

    _, pred = output.topk(k = 1, dim = 1)
    pred = pred.t()
    correct = pred.eq(target).sum()
    
    res = correct.mul(100.0 / batch_size)

    return res
