Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Execution Engine

The execution engine in shrew-core takes an optimized graph and runs it.

Tensors & Storage

Tensors are backed by a storage enum that can hold data on different devices:

#![allow(unused)]
fn main() {
pub enum Storage {
    Cpu(Vec<f32>),
    Cuda(CudaSlice<f32>),
    // ...
}
}

Backend Dispatch

Operations are dispatched dynamically based on the tensor’s device. The Backend trait defines the interface for all supported operations (matmul, add, relu, etc.).