pub struct AttentionParams {
pub scale: f64,
pub softcap: Option<f64>,
pub sliding_window: Option<usize>,
}Expand description
Parameters controlling scaled dot-product attention inside decoder layers.
Fields§
§scale: f64Multiplicative logit scale (typically 1.0 / sqrt(head_dim)).
softcap: Option<f64>Optional logit softcap (softcap * tanh(scores / softcap)), used by Gemma 2/3.
sliding_window: Option<usize>Optional sliding window attention span.
Trait Implementations§
Source§impl Clone for AttentionParams
impl Clone for AttentionParams
impl Copy for AttentionParams
Auto Trait Implementations§
impl Freeze for AttentionParams
impl RefUnwindSafe for AttentionParams
impl Send for AttentionParams
impl Sync for AttentionParams
impl Unpin for AttentionParams
impl UnsafeUnpin for AttentionParams
impl UnwindSafe for AttentionParams
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> ErasedDestructor for Twhere
T: 'static,
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
Converts
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> ⓘ
Converts
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