I’m trying to reproduce a code from chainer to PyTorch. I would like to know if there is a way to perform the chainer method unchain_backward() in PyTorch. This method deletes references between variable nodes and functions backward.
I’m not sure which references you want deleted, but if you want to make sure you’re not keeping from deallocation anything but the result you’re returning, input.detach() is right.