Right.
You should never use .data. It is both breaking the graph and unsafe.
Max is a differentiable function where the gradient just flows back to the maximum value and all the other entries get 0.
Argmax on the other hand is not differentiable as it return integer values. For which you can’t get gradients.