The torch.utils.data.Dataloader class should do the trick.
https://pytorch.org/docs/stable/data.html#torch.utils.data.DataLoader 35
Following blog could be useful : https://stanford.edu/~shervine/blog/pytorch-how-to-generate-data-parallel 29