The Data loading tutorial 52 might be a good starter to familiarize yourself with the Dataset and DataLoader.
If you have already loaded all samples before, you could pass them to a TensorDataset (alternatively you could also write your own custom Dataset) and just wrap it in a DataLoader.