Hi,
Thanks for your answer. Does that mean that I can’t port to C++ exactly this python code?
loss = nn.CrossEntropyLoss()
input = Variable(torch.randn(3, 5), requires_grad=True) 
target = Variable(torch.LongTensor(3).random_(5)) 
output = loss(input, target)
output.backward()