Hi,
When you call t.backward(), if t is not a tensor with a single element, it will actually complain and ask the user to provide the first grad_output (as a Tensor of the same size as t).
In the particular case where t has a single element, grad_output defaults to torch.Tensor([1]) because that way what is computed are gradients.
Does that answer your question?