Solved by tom in post #2 
              
              
                I wrote a tutorial on diving into PyTorch code a while ago, but it still is largely accurate. 
In particular rgrep sigmoid aten/ should be helpful. 
Best regards 
Thomas