Hi! I trained a ResNet model and I want to write an “if” condition for the times that my model predicted correctly and the image was a dog.
this is my data loader:
test_loader = torch.utils.data.DataLoader(dataset=ds,
                                          batch_size=100,
                                          shuffle=False)

And here is the part where I want to put the condition line in:
    for images, labels in test_loader:
        images = images.to(device)
        labels = labels.to(device)
        outputs = model(images)
        _, predicted = torch.max(outputs.data, 1)
        if(torch.equal(predicted, labels)):
               if (?)

how do I write the condition given the fact that both “labels” and “predicted” are tensors?