The naming of grad_variables might be a little bit confusing. In the context of neural networks, it’s the “loss”.

I am a bit confused by this. In this example, isn’t that the “loss” is y?
torch.FloatTensor([[1, 0]])  is passed to grad_variables and specifies that we’ll use the first column of y’s gradients, and torch.FloatTensor([[0, 1]]) for the second column.
By default, grad_variables is torch.Tensor([1]) which means we will just keep calculated gradients.
Is that correct?
Thanks a lot!