Do you mean how to load data from a csv file?
If your data is directly stored in the csv, you could write a custom Dataset, open the file in the __init__ method, and load each sample in __getitem__.
This approach would also work, if the csv stores file paths to the samples.
Alternatively, you could also preload the data and use a TensorDataset. It depends on your use case, so a bit more information would be needed.