You might want to read about the background. Personally I don’t think we would do the same these days with JIT .code giving slice, but what do I know. Here and in the PR that is linked is the thing:

  
      github.com/pytorch/pytorch
  
  
    
  
    
  

  
    
      Add docstring for `torch.slice` 18
    

    
      pytorch:master ← sethah:slice_doc
    

    
      
        opened 
        
          
        
        May 29, 2018
      
      

      
        
          
          sethah
        
      

      
        
          +50
          -0
        
      
    

  


  
  
    
    
  
  


In the meantime, you can just call the JIT op (torch.ops.aten.slice(tensor, dim, start, stop, step))
Best regards
Thomas