I’m not sure, if you’ve fixed the issue or if the model is just not updated, since (as you’ve already explained) argmax would break the computation graph.
You could check the .grad attribute of all parameters of the model after the backward call and see if they are containing valid gradients.