Hi, thanks for your reply. I still don’t get what do you mean by “not trace this operation”. I tried to create a simple network with only 2 parameters, w1 and w2. The middle layer is given by y1=w1x, and the output layer is given by y2 = w2y1. Now if I simply do
y1 = w1x
temp = torch.tensor([1.0, 2.0])
y1.data = temp.data

The backward gradient seems getting calculated properly. How and in which cases do .data cause problems?