If you are worried about breaking the computation graph, you could add debug print statements in the code and check all tensors for a valid .grad_fn.
If you’ve accidentally detached a tensor, its grad_fn will be empty, otherwise it will show the backward version of the last operation.