Hi @albanD !
Actually I’m not familar Torch C++ code. So, I understand std::move  but not rebase_history, jit::tracer, SavedVariable, setTracingState. Also, It is not clear why there should be no ThresholdBackward before ThresholdBackwardBackward, because I don’t know how backward pass should be accomplished. That’s why I asked links for detailed description of backward pass.
I think, your comments will be very usefull for people who are deep in Torch code, but not for regular users.
I trust you fixed it . And also I understand that I can use inplace=False to get the correct code with slight additional memory usage. Thank you!