The LSTM class is implemented in C so it is hard to find and harder to customise. The LSTMCell 227 class is implemented in python here 568, and the actual details of the calculation are implemented in python here 483.
Those links are for PyTorch v0.3.0. I assume you know how to find the corresponding master branch should you need to.