Solved by ptrblck in post #4 
              
              
                Since all images have the same shape, the torch.stack call should work: 
list_of_images = [torch.randn(3, 128, 128) for _ in range(10)]
x = torch.stack(list_of_images, 0)
print(x.shape)
> torch.Size([10, 3, 128, 128])

Also, a Dataset with equal shapes works fine: 
class PandaDataset(Dataset):
    d…