torch.max returns the max values and their corresponding indices.
I’m not sure if that was really the issue or if your current setup is just instable, i.e. if I set the learning rate to 1e-4 the model converges better.