Try the following:

Find the loss function in one of these two places:


https://github.com/pytorch/pytorch/blob/master/aten/src/ATen/Declarations.cwrap 5
https://github.com/pytorch/pytorch/blob/master/aten/src/ATen/native/native_functions.yaml 1

If it’s in Declarations.cwrap, it tells you what the name of the function is in C. You can grep that code under aten/src/TH or aten/src/THC if you’re looking for a CUDA function
If It’s in native_functions.yaml, you can grep the name in aten/src/ATen/native