The problem occurs at this part of the code.
def test():
    model.eval()
    test_acc = 0.0

    for i, (images, labels) in enumerate(test_loader):
      
        if cuda_avail:
                images = torch.as_tensor(images.cuda())
                labels = torch.as_tensor(labels.cuda())

        #Predict classes using images from the test set
        outputs = model(images)
        _,prediction = torch.max(outputs.data, 1)
        prediction = prediction.cpu().numpy() 
        
        test_acc += torch.sum(prediction == labels)

TypeError: sum(): argument 'input' (position 1) must be Tensor, not bool
prediction is (numpy.ndarray) type where is somehow returned as Bool and argument expects a Tensor