pub enum QuantizedWeightStorage {
FP32(Array2<f32>),
INT8(QuantizedWeight),
FP16(FP16Weights),
BF16(BF16Weights),
}Expand description
Quantized model weights storage
Variants§
FP32(Array2<f32>)
Original FP32 weights (no quantization)
INT8(QuantizedWeight)
INT8 quantized weights
FP16(FP16Weights)
FP16 weights
BF16(BF16Weights)
BF16 weights
Implementations§
Source§impl QuantizedWeightStorage
impl QuantizedWeightStorage
Sourcepub fn memory_size(&self) -> usize
pub fn memory_size(&self) -> usize
Get memory size in bytes
Sourcepub fn to_fp32(&self) -> ModelResult<Array2<f32>>
pub fn to_fp32(&self) -> ModelResult<Array2<f32>>
Convert to FP32 array for inference
Sourcepub fn storage_type(&self) -> &'static str
pub fn storage_type(&self) -> &'static str
Get weight storage type as string
Trait Implementations§
Source§impl Clone for QuantizedWeightStorage
impl Clone for QuantizedWeightStorage
Source§fn clone(&self) -> QuantizedWeightStorage
fn clone(&self) -> QuantizedWeightStorage
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 moreAuto Trait Implementations§
impl Freeze for QuantizedWeightStorage
impl RefUnwindSafe for QuantizedWeightStorage
impl Send for QuantizedWeightStorage
impl Sync for QuantizedWeightStorage
impl Unpin for QuantizedWeightStorage
impl UnwindSafe for QuantizedWeightStorage
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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