pub struct ModelWeights { /* private fields */ }Expand description
Named weight storage loaded from safetensors.
Implementations§
Source§impl ModelWeights
impl ModelWeights
pub fn load_safetensors_bytes(bytes: &[u8]) -> Result<Self, ModelError>
pub fn load_safetensors_file(path: impl AsRef<Path>) -> Result<Self, ModelError>
pub fn get(&self, name: &str) -> Result<&Tensor, ModelError>
Trait Implementations§
Source§impl Clone for ModelWeights
impl Clone for ModelWeights
Source§fn clone(&self) -> ModelWeights
fn clone(&self) -> ModelWeights
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ModelWeights
impl Debug for ModelWeights
Source§impl Default for ModelWeights
impl Default for ModelWeights
Source§fn default() -> ModelWeights
fn default() -> ModelWeights
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ModelWeights
impl RefUnwindSafe for ModelWeights
impl Send for ModelWeights
impl Sync for ModelWeights
impl Unpin for ModelWeights
impl UnsafeUnpin for ModelWeights
impl UnwindSafe for ModelWeights
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