{"repo":"LaurentMazare/tch-rs","free":true,"listed":false,"github":"https://github.com/LaurentMazare/tch-rs","clone":"git clone https://github.com/LaurentMazare/tch-rs.git","description":"Rust bindings for the C++ api of PyTorch.","language":"Rust","stars":5474,"topics":["pytorch","rust","machine-learning","neural-network","deep-learning"],"license":"Apache-2.0","category":"machine-learning","readme_excerpt":"tch-rs Rust bindings for the C++ api of PyTorch. The goal of the tch crate is to provide some thin wrappers around the C++ PyTorch api (a.k.a. libtorch). It aims at staying as close as possible to the original C++ api. More idiomatic rust bindings could then be developed on top of this. The documentation can be found on docs.rs. changelog The code generation part for the C api on top of libtorch comes from ocaml-torch. Getting Started This crate requires the C++ PyTorch library (libtorch) in version v2.11.0 to be available on your system. You can either: - Use the system-wide libtorch installation (default). - Install libtorch manually and let the build script know about it via the LIBTORCH environment variable. - Use a Python PyTorch install, to do this set LIBTORCH USE PYTORCH=1 . - When a system-wide libtorch can't be found and LIBTORCH is not set, the build script can download a pre-built binary version of libtorch by using the download-libtorch feature. By default a CPU version is used. The TORCH CUDA VERSION environment variable can be set to cu117 in order to get a pre-built binary using CUDA 11.7. System-wide Libtorch On linux platforms, the build script will look for a system-wide libtorch library in /usr/lib/libtorch.so . Python PyTorch Install If the LIBTORCH USE PYTORCH environment variable is set, the active python interpreter is called to retrieve information about the torch python package. This version is then linked against. Libtorch Manual Install - Get libto","default_branch":null,"files":null,"tree":[],"storefront":"/r/LaurentMazare","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/LaurentMazare/tch-rs/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}