The colab book runs on gpu but I am unsure on how to check that the testing dataset is running on colab
predlist=torch.zeros(0,dtype=torch.long, device='cpu')

    lbllist=torch.zeros(0,dtype=torch.long, device='cpu')

    with torch.no_grad():

        model.eval()

        i=0

        for test_batch_data,test_batch_labels in allTheDataloaders["Testing"]:


            test_batch_data, test_batch_labels = test_batch_data.to(device), test_batch_labels.to(device)

            y_test_pred=model(test_batch_data)

            y_scores, y_pred_targets = torch.max(y_test_pred, dim = 1)



  

            predlist=torch.cat([predlist,y_pred_targets.view(-1).cpu()])

            lbllist=torch.cat([lbllist,test_batch_labels.view(-1).cpu()])

 
  

    #https://www.kaggle.com/agungor2/various-confusion-matrix-plots

    print(classification_report(lbllist.numpy(), predlist.numpy()))

    data=confusion_matrix(lbllist.numpy(), predlist.numpy())

    data_cm=pd.DataFrame(data, columns=np.unique(lbllist.numpy()), index = np.unique(lbllist.numpy()))

    data_cm.index.name = 'Actual'

    data_cm.columns.name = 'Predicted'

    plt.figure(figsize = (10,7))

    sn.set(font_scale=1.4)#for label size

    sn.heatmap(data_cm, cmap="Blues", annot=True,annot_kws={"size": 16},fmt=".1f")

it only takes long for a specific dataset.