Expand a tendor

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)