oh~ there’s something wrong with my expression.  I was to consider training and validation both in Training or  under ‘model.train()’. Just validation recorded no gradient by with torch.no_grad(): while training does. I just want to log the losses of training set and validation set by evety epoch.
[Can I do that? Put them all under model.train(), or I have to put validation under model.eval()? Would that be the reason?]
And yeah, I shuffled the training set to train the model. But I think there should be no loss difference  whether I turn the shuffle of validation set on or off. After all, the net doesn’t learn about it if it doesn’t provide the gradient.