Hi,
When doing .backward(), if the leaf already has a .grad field, then, we try to re-use it to accumulate the new gradients.
When doing .grad(), we don’t have any API to do that because the gradients Tensor that we return is just the one that was outputed by the last backward function. And none of our backward functions can write into a  Tensor inplace. So the only thing we can do is:
def inplace_grad(out, inp, grad_out, grad_in_buffers, ...):
    grad = autograd.grad(out, inp, grad_out, ...)
    for buf, g in zip(grad_in_buffers, grad):
        buf.copy_(g)

But even with changing the core, we can’t do better than this I’m afraid