Thanks. But there is no fundamental reason why it could not accept a range, right?
I opened a feature request issue:

  
      github.com/pytorch/pytorch
  
  
    
  
	  
  

  
    
      Allow range in dim argument of reducing operations such as sum 10
    

    
      
        opened 
        
          
        
        Jan 16, 2020
      
      


      
        
          
          cossio
        
      
    
  



  I am trying to sum a tensor over its first n axes, where n is a parameter I don’t know in...