How to index a tensor with two longTensor?

somthing equivalent to the following numpy code.

import numpy as np
data = np.random.rand(4,5,6)
first = np.array([0,1,2])
second = np.array([2,3,1])

res = data[first, second]


this is not yet possible, but we are working on Advanced Indexing. We will have it by release 0.2

you can follow this issue for progress:

1 Like