The last operation on these tensors were apparently an addition and a summation.
Have a look at this dummy code:
x = torch.randn(1, requires_grad=True) + torch.randn(1)
print(x)
y = torch.randn(2, requires_grad=True).sum()
print(y)

Both operations are valid and the grad_fn just points to the last operation performed on the tensor.
Usually you don’t have to worry about it and can just use the losses to call backward.