Hi,
The Tensors are not linked to the internal part of the graph.
Only the final output has a .grad_fn attribute that contains the backward of the Function that created this Tensor.
Then there is a full graph a backwardFunction that represent how the backward pass should be computed. Where each Function points to the next one(s) to call when doing the backward pass. These functions can, depending on their needs, save some Tensors but the Tensors never have a reference to all the Functions that use them.
I hope this is clear, don’t hesitate to ask more questions if it is not.