Solved by ptab in post #3 
              
              
                Your solution should read 
T = torch.cat([T[0:i], T[i+1:]]) 
or equivalently 
T = torch.cat([T[:i], T[i+1:]]) 
(but there is probably a better way to do this)