Hi. You can visit the official documentation 3 and check the “SOURCE” implementation on the upper right corner. Visit the source code for the Pytorch’s Functional package (torch.nn.functional — PyTorch 1.9.0 documentation).