Expand a tendor

I have an origin tensor [0,1;2,3], how can I efficiently get [0,0,1,1;0,0,1,1;2,2,3,3;2,2,3,3]?

I think this post should help you:

As mentioned here How to tile a tensor? - #2 by richard, we can build wit .repeat() and .view(). For your solution: a.view(-1, 1).repeat(1,2).view(2,4).repeat(1,2).view(4,4)