an autograd.Function (sort of, but in C++) is generated from nn.yaml and other metadata, which saves the input and passes it to the Threshold_updateGradInput function.
If you have a local source build of PyTorch, looking at the file build/aten/src/ATen/CPUFloatType.cpp would help