Here is my user case:
A: tensor([[0,0,1,1,2,3],[5,6,7,8,9,3]]), # an input tensor
B: tensor([2,0]), # an indexing tensor
is there an efficient way to get the resulting tensor as:
O: tensor([[2,0,0], [9,5,6]]).
That is, B values match with A[0] entries, then indexing along columns. Note that B may be pre-sorted in ascending order (if make the operation simpler) such that the resulting tensor will be
O: tensor([[0,0,2],[5,6,9]]).
Thank you