target = torch.arange(8) target[0::2] += 1 target[1::2] -= 1