An example of MNIST handwritten number recognition for LibTorch written by pure CPP
$ git clone https://github.com/Lornatang/MNIST-LibTorch.git
$ cd MNIST-LibTorch
$ mkdir build
$ cd build
$ cmake ..
$ make
$ cd <repo>/data
$ bash download.sh
$ cd <repo>/build
$ ./train ../data
$ cd <repo>/build
$ ./test ../data
$ cd <repo>/build
$ ./detect ../data/image.png ../checkpoint/model_best.pth
Thank my parents for their great support for my work!