outputs is empty in loss.backward() because that expression doesn’t return the gradients. The gradients are accumulated into the .grad attribute of variables. (Look in accumulate_grad.cpp 2 instead).
outputs will contain Tensors if you use torch.autograd.grad(loss, <inputs>).