I have a batch data:
tensor A :
[[[66.,  0.,  0.],
  [77.,  0.,  0.],
  [54.,  0.,  0.],
  [33.,  0.,  0.]],

 [[74.,  0.,  0.],
  [31.,  0.,  0.],
  [43.,  0.,  0.],
  [53.,  0.,  0.]]]

I have a index
tensor B:
[[ 0,  2],
 [ 1,  3]]

How do I extract 0, 2 lines from first sample, and 1, 3 from the second sample to get:
[[[66.,  0.,  0.],
  [54.,  0.,  0.]],

 [[31.,  0.,  0.]
  [53.,  0.,  0.]]]