Hi @richard, thanks for the reply.
But I don’t think this will work. PyTorch doesn’t support such operation with i being over 1-D.
I tried this, and an exception raised:
RuntimeError: invalid argument 3: Index is supposed to be a vector at /pytorch/torch/lib/TH/generic/THTensorMath.c:248

We can do [ x[index] for index in i], then stack or concatenate together, and this is exactly what I’m doing now.