So I have a 1-d tensor T and an index i and need to remove i-th element from a tensor T, much like in pure python T.remove(i).
I’ve tried to do this:
i = 2
T = torch.tensor([1,2,3,4,5])
T = torch.cat([T[0:i], T[i+1:-1]])

But it fails to bring in the last element (5 in this case).
Any suggestions?