Hi,
No such function exist at the moment.
I guess you could traverse the graph using d.grad_fn and.next_functions, finding all the AccumulateGrad Functions and getting their .variable attribute. This would give you all the tensors in which gradients will be accumulated (possibly 0 valued) if you call backward on d.
Why do you need such function? Why don’t you already know which tensors are used in your computations?