Solved by Shreyansh_IITB in post #4 
              
              
                I think he is referring to the bold lines below from your code. You need to assign them to some variables. 
model = basic_CNN().cuda() 
model.to(device) 
print(next(model.parameters()).is_cuda) 
modelname = ‘basic_CNN’ 
criterion = torch.nn.BCELoss() 
optimizer = torch.optim.Adam(model.parameters(),…