I think you misunderstood what I meant there: the code will run without crashing. But the gradients won’t flow back all the way to the original pytorch code !
Using .detach() will prevent the gradients from flowing back.