These are native ATen functions, designated as nn functions (to not pollute the torch.xx namespace but have them nicely accessible from C++, too).
The specific function is defined in LegacyNNDefinitions.cpp 65 and calls the TH(Cu)NN function (living in aten/src/TH(CU)NN and automatically wrapped).
I wrote a bit about how ATen functions are put into PyTorch in my selective excursion into PyTorch internals 27 blog post. torch._C.nn wasn’t a thing then, but it certainly is much nicer than the old Python-level backend mechanism. The designation torch._C.x vs. torch._C.nn.x is done in in ATen in native_functions.yaml 44.
Best regards
Thomas