Thanks for the follow-up.
Try to use tensors for the comparison and the sum operation by removing the numpy() call in:
prediction = prediction.cpu().numpy() 

Currently you are trying to compare a numpy array to a tensor, which will yield the issue, as it won’t compare elementwise:
x = torch.randn(10, 10)
pred = x.argmax(1)
target = torch.randint(0, 10, (10,))
print(pred.numpy() == target)
> False # Bool !!! 
print(pred == target)
> tensor([False, False, False, False, False, False,  True, False, False, False])