Thanks for the explanation.
It seems you would like to create the new image by concatenating 4 images from the tensor image.
In that case image should have the shape [4, height, width] in case you would like to use 4 different images.
Currently it seems image only contains 1 image. Would you like to use the same image 4 times?
If image only contains this single image only “sometimes”, it might be due to a remaining last batch, which can be smaller depending on your batch size.
If you are using a DataLoader, you could try to set drop_last=True and try it again.