Hi,
loss.grad is expected to remain None as only the gradients for leaf variables are saved in the .grad field.
These two lines
net2.weight.data = y[0][0].reshape(-1,1) # using the output from first net as parameter to second net2.bias.data = y[0][1].reshape(-1,1)    

Use .data and thus break the computational graph. Meaning that no gradients will flow back to n1.
If you want to set these weights, the right way to do this is to delete the existing parameters with del net2.weight and then set the field to the tensor that you want: net2.weight = y[0][0].reshape(-1,1).