That happens because the second output of torch.max() contains the respective indices.
Furthermore, you set dim=1, but your outputs only have ine element for dim 1, so the argmax always is 0. I guess, you want to change your network to have 10 output nodes to regress the probabilities for each digit?