No, that’s probably error that you get if you do backward() twice.



 silvester:

This code and yours produce completely different results.


Actually, weights* nn.Parameter(torch.ones(1)) won’t train as optimizer won’t find this parameter, so there is that. Oh, and then you may get that error. What a mess