I think you are hitting multiple issues.
The first one seems to be the “double indexing” which doesn’t assign the values to the original tensor.
Index new_x and the assignment should work:
new_x[idx, j] = obj_x[i]

However, even though new_x would contain values now, it seems that enumerate(..., start=idx) is not working correctly while scripting and the start value is ignored:
def fun():
    for i, idx in enumerate(torch.arange(5), start=1):
        print(i, idx)
fun()

@torch.jit.script
def fun():
    for i, idx in enumerate(torch.arange(5), start=1):
        print(i, idx)
fun()

Output:
1 tensor(0)
2 tensor(1)
3 tensor(2)
4 tensor(3)
5 tensor(4)

0 0
[ CPULongType{} ]
1 1
[ CPULongType{} ]
2 2
[ CPULongType{} ]
3 3
[ CPULongType{} ]
4 4
[ CPULongType{} ]

Would you mind creating an issue for this on GitHub?