pub struct QuantizedBlock {
pub data: Vec<i8>,
pub scale: f32,
pub zero_point: i8,
pub block_size: usize,
pub lane: PrecisionLane,
}Expand description
Quantized block with scale factor
Fields§
§data: Vec<i8>Quantized data
scale: f32Scale factor for dequantization
zero_point: i8Zero point offset
block_size: usizeBlock size
lane: PrecisionLanePrecision lane
Implementations§
Source§impl QuantizedBlock
impl QuantizedBlock
Sourcepub fn new(lane: PrecisionLane, block_size: usize) -> Self
pub fn new(lane: PrecisionLane, block_size: usize) -> Self
Create a new quantized block
Sourcepub fn dequantize(&self) -> Vec<f32>
pub fn dequantize(&self) -> Vec<f32>
Dequantize to f32 values
Sourcepub fn size_bytes(&self) -> usize
pub fn size_bytes(&self) -> usize
Get memory size in bytes
Trait Implementations§
Source§impl Clone for QuantizedBlock
impl Clone for QuantizedBlock
Source§fn clone(&self) -> QuantizedBlock
fn clone(&self) -> QuantizedBlock
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 QuantizedBlock
impl Debug for QuantizedBlock
Source§impl<'de> Deserialize<'de> for QuantizedBlock
impl<'de> Deserialize<'de> for QuantizedBlock
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for QuantizedBlock
impl RefUnwindSafe for QuantizedBlock
impl Send for QuantizedBlock
impl Sync for QuantizedBlock
impl Unpin for QuantizedBlock
impl UnwindSafe for QuantizedBlock
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