Example given by PyTorch documentation https://pytorch.org/cppdocs/frontend.html complie: cmake -DCMAKE_PREFIX_PATH=/home/yucheng/Desktop/libtorch make run: ./mnist