How to build a dataset using PyTorch C++ frontend

Creating a C++ dataset is similar to creating a PyTorch python dataset.

One has to subclass the Dataset class, and then implement some base methods.

See the MNIST class for example:


Alternatively, you can subclass from BatchDataset and implement a get_batch method that returns a batch of samples directly: https://github.com/pytorch/pytorch/blob/master/torch/csrc/api/include/torch/data/datasets/base.h#L40-L94