Solved by ZimoNitrome in post #3 
              
              
                I figured it out: 
h, w = 4, 10
repeats = 2

my_tensor = torch.randint(0, 10, [h, w])
print("my_tensor:", my_tensor)

repeated_1 = my_tensor.repeat_interleave(repeats , -2)
print("repeated_1:", repeated_1)

repeated_2 = my_tensor.view(h, 1, w).expand(h, repeats, w).contiguous().view(-1, w)
print("re…