Could it be that you overlooked, that your batchsize is 100 not 1?
Could you give me a bit more information:



 Nil_MSh:

an “if” condition for the times that my model predicted correctly


Predicted what correctly? One out of the 100 images in your batch? All of the 100 images in your batch? All dog images out of the 100 images in your batch?



 Nil_MSh:

if(torch.equal(predicted, labels)):


By the way, this will only be True if all 100 images in your batch are correct.



 Nil_MSh:

and the image was a dog


Again, what image? One dog image of the 100 images? All dog images?