Did you figure out a way to do it?  I filed a feature request for this issue:

  
      github.com/pytorch/pytorch
  
  
    
  
	  
  

  
    
      Add ability to determine libtorch version from a c++ API or preprocessor macro. 185
    

    
      
        opened 
        
          
        
        Sep 9, 2020
      
      


      
        
          
          bigcmos
        
      
    
  



  🚀 Feature
I want to be able to determine the version of libtorch in my c++ binary in cases where I don't...