Try this:

  
      github.com/pytorch/pytorch
  
  
    
  
	  
  

  
    
      Easy way to switch between CPU and cuda  2
    

    
      
        opened 
        
          
        
        May 27, 2017
      
      

        
          closed 
        
          
        
        Apr 24, 2018
      
        

      
        
          
          chsasank
        
      
    
  



  Right now, as far as I know there is no one simple way to write code which runs seamlessly both on...



    triage review