Borrowing from my answer 56, for anyone new looking for this issue, an updated function has also been introduced in pytorch - torch.repeat_interleave()  879 to address this issue in a single operation.
So for t = torch.tensor([[1, 2, 3], [4, 4, 4]]) one can use torch.repeat_interleave(t, repeats=3, dim=0) to obtain:
tensor([[1., 2., 3.],
        [1., 2., 3.],
        [1., 2., 3.],
        [4., 4., 4.],
        [4., 4., 4.],
        [4., 4., 4.]])