I’m not 100% sure I understand what your example is, but I think this is what you want. Given the following:

You want to be able to “index” x with i. I think the following code should get you the desired behavior:
torch.cat([x[coord[0], coord[1]] for coord in i])

This iterates through the coordinates listed in i, pulls them out of x, and finally concatenates to make a tensor.