Trait TensorLoader

Source
pub trait TensorLoader<E: Error> {
    // Required methods
    fn load(&mut self, name: &str) -> Result<Tensor, E>;
    fn load_manual(&mut self, name: &str, ne: &[usize]) -> Result<Tensor, E>;
    fn finish(self) -> (Context, HashMap<String, Tensor>, Option<Mmap>);
}
Expand description

Used by models to fetch tensors from a loader.

Required Methods§

Source

fn load(&mut self, name: &str) -> Result<Tensor, E>

Gets a tensor from the loader.

Source

fn load_manual(&mut self, name: &str, ne: &[usize]) -> Result<Tensor, E>

Loads a tensor from the loader.

Source

fn finish(self) -> (Context, HashMap<String, Tensor>, Option<Mmap>)

Finish loading the model, and extract all of the state from the loader.

Implementors§