shrew_core/lib.rs
1//! # shrew-core
2//!
3//! Core tensor primitives, types, backend traits, and autograd for Shrew.
4//!
5//! This crate provides:
6//! - [`Tensor`] — n-dimensional array with automatic differentiation
7//! - [`Shape`] / [`Layout`] — shape, strides, and memory layout
8//! - [`DType`] — data types (F16, BF16, F32, F64, U8, U32, I64)
9//! - [`Backend`] trait — abstraction over CPU/GPU execution
10//! - [`GradStore`] — gradient storage returned by `backward()`
11// - DType: supported numeric types (f32, f64, etc.)
12// - Shape: n-dimensional shape representation
13// - Layout: shape + strides + offset for memory layout
14// - Backend trait: abstraction for compute backends (CPU, CUDA, etc.)
15// - Tensor: the fundamental n-dimensional array type
16// - Op/Backprop: computational graph for automatic differentiation (Phase 2)
17
18pub mod backend;
19pub mod backprop;
20pub mod dtype;
21pub mod dynamic_shape;
22pub mod error;
23pub mod layout;
24pub mod op;
25pub mod shape;
26pub mod tensor;
27
28pub use backend::{Backend, BackendDevice};
29pub use backprop::GradStore;
30pub use backprop::{checkpoint, checkpoint_sequential, is_checkpointing, with_checkpoint_mode};
31pub use dtype::{DType, WithDType};
32pub use dynamic_shape::{ShapeEnv, ShapeGuard, SymDim, SymbolicShape};
33pub use error::{Error, Result};
34pub use layout::Layout;
35pub use op::Op;
36pub use shape::Shape;
37pub use tensor::Tensor;