pytorch c++的编译过程
下载源码
git clone --recursive https://github.com/pytorch/pytorch
cd pytorch
安装
安装依赖项
numpy pyyaml mkl mkl-include setuptools cmake cffi typing
cd pytorch
python setup.py install
或者python setup.py build develop
卸载
pip uninstall torch
python setup.py clean
编写c++测试代码
cmake报错
Could not find a package configuration file provided by "Torch" with any of
the following names:
TorchConfig.cmake
torch-config.cmake
改为cmake -DCMAKE_PREFIX_PATH=../build/lib