Hi,
Few things: You should not use Variable anymore. All the Tensors can require gradients now.
And if the output of a function does not have requires_grad=True it is because no input were requiring gradients. So you should make sure that the inputs you want the gradients for are set properly.
Also you should not use .data as it has many side effects that you most likely don’t want (and will lead to silently wrong gradients in some cases).
If you want to set the weights of your net you can do:
with torch.no_grad():
  net.body[0].weight.copy_(w1)
  net.body[0].bias.copy_(w1_bias)
  # etc