I do not understand the purpose of the following line of code:
external_grad = torch.tensor([1., 1.]) Q.backward(gradient=external_grad)
Here