As is clear with the torch.no_grad(). setting the value in the net is not a differentiable operation and w1 is not the same as net.body[0].weight.  (you previous code was breaking this as well but in a more subtle manner by using .data).
I am afraid you cannot assign these in a differentiable manner. You can set them before and use these to compute the output though if you want the gradient wrt to these paramters to be computed.