pub enum LoadedWeights {
Loader {
path: PathBuf,
format_id: &'static str,
loader: Box<dyn WeightLoader>,
},
Map {
path: PathBuf,
format_id: &'static str,
map: WeightMap,
packed: Vec<(String, Vec<u8>, QuantScheme, Vec<usize>)>,
},
}Expand description
Result of resolving and opening weights.
Variants§
Loader
Live loader (supports packed take, MTP, mmap borrow).
Map
Drained map (F32 tensors + optional packed sidecar).
Implementations§
Source§impl LoadedWeights
impl LoadedWeights
Sourcepub fn as_loader_mut(&mut self) -> Option<&mut dyn WeightLoader>
pub fn as_loader_mut(&mut self) -> Option<&mut dyn WeightLoader>
Live loader, if this load used into_map: false.
Sourcepub fn packed_tensors(
&self,
) -> Option<&[(String, Vec<u8>, QuantScheme, Vec<usize>)]>
pub fn packed_tensors( &self, ) -> Option<&[(String, Vec<u8>, QuantScheme, Vec<usize>)]>
Packed K-quant tensors when returned as LoadedWeights::Map.
pub fn path(&self) -> &Path
pub fn format_id(&self) -> &'static str
pub fn into_map(self) -> Result<WeightMap, Error>
Auto Trait Implementations§
impl !RefUnwindSafe for LoadedWeights
impl !Sync for LoadedWeights
impl !UnwindSafe for LoadedWeights
impl Freeze for LoadedWeights
impl Send for LoadedWeights
impl Unpin for LoadedWeights
impl UnsafeUnpin for LoadedWeights
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more