I am very grateful for your reply sir.
I was using the default setting. After your suggestion, I went and read the documentation. However, I still can not figure it out.
when I set reduction=‘sum’, the loss is ‘Nan’
when I set reduction=‘none’, it gives the following error ‘RuntimeError: grad can be implicitly created only for scalar outputs’
I have searched online, but could not find any suitable solutions
As for the printing, removing ‘tqdm’ call solved the problem. However, is there any way by which I could print the loss after a certain number of batches?
Thank you for your time and guidance