Solved by ptrblck in post #2 
              
              
                Yes, from the docs: 

Returns a new view of the self tensor with singleton dimensions expanded to a larger size. 
[…] 
Any dimension of size 1 can be expanded to an arbitrary value without allocating new memory. 

You could use x.repeat(2, 1) for your use case. Note that this operation would alloca…