Hi
It would be enough to define your original torch.utils.data.DataSet subclass to handle 8 folders simultaneously. I write down one naive not complete example below.
Let the folder structure be
- train
    - folder_1
    - ...
    - folder_8

In the above setting, you can list all the image files in each folder by os.listdir('train/folder_1).
Also you can override torch.utils.data.DataSet class as below and pass your dataset instance to DataLoader setting batch_size=3
import os
from torch.utils.data import DataSet

class ImageDataSet(DataSet):

    def __init__(self, root='train', image_loader=None, transform=None):
        self.root = root
        self.image_files = [os.listdir(os.path.join(self.root, 'folder_{}'.format(i)) for i in range(1, 9)]
        self.loader = image_loader
        self.transform = transform
    def __len__(self):
        # Here, we need to return the number of samples in this dataset.
        return sum([len(folder) for folder in self.image_files])

    def __getitem__(self, index):
        images = [self.loader(os.path.join(root, 'folder_{}'.format(i), self.image_files[i][index])) for i in range(1, 9)]
        if self.transform is not None:
            images = [self.transform(img) for img in images]
        return images