Let w and phi be two parameters
w = Parameter(T.tensor([2.2]))
phi = Parameter(T.tensor([1.5]))
wp = w*phi
wp.backward()
grd = phi.grad
print(grd)

Printed:
tensor([2.2000])

I want:
tensor([2.2000], requires_grad=True)

i.e. I want phi.grad as w which is a parameter of larger network, should have requires_grad=True so I can do
grd.backward()
w.grad

I don’t know how to seperate these two computaion graph.