We don’t have a cross_entropy_loss per se, but as @ptrblck mentioned, nn.CrossEntropyLoss()(input, target) is the same as cross_entropy(input, target), which per https://github.com/pytorch/pytorch/blob/master/torch/nn/functional.py#L1671 43 is the same as nll_loss(log_softmax(input, 1), target), so your code in C++ would be something like
auto input = torch::randn({3, 5}, torch::requires_grad(true));
auto target = torch::empty(3, torch::kLong).random_(5);
auto output = torch::nll_loss(torch::log_softmax(input, /*dim=*/1), target)
output.backward()

Can you try that?