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(), lr=lr)
examples = next(iter(train_loader))
example_data = examples[‘img’]
example_label = examples[‘label’]
img_grid = torchvision.utils.make_grid(example_data)
writer.add_image(‘Coivid Img’,img_grid)
example_data.to(device)
writer.add_graph(model,example_data)
Change them to
model = model.to(device)
example_data = example_data.to(device)