Could you please provide a minimal example that shows this? I’ve tried the following to test:
x = Variable(torch.zeros(1), requires_grad=True)
out = x * 3
out.backward()
x.grad  # prints 3

but it isn’t as complex of an example as what you have in mind.