Based on the usage of F.log_softmax I assume you are using nn.NLLLoss as your criterion?
If so, did you pass any arguments as the reduction or are you using the default settings?
To remove the printing you might just want to remove the tqdm call.