Repeat a tensor and concat them along certain dimension

input = torch.arange(0,5)

I want to get a new tensor which is 100 times the length of input, with all the elements like [0,1,2,3,4, 0,1,2,3,4...,0,1,2,3,4]. How can I do it?

torch.cat([input]*100)

3 Likes