Indexing 3D Tensor with 2D Tensor

Hello.

I’m having trouble with indexing 3D Tensor with 2D Tensor

I have 3D Tensor and 2D LongTensor.

For example, I have following 3D tensor (3 x 3 x 9)
X = [ (111, 112, 113) , (121, 122, 123), (131, 132, 133) ], [ (211, 212, 213) , (221, 222, 223), (231, 232, 233) ], … [ (911, 912, 913) , (921, 922, 923), (931, 932, 933) ],

and 2D LongTensor (3x3)
Y = [ (1 2 3), (4 5 6), (7 8 9)]

and i want Index X with Y to get the following valule

Z = [ (111, 212, 313) , (421, 522, 623), (731, 832, 933) ]

how can i do this?