Perhaps you can look into these:

  
      pytorch.org
  
  
    

Custom C++ and CUDA Extensions — PyTorch Tutorials 1.7.0 documentation 3



  
  
    
    
  
  



  
      
      github.com
  
  
    

pytorch/extension-cpp


  C++ extensions in PyTorch. Contribute to pytorch/extension-cpp development by creating an account on GitHub.