pub struct GgufWeights { /* private fields */ }Expand description
All F32-decoded tensors of one GGUF file, keyed by tensor name.
Implementations§
Source§impl GgufWeights
impl GgufWeights
Sourcepub fn meta_u32(&self, key: &str) -> Option<u32>
pub fn meta_u32(&self, key: &str) -> Option<u32>
U32 metadata value (accepts u32/u64/i32/i64 spellings).
Sourcepub fn load_weight_2d(
&self,
name: &str,
expected_d_out: usize,
) -> Result<Tensor<2>>
pub fn load_weight_2d( &self, name: &str, expected_d_out: usize, ) -> Result<Tensor<2>>
Load a 2D weight with the load_weight transpose guard: PyTorch stores
(d_out, d_in); if the file holds it transposed (the Q8_0 transpose
trick some converters apply), flip it back.
Auto Trait Implementations§
impl Freeze for GgufWeights
impl RefUnwindSafe for GgufWeights
impl Send for GgufWeights
impl Sync for GgufWeights
impl Unpin for GgufWeights
impl UnsafeUnpin for GgufWeights
impl UnwindSafe for GgufWeights
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