Struct candle_core::safetensors::BufferedSafetensors
source · pub struct BufferedSafetensors { /* private fields */ }
Implementations§
source§impl BufferedSafetensors
impl BufferedSafetensors
sourcepub fn new(buffer: Vec<u8>) -> Result<Self>
pub fn new(buffer: Vec<u8>) -> Result<Self>
Creates a wrapper around a binary buffer and deserialize the safetensors header.
pub fn load(&self, name: &str, dev: &Device) -> Result<Tensor>
pub fn tensors(&self) -> Vec<(String, TensorView<'_>)>
pub fn get(&self, name: &str) -> Result<TensorView<'_>>
Auto Trait Implementations§
impl Freeze for BufferedSafetensors
impl RefUnwindSafe for BufferedSafetensors
impl Send for BufferedSafetensors
impl Sync for BufferedSafetensors
impl Unpin for BufferedSafetensors
impl UnwindSafe for BufferedSafetensors
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