Let’s say I have a 2d tensor A
A = [[0,1,2],
     [3,4,5],
     [6,7,8]]

I want to copy each row 10 times and stack them, which will then give me a 3d tensor. So I will have 3 x 3 x 10 tensor.
How can I do this?
I know that a vector can be expanded by using expand_as, but how do I expand a 2d tensor?
Moreover, I want to reshape a 3d tensor.
So for example, 2 x 3 x 4 tensor to 3 x 2 x 4.
How can I do this?