Prapare dataset in C++ ext

I’m try to do some machine learning with pyTorch C++. I got own datasets in .csv files, after loading them I receive eg. [N,M] 2D std::vector with N samples and M features and [N,] 1D std::vector with N labels.

My question is, what should I do to create proper dataset to use torch::data::make_data_loader method (or other) and learn my NN.

Thanks in advance!

Hi, you need subclass from torch::data::Dataset and override get() and size() functions, and provide object of this class to make_data_loader function. Take a look at my implementation