pub struct Scheme {
pub block: Block,
pub scale: Scale,
pub words: u8,
}Expand description
A quantized activation’s scheme: its blocks, how each block’s scale is chosen, and the int8 words each value takes — one, the nearest whole number of the scale; two, a high word and a low word whose code is the nearest whole number of a finer step (the high word’s rest at a 128th of the scale, or a 16-bit code at a 256th); three, a third word at a 128th of the second’s step.
Fields§
§block: Block§scale: Scale§words: u8Implementations§
Source§impl Scheme
impl Scheme
Sourcepub const fn of(format: QuantFormat) -> Scheme
pub const fn of(format: QuantFormat) -> Scheme
The scheme of an activation quantized in format: blocks of BLOCK under max / 127.
Sourcepub fn bound(&self) -> Bound
pub fn bound(&self) -> Bound
The bound a value read in this scheme keeps: half the finest step, where a scale max / 127 is that value or, a
least power-of-two scale, up to 1 + 2^(1 − bits) times it, and an unsigned code’s half level under its scale
at most max / 255; the slack terms cover the value and the scale read in f32 (a relative 2⁻²⁴ each, a
sixteenth of a step of the block where that is less than 2⁻²⁰ of it), a denormal flushed to zero, and a scale’s
floor.
Trait Implementations§
Source§impl Ord for Scheme
impl Ord for Scheme
Source§impl PartialOrd for Scheme
impl PartialOrd for Scheme
impl Copy for Scheme
impl Eq for Scheme
impl StructuralPartialEq for Scheme
Auto Trait Implementations§
impl Freeze for Scheme
impl RefUnwindSafe for Scheme
impl Send for Scheme
impl Sync for Scheme
impl Unpin for Scheme
impl UnsafeUnpin for Scheme
impl UnwindSafe for Scheme
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.