@elanmart His code for me perfectly.
My situation is this, I want to copy 128 times along a dimension:

x=torch.randn(100, 1, 32, 32)
print(x.shape)

you can get [100, 1, 32, 32]

x_hat = x.repeat(1,128,32,32)
print(x_hat)

then you can get [100, 128, 32, 32]. And you can also print out the inside value:

print(x[0,0,:20, :20])
print(x_hat[0,33,:20,:20])