Use subset of dataset in c++ frontend

I am using MNIST in the c++ frontend, and I want to use a reduced version of it. However, the c++ frontend does not appear to have torch.utils.data.Subset or RandomizedSubsetSampler, how would I do it then?

I am using the MNIST example from examples/cpp/mnist/mnist.cpp at main · pytorch/examples · GitHub

Thanks!