Nah i was referring to the train function
def train(dataloader, model, loss_fn):
In the function you have used train_loader (for data, target in train_loader) it should be (for data, target in train_loader).
This wont make a difference if you run on the same kernel