At the risk of being blunt: Using  .data has been a bad idea for more than half a year 13.
When you try to assign .weight and .bias, PyTorch will tell you exactly what to do, i.e. have a nn.Parameter to assign (I know, because I tried with a tensor before that):
l = torch.nn.Linear(5, 4)
x = torch.randn(1, 5)
y = l(x).pow(2).mean()
y.backward()

l.weight = torch.nn.Parameter(torch.randn(3, 5))
l.bias = torch.nn.Parameter(torch.randn(3))
z = l(x).pow(2).mean()
print(z)
z.backward()

Best regard and stay clear of .data
Thomas