laurentmazare/tch-rs

Rust bindings for the C++ api of PyTorch.

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 51 minutes ago
Added to GitGenius on September 12th, 2026
Created on February 16th, 2019
Open Issues & Pull Requests: 248 (+0)
GitHub issues: Enabled
Number of forks: 456
Total Stargazers: 5,485 (+0)
Total Subscribers: 52 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 3.3 days
Mean response time: 76.7 days
90th percentile: 234.5 days
Tracked items: 57

How this project is maintained

Around half of the issues opened in the past year never receive a reply. 100% of open issues come from outside the core team, so the backlog reflects real-world use rather than internal planning. Only 2% of issues opened in the past year have been closed.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 73
New in 7 days: 0
Closed in 7 days: 1
Avg open age: 514 days
Stale 30+ days: 71
Stale 90+ days: 68

Recent activity

Opened in 7 days: 0
Closed in 7 days: 1
Comments in 7 days: 0
Events in 7 days: 0

Top labels

No label distribution available yet.

Most active issues this week

Detailed Description

tch-rs is a Rust bindings library for PyTorch's C++ API.

The library solves the problem of using PyTorch from Rust by providing thin wrappers around libtorch, the C++ implementation of PyTorch. Rather than creating idiomatic Rust abstractions, the project deliberately stays close to the original C++ API, allowing more ergonomic Rust bindings to be built on top if needed. This approach means developers work with familiar PyTorch concepts while accessing them through Rust.

Developers should choose this library if they need to integrate PyTorch into Rust applications and prefer direct access to the C++ API surface. It suits projects that require deep learning capabilities in Rust without the overhead of language translation layers. The library requires libtorch to be available on the system, which can be obtained through a system-wide installation, manual setup, a Python PyTorch installation, or automatic download via the download-libtorch feature. On Windows, the MSVC Rust toolchain is recommended over MinGW due to PyTorch compatibility issues, and debug and release builds are not ABI-compatible, requiring careful version matching.

The project maintains active engagement with its codebase through regular updates and refinements. The maintainer responds to issues and pull requests, indicating ongoing stewardship of the library. Documentation is available on docs.rs and includes practical examples demonstrating tensor operations and model training. The project includes examples covering basic tensor operations and gradient descent training, providing starting points for new users.