pub struct SafetensorFile { /* private fields */ }Implementations§
Source§impl SafetensorFile
impl SafetensorFile
pub fn open(path: &Path) -> Result<Self>
pub fn path(&self) -> &Path
pub fn data_start(&self) -> u64
pub fn tensors(&self) -> &BTreeMap<String, SafetensorTensorInfo>
pub fn stream_tensor<W: Write>( &self, name: &str, writer: &mut W, buffer_size: usize, ) -> Result<u64>
pub fn stream_tensor_chunks<F>( &self, name: &str, buffer_size: usize, on_chunk: F, ) -> Result<u64>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SafetensorFile
impl RefUnwindSafe for SafetensorFile
impl Send for SafetensorFile
impl Sync for SafetensorFile
impl Unpin for SafetensorFile
impl UnsafeUnpin for SafetensorFile
impl UnwindSafe for SafetensorFile
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