pub enum RotationBackend {
FastHadamard(FastHadamardRotation),
StoredQr(StoredRotation),
}Expand description
Concrete rotation backend used by quantizers.
Variants§
FastHadamard(FastHadamardRotation)
StoredQr(StoredRotation)
Implementations§
Source§impl RotationBackend
impl RotationBackend
pub fn new(dim: usize, seed: u64, kind: RotationKind) -> Result<Self>
pub fn kind(&self) -> RotationKind
pub fn kind_label(&self) -> &'static str
pub fn seed(&self) -> u64
Source§impl RotationBackend
impl RotationBackend
Sourcepub fn apply_inverse_batch(&self, inputs: &[&[f32]]) -> Result<Vec<Vec<f32>>>
pub fn apply_inverse_batch(&self, inputs: &[&[f32]]) -> Result<Vec<Vec<f32>>>
Apply the inverse rotation to a batch of dim-sized slices in one
call. For FastHadamard this is the same per-vector math as
apply_inverse but amortized across the whole batch. For
StoredQr the d×d matrix is converted to a row-major Vec<f32>
once and reused across the batch.
Trait Implementations§
Source§impl Clone for RotationBackend
impl Clone for RotationBackend
Source§fn clone(&self) -> RotationBackend
fn clone(&self) -> RotationBackend
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 moreSource§impl Debug for RotationBackend
impl Debug for RotationBackend
Source§impl<'de> Deserialize<'de> for RotationBackend
impl<'de> Deserialize<'de> for RotationBackend
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 RotationBackend
impl RefUnwindSafe for RotationBackend
impl Send for RotationBackend
impl Sync for RotationBackend
impl Unpin for RotationBackend
impl UnsafeUnpin for RotationBackend
impl UnwindSafe for RotationBackend
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.