I am not entirely sure if this is a bug or is intended behavior, but I found that if you try to do
a = torch.Tensor([1,2,3]).long() a[1:] = a[:-1] a
the output is:
tensor([1, 1, 1])
whereas if you use numpy, say
a = np.array([1,2,3]) a[1:] = a[:-1] a
array([1, 1, 2])
Is this intended behavior?