Based on your description you could probably use:
if (prediction == label).any():
    nb_correct += 1

to calculate the number of correct samples and the accuracy by dividing it by the number of samples.