The first argument to a DataLoader is a dataset.
In your current code snippet you are already working with a custom Dataset and you can adapt it as needed. My suggestion was to pass all folders into AutoEncoderDataset and to load all directories into a single list.