Sorry, I clearly misunderstood your question,
I thought you are looking for the documentation.
I think the source code can be found here:

aten/src/ATen/native/Distributions.cpp 7
aten/src/TH/THRandom.cpp 4