pub struct GQuantizer {
pub hist: [i64; 16],
pub buffer: Vec<u8>,
}
Fields§
§hist: [i64; 16]
§buffer: Vec<u8>
Implementations§
Source§impl GQuantizer
impl GQuantizer
pub const QUANTIZE_HISTOGRAM_SIZE: usize = 16usize
Sourcepub fn reset_histogram(&mut self)
pub fn reset_histogram(&mut self)
Reset the histogram.
Sourcepub fn quantize(&mut self, typ: GType, input: &[f32]) -> Result<&[u8]>
pub fn quantize(&mut self, typ: GType, input: &[f32]) -> Result<&[u8]>
Quantizes the input [f32]
slice with the specified type and returns a reference to this
GQuantizer’s internal buffer.
WARNING: The return value is only valid while the GQuantizer it came from is alive
(lifetimes should ensure this) and until the next time you call the quantize
method.
Trait Implementations§
Source§impl Clone for GQuantizer
impl Clone for GQuantizer
Source§fn clone(&self) -> GQuantizer
fn clone(&self) -> GQuantizer
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 GQuantizer
impl Debug for GQuantizer
Source§impl Default for GQuantizer
impl Default for GQuantizer
Source§fn default() -> GQuantizer
fn default() -> GQuantizer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for GQuantizer
impl RefUnwindSafe for GQuantizer
impl Send for GQuantizer
impl Sync for GQuantizer
impl Unpin for GQuantizer
impl UnwindSafe for GQuantizer
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