Numpy/Torch : Selecting elements using indices over a dimension
Given an array like below:
np.arange(12).reshape(4,3)
Out[119]: 
array([[ 0,  1,  2],
       [ 3,  4,  5],
       [ 6,  7,  8],
       [ 9, 10, 11]])

I want to select a single element from each of the rows using a list of indices [0, 2, 1, 2] to create a 4x1 array of [0, 5, 7, 11].
Is there any easy way to do this indexing. The closest I could see was the gather method in pytorch.

arr[[0,1,2,3], [0,2,1,2]]

or if you prefer np.arange(4) for the 1st indexing array.
