pub struct AprV2Reader { /* private fields */ }Expand description
APR v2 format reader (owns data - copies input)
Implementations§
Source§impl AprV2Reader
impl AprV2Reader
Sourcepub fn from_bytes(data: &[u8]) -> Result<Self, V2FormatError>
pub fn from_bytes(data: &[u8]) -> Result<Self, V2FormatError>
Sourcepub fn from_reader<R: Read>(reader: &mut R) -> Result<Self, V2FormatError>
pub fn from_reader<R: Read>(reader: &mut R) -> Result<Self, V2FormatError>
Sourcepub fn header(&self) -> &AprV2Header
pub fn header(&self) -> &AprV2Header
Get header
Sourcepub fn metadata(&self) -> &AprV2Metadata
pub fn metadata(&self) -> &AprV2Metadata
Get metadata
Sourcepub fn tensor_names(&self) -> Vec<&str>
pub fn tensor_names(&self) -> Vec<&str>
Get tensor names
Sourcepub fn get_tensor(&self, name: &str) -> Option<&TensorIndexEntry>
pub fn get_tensor(&self, name: &str) -> Option<&TensorIndexEntry>
Get tensor by name
Sourcepub fn get_tensor_data(&self, name: &str) -> Option<&[u8]>
pub fn get_tensor_data(&self, name: &str) -> Option<&[u8]>
Get tensor data by name
Sourcepub fn get_f32_tensor(&self, name: &str) -> Option<Vec<f32>>
pub fn get_f32_tensor(&self, name: &str) -> Option<Vec<f32>>
Get tensor as f32 slice (F32 dtype only)
Sourcepub fn verify_alignment(&self) -> bool
pub fn verify_alignment(&self) -> bool
Check if all tensors are 64-byte aligned
Sourcepub fn tensor_index(&self) -> &[TensorIndexEntry]
pub fn tensor_index(&self) -> &[TensorIndexEntry]
Borrow the parsed tensor index (used by the core dequant extension).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AprV2Reader
impl RefUnwindSafe for AprV2Reader
impl Send for AprV2Reader
impl Sync for AprV2Reader
impl Unpin for AprV2Reader
impl UnsafeUnpin for AprV2Reader
impl UnwindSafe for AprV2Reader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more