pub struct QuantizedTileInputBuilder { /* private fields */ }Expand description
The quantized continuation of a TileInputBuilder: the container is fixed
(packed-u32, values-unit declaration, the scheme’s block grid for scales); a content
finalizer fills it and mints the values tile and its scales together: a quantized
tensor is one thing (data, scales, scheme).
Implementations§
Source§impl QuantizedTileInputBuilder
impl QuantizedTileInputBuilder
Sourcepub fn arange(self) -> QuantizedTileInput
pub fn arange(self) -> QuantizedTileInput
arange, wrapped into the scheme’s representable range: values run
lo, lo+1, …, hi, lo, …, so every representable value (and its sign extension)
appears. Scales are a distinct-per-block ramp (0.05 · (block + 1)) on the scheme’s
block grid.
Integer value types only. The walk is over whole numbers packed as two’s complement, and
q is handed to tests as the magnitude each field stands for —
both of which hold only where a format’s codes are its magnitudes. Under a minifloat the
fields would be codes, so a test folding q · scale would compare the kernel against the
integer grid the format exists to avoid.
Sourcepub fn lookup_arange(self, table: &[f32]) -> QuantizedTileInput
pub fn lookup_arange(self, table: &[f32]) -> QuantizedTileInput
arange for a lookup scheme: the packed fields walk the table indices
descending (2^bits - 1, …, 1, 0, 2^bits - 1, …), so every entry is read and the
field is never the identity of its position: a decode that indexed the table by position
instead of by the unpacked field would pass an ascending walk. The scales are the same
distinct-per-block ramp, and table uploads beside them. Panics unless the scheme’s mode
is lookup and the table holds exactly 2^bits entries.
Auto Trait Implementations§
impl !RefUnwindSafe for QuantizedTileInputBuilder
impl !UnwindSafe for QuantizedTileInputBuilder
impl Freeze for QuantizedTileInputBuilder
impl Send for QuantizedTileInputBuilder
impl Sync for QuantizedTileInputBuilder
impl Unpin for QuantizedTileInputBuilder
impl UnsafeUnpin for QuantizedTileInputBuilder
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§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>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§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.Source§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.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
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> ⓘ
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