Dont know if this would be much help but you may probably be able to find it here

  
      
      GitHub
  
  
    

pytorch/pytorch 52

Tensors and Dynamic neural networks in Python  with strong GPU acceleration - pytorch/pytorch


  
  
    
    
  
  


Read the documentation to build from source once you have made your changes.