understanding pytorch sample code for gradient calculation

后端 未结 0 1980
南方客
南方客 2021-01-06 17:48

I do not understand the purpose of the following line of code:

external_grad = torch.tensor([1., 1.])
Q.backward(gradient=external_grad)

Here

相关标签:
回答
  • 消灭零回复
提交回复
热议问题