That’s interesting. I didn’t know there was a difference between torch.autograd.grad and torch.autograd.backward. It looks like the first one is functional, while the second has side-effects. Is that correct? Is there anything you would recommend to read to understand this better? I’m worried I might break something if I make a switch at this point without fully understanding everything.