A deep learning library in Rust featuring shape-checked tensors and neural networks with compile-time safety.
dfdx is a deep learning library for Rust that prioritizes ergonomics and safety through compile-time shape checking. It provides a tensor library with GPU acceleration and a comprehensive set of neural network building blocks, enabling robust and performant machine learning development.
Rust developers building deep learning models who prioritize compile-time correctness, safety, and performance, particularly those working on projects where runtime shape errors are unacceptable.
Developers choose dfdx for its unique combination of ergonomic API, compile-time shape and type checking that prevents runtime errors, and performance through GPU acceleration with minimal unsafe code and dynamic borrow checks.
Deep learning in Rust, with shape checked tensors and neural networks
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
All tensor operations are validated at compile time, preventing runtime dimension errors and ensuring type safety, as emphasized in the design goals.
Supports high-performance computation with an optional CUDA backend for tensors up to 6 dimensions, detailed in the feature flags documentation.
Uses a flexible Module trait and tuples for sequential models, enabling clean, type-safe network definitions without Rc/RefCell overhead.
Avoids dynamic borrow checks by moving gradient tapes through computation graphs, giving precise control over recorded tensors, as explained in the implementation details.
The library is explicitly marked as pre-alpha with planned breaking releases, making it risky for production use or long-term projects.
GPU acceleration requires NVIDIA's CUDA toolkit, limiting cross-platform compatibility and adding setup complexity for non-NVIDIA systems.
As a Rust library, it lacks the extensive tooling and community support of Python frameworks, with fewer pre-trained models and third-party plugins.