Registry / other / tch
library0.24.0rscratesunverified

Rust bindings for the PyTorch C++ API (libtorch), enabling deep learning operations.

# Cargo.toml [dependencies] tch = "0.24.0"
INSTALL
IMPORT
SIG · TCH
T
tch
otherrustv0.24.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Tensor
use tch::Tensor;

Create a 1D tensor from a slice of floats.

use tch::Tensor; fn main() { let t = Tensor::of_slice(&[1.0, 2.0, 3.0]); println!("Tensor: {:?}", t); }
Debug
Known issues
gotchaRequires libtorch to be installed separately; the crate does not bundle it.
fix
Install libtorch via your system package manager or download from pytorch.org, and set LIBTORCH environment variable.
affects: >=0.24.0
breakingBreaking changes in libtorch versions may cause incompatibility; check the crate's version compatibility table.
fix
Match the libtorch version to the one specified in the crate's documentation (e.g., libtorch 2.x for tch 0.24.x).
affects: >=0.24.0
Upgrade
Version history
0.24.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
14 hits · last 30 days
node
8
Resources
tch — cargo add tch · libregistry