pub struct QuantizedTensor {
pub data: Vec<u8>,
pub scales: Vec<f32>,
pub zero_points: Vec<f32>,
pub bits: u8,
}Expand description
A quantized tensor with per-channel scale and zero-point for asymmetric
dequantization: value = scale * (quantized - zero_point).
Fields§
§data: Vec<u8>Packed quantized values stored as u8. For sub-byte widths the values are stored one-per-byte for simplicity (packing is a future optimisation).
scales: Vec<f32>Per-channel (per-head) scale factors.
zero_points: Vec<f32>Per-channel (per-head) zero-points in quantized domain.
bits: u8Bit-width used during quantization.
Trait Implementations§
Source§impl Clone for QuantizedTensor
impl Clone for QuantizedTensor
Source§fn clone(&self) -> QuantizedTensor
fn clone(&self) -> QuantizedTensor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 QuantizedTensor
impl RefUnwindSafe for QuantizedTensor
impl Send for QuantizedTensor
impl Sync for QuantizedTensor
impl Unpin for QuantizedTensor
impl UnsafeUnpin for QuantizedTensor
impl UnwindSafe for QuantizedTensor
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