Where to find implementation of Cross Entropy loss function

A manual (and slow) implementation can be found here and the CPU implementation calls into cross_entropy_loss and then into nll_loss.

1 Like