mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Initial documentation for building libtorch (#10087)
Summary: It's not a particularly pretty process right now, but it may as well be documented. I'm not aware of an ideal location for this, so I'm just dropping it in the docs/ folder for now as recommended by soumith Pull Request resolved: https://github.com/pytorch/pytorch/pull/10087 Differential Revision: D9119681 Pulled By: anderspapitto fbshipit-source-id: cd4afb642f3778c888d66a501bc697d0b0c88388
This commit is contained in:
committed by
Facebook Github Bot
parent
ee964c51f4
commit
a2a7b0c01a
19
docs/libtorch.rst
Normal file
19
docs/libtorch.rst
Normal file
@ -0,0 +1,19 @@
|
||||
libtorch (C++-only)
|
||||
===================
|
||||
|
||||
The core of pytorch can be built and used without Python. A
|
||||
CMake-based build system compiles the C++ source code into a shared
|
||||
object, libtorch.so.
|
||||
|
||||
Building libtorch
|
||||
-----------------
|
||||
|
||||
There is a script which wraps the CMake build. Invoke it with
|
||||
|
||||
::
|
||||
cd pytorch
|
||||
BUILD_TORCH=ON ONNX_NAMESPACE=onnx_torch bash tools/build_pytorch_libs.sh --use-nnpack caffe2
|
||||
ls torch/lib/tmp_install # output is produced here
|
||||
ls torch/lib/tmp_install/lib/libtorch.so # of particular interest
|
||||
|
||||
Future work will simplify this further.
|
Reference in New Issue
Block a user