Hi,
This is slightly convoluted in the sense that it used macro to generate all types easily. Here is how it works:
The definition of the class is here 17 and is used with macro to generate all tensors types.
For Cuda types, this is generated from here 5.
This line is interpreted specially by this 4 build script that replaces it for Cuda Float type:
#define THC_GENERIC_FILE torch/csrc/generic/Tensor.cpp
#include THC/THCGenerateFloatType.h

This include file is present here 4 and is reponsible to set up all the proper macros such that the original generic file is properly interpreted for this lib and type.
If you want a better understanding on how these macro work in the TH/THC libraries and how they are used to generate all type, you can look at this 7 blogpost that describes this.