Skip to main content

WeightSource

Trait WeightSource 

Source
pub trait WeightSource {
    // Required method
    fn weights(self) -> Result<Vec<(String, Array)>>;
}
Expand description

Where crate::Module::load_weights reads named weights from: a safetensors file (a path), or named arrays (Vec<(String, Array)>, a HashMap or BTreeMap).

Required Methods§

Source

fn weights(self) -> Result<Vec<(String, Array)>>

The named weights.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl WeightSource for &Path

Source§

impl WeightSource for &PathBuf

Source§

impl WeightSource for &str

Source§

impl WeightSource for BTreeMap<String, Array>

Source§

impl WeightSource for PathBuf

Source§

impl WeightSource for String

Source§

impl WeightSource for Vec<(String, Array)>

Source§

impl<S> WeightSource for HashMap<String, Array, S>

Source§

impl<const N: usize> WeightSource for [(String, Array); N]

Implementors§