colesbury:

ta1) is evaluated before the assignment


But why it did not increase for the third time?
Is there some optimization in the compiler of PyTorch, e.g., doing the first Backprop and the second Forward at the same time? this is the only reason I could think of why there are the two copies