True, I was missing that loss = optimizer.step(closure). But I still get
Epoch: 0, Loss: 2.307893753051758
Epoch: 0, Loss: 2.3076794147491455
Epoch: 0, Loss: nan
Epoch: 0, Loss: nan
and the accuracy of 9.8%. It’s super strange that it is working for you and not for me.
And I’m using version 0.3.1.post2, so it’s up-to date.