Skip to main content

Crate shrew_core

Crate shrew_core 

Source
Expand description

§shrew-core

Core tensor primitives, types, backend traits, and autograd for Shrew.

This crate provides:

  • Tensor — n-dimensional array with automatic differentiation
  • Shape / Layout — shape, strides, and memory layout
  • DType — data types (F16, BF16, F32, F64, U8, U32, I64)
  • Backend trait — abstraction over CPU/GPU execution
  • GradStore — gradient storage returned by backward()

Re-exports§

pub use backend::Backend;
pub use backend::BackendDevice;
pub use backprop::GradStore;
pub use backprop::checkpoint;
pub use backprop::checkpoint_sequential;
pub use backprop::is_checkpointing;
pub use backprop::with_checkpoint_mode;
pub use dtype::DType;
pub use dtype::WithDType;
pub use dynamic_shape::ShapeEnv;
pub use dynamic_shape::ShapeGuard;
pub use dynamic_shape::SymDim;
pub use dynamic_shape::SymbolicShape;
pub use error::Error;
pub use error::Result;
pub use layout::Layout;
pub use op::Op;
pub use shape::Shape;
pub use tensor::Tensor;

Modules§

backend
backprop
dtype
dynamic_shape
error
layout
op
shape
tensor

Macros§

bail
Macro for early return with a formatted error message. Usage: bail!("something went wrong: {}", detail)