They are defined in the generated file torch/csrc/autograd/generated/Functions.cpp. That file is generated from tools/autograd/derivatives.yaml 1 using the Python files in the tools/autograd 1 directory.