In Pytorch3.0, the Loss function could compute per-sample losses by setting the reduce = False. But when I backpropagate the loss, I also need to feed a Variable in the loss.backward() function. What should I feed into?
>>> loss = nn.CrossEntropyLoss(reduce=False) >>> input = autograd.Variable(torch.randn(3, 5), requires_grad=True) >>> target = autograd.Variable(torch.LongTensor(3).random_(5)) >>> output = loss(input, target) >>> output.backward(?) # what should I feed into? Any tutorial?