Reader

Trait Reader 

Source
pub trait Reader {
    // Required methods
    fn names(&self) -> Vec<&str>;
    fn contains(&self, name: &str) -> bool;
    fn shape(&self, name: &str) -> Result<Vec<usize>, SafeTensorError>;
    fn tensor(&self, name: &str) -> Result<ReaderTensor<'_>, SafeTensorError>;
}
Expand description

Interface accessing a safetensors data blob.

Required Methods§

Source

fn names(&self) -> Vec<&str>

Source

fn contains(&self, name: &str) -> bool

Source

fn shape(&self, name: &str) -> Result<Vec<usize>, SafeTensorError>

Source

fn tensor(&self, name: &str) -> Result<ReaderTensor<'_>, SafeTensorError>

Implementations on Foreign Types§

Source§

impl Reader for SafeTensors<'_>

Source§

fn names(&self) -> Vec<&str>

Source§

fn contains(&self, name: &str) -> bool

Source§

fn shape(&self, name: &str) -> Result<Vec<usize>, SafeTensorError>

Source§

fn tensor(&self, name: &str) -> Result<ReaderTensor<'_>, SafeTensorError>

Implementors§