    def _build_dataloader(self):
        """Build dataloader which merges a series of datasets."""
        # Build dataset instance for each dataset and combine them by ConcatDataset
        Dataset, Collator = self._build_dataset()

        # Build train set
        train_dataset = Dataset(self.cfg, self.cfg.dataset, is_valid=False)
        train_collate = Collator(self.cfg)
        sampler = torch.utils.data.distributed.DistributedSampler(
            train_dataset,
            num_replicas=self.accelerator.num_processes,
            rank=self.accelerator.local_process_index,
            shuffle=True,
            seed=self.cfg.train.random_seed,
        )
        train_loader = DataLoader(
            train_dataset,
            batch_size=self.cfg.train.batch_size,
            collate_fn=train_collate,
            sampler=sampler,
            num_workers=self.cfg.train.dataloader.num_worker,
            pin_memory=self.cfg.train.dataloader.pin_memory,
        )
        return train_loader, None
Build dataloader which merges a series of datasets.
models/codec/codec_trainer.py