Hi folks,
I wrote a C++/CUDA extension to produce a gradient tensor, e.g. dLdX, where L is the loss and X is a tensor. When I call X.backward(dLdX), the memory dLdX occupies (allocated in C++) will not get recycled. My question is: how can I tell the computational graph to recycle dLdX once it is no longer needed during the execution of X.backward(dLdX).
Thanks!