pub struct AttentionConfig {
pub num_heads: usize,
pub head_dim: usize,
pub dropout_prob: f64,
pub causal: bool,
pub scale: Option<f32>,
}
Expand description
Configuration for attention
Fields§
§num_heads: usize
Number of attention heads
head_dim: usize
Dimension of each attention head
dropout_prob: f64
Dropout probability (0.0 means no dropout)
causal: bool
Whether to use causal attention
scale: Option<f32>
Custom scaling factor (default is 1/sqrt(head_dim))
Trait Implementations§
Source§impl Clone for AttentionConfig
impl Clone for AttentionConfig
Source§fn clone(&self) -> AttentionConfig
fn clone(&self) -> AttentionConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for AttentionConfig
impl Debug for AttentionConfig
Auto Trait Implementations§
impl Freeze for AttentionConfig
impl RefUnwindSafe for AttentionConfig
impl Send for AttentionConfig
impl Sync for AttentionConfig
impl Unpin for AttentionConfig
impl UnwindSafe for AttentionConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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