Skip to main content

WeightSource

Trait WeightSource 

Source
pub trait WeightSource {
    // Required method
    fn take(
        &mut self,
        key: &str,
        transpose: bool,
    ) -> Result<(Vec<f32>, Vec<usize>)>;

    // Provided method
    fn has(&self, key: &str) -> bool { ... }
}
Expand description

Abstract weight source for block emission. Keeps rlx-flow independent of safetensors / GGUF file formats.

Required Methods§

Source

fn take(&mut self, key: &str, transpose: bool) -> Result<(Vec<f32>, Vec<usize>)>

Provided Methods§

Source

fn has(&self, key: &str) -> bool

Optional probe for arch-specific key layout detection.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T: WeightSource + ?Sized> WeightSource for &mut T

Source§

fn take(&mut self, key: &str, transpose: bool) -> Result<(Vec<f32>, Vec<usize>)>

Implementors§