pub struct TensorReader<R> { /* private fields */ }Expand description
Specialized reader for tensor data with format-specific handling
Implementations§
Source§impl<R: Read> TensorReader<R>
impl<R: Read> TensorReader<R>
Sourcepub fn read_tensor_data(
&mut self,
tensor_info: &TensorInfo,
) -> Result<TensorReadResult>
pub fn read_tensor_data( &mut self, tensor_info: &TensorInfo, ) -> Result<TensorReadResult>
Read tensor data with default options
Sourcepub fn read_tensor_data_with_options(
&mut self,
tensor_info: &TensorInfo,
options: &TensorReadOptions,
) -> Result<TensorReadResult>
pub fn read_tensor_data_with_options( &mut self, tensor_info: &TensorInfo, options: &TensorReadOptions, ) -> Result<TensorReadResult>
Read tensor data with custom options
Sourcepub fn read_multiple_tensors(
&mut self,
tensor_infos: &[&TensorInfo],
options: &TensorReadOptions,
) -> Result<Vec<TensorReadResult>>
pub fn read_multiple_tensors( &mut self, tensor_infos: &[&TensorInfo], options: &TensorReadOptions, ) -> Result<Vec<TensorReadResult>>
Read multiple tensors efficiently
Sourcepub fn read_tensor_chunked(
&mut self,
tensor_info: &TensorInfo,
chunk_size: usize,
callback: impl FnMut(&[u8]) -> Result<()>,
) -> Result<()>
pub fn read_tensor_chunked( &mut self, tensor_info: &TensorInfo, chunk_size: usize, callback: impl FnMut(&[u8]) -> Result<()>, ) -> Result<()>
Read tensor data in chunks for large tensors
Sourcepub fn reset_position(&mut self)
pub fn reset_position(&mut self)
Reset position counter
Sourcepub fn skip_bytes(&mut self, count: usize) -> Result<()>
pub fn skip_bytes(&mut self, count: usize) -> Result<()>
Skip bytes in the stream
Source§impl<R: Read + Seek> TensorReader<R>
impl<R: Read + Seek> TensorReader<R>
Sourcepub fn read_tensor_at_offset(
&mut self,
tensor_info: &TensorInfo,
offset: u64,
options: &TensorReadOptions,
) -> Result<TensorReadResult>
pub fn read_tensor_at_offset( &mut self, tensor_info: &TensorInfo, offset: u64, options: &TensorReadOptions, ) -> Result<TensorReadResult>
Read tensor data at a specific offset
Sourcepub fn read_tensors_by_offset(
&mut self,
tensors: &[(u64, &TensorInfo)],
options: &TensorReadOptions,
) -> Result<Vec<TensorReadResult>>
pub fn read_tensors_by_offset( &mut self, tensors: &[(u64, &TensorInfo)], options: &TensorReadOptions, ) -> Result<Vec<TensorReadResult>>
Read multiple tensors by seeking to their offsets
Trait Implementations§
Auto Trait Implementations§
impl<R> Freeze for TensorReader<R>where
R: Freeze,
impl<R> RefUnwindSafe for TensorReader<R>where
R: RefUnwindSafe,
impl<R> Send for TensorReader<R>where
R: Send,
impl<R> Sync for TensorReader<R>where
R: Sync,
impl<R> Unpin for TensorReader<R>where
R: Unpin,
impl<R> UnsafeUnpin for TensorReader<R>where
R: UnsafeUnpin,
impl<R> UnwindSafe for TensorReader<R>where
R: UnwindSafe,
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