How to load csv file into a PyTorch datasets

Sorry that I am still a tiro in Pytorch, and so may raise a naive question: now I managed to collect a great deal of application data in a csv file, but got no idea on how to load the .csv file into a PyTorch “datasets”.

Alternatively, can I bypass the PyTorch datasets but instead use the PyTorch DataLoader() class to load those CSV data directly?

Thanks a lot for any help!

You could write a custom Dataset and load the data there as described in this tutorial.

Feel free to checkout my notebook.
You’ll learn how to load any type of data stored in csv files using and
It also includes the new TorchData (DataPipes) functionality in case you are interested.