Thanks LeviViana
Nice solution
I also found a bit different approach here:

  
      stackoverflow.com
  
  
      
    
  

  Filling torch tensor with zeros after certain index 96



  python, nlp, pytorch



  
  answered by
  
    Shai
  
  on 05:07AM - 19 Aug 19 UTC