Thank you for your answer. I find the doc a bit confusing then. From the doc:

To stop a tensor from tracking history, you can call  .detach()  to detach it from the computation history, and to prevent future computation from being tracked.

.detach() just detach the gradient from the graph and all the futur operations will not be tracked.
But your answer seems to say that it does stop tracking, as the doc says, AND  delete the last operation from the graph (here the softmax operation). Could you please clarify ?