An alternative way is to use torch.repeat(). So with torch.repeat(), you can specify the number of repeats for each dimension:
>>> a = torch.randn(8, 3, 224, 224)
>>> b = a.repeat(3, 1, 1, 1)
>>> b.shape
torch.Size([24, 3, 224, 224])