pub struct SparseAttentionConfig {
pub base: AttentionConfig,
pub block_size: usize,
pub num_random_blocks: usize,
pub num_global_tokens: usize,
}Expand description
Configuration for sparse attention mechanisms.
Fields§
§base: AttentionConfigBase attention configuration
block_size: usizeBlock size for block-sparse attention
num_random_blocks: usizeNumber of random blocks per query
num_global_tokens: usizeNumber of global tokens
Implementations§
Source§impl SparseAttentionConfig
impl SparseAttentionConfig
Sourcepub fn builder() -> SparseAttentionConfigBuilder
pub fn builder() -> SparseAttentionConfigBuilder
Creates a new builder for SparseAttentionConfig.
Sourcepub fn validate(&self) -> AttentionResult<()>
pub fn validate(&self) -> AttentionResult<()>
Validates the configuration.
Trait Implementations§
Source§impl Clone for SparseAttentionConfig
impl Clone for SparseAttentionConfig
Source§fn clone(&self) -> SparseAttentionConfig
fn clone(&self) -> SparseAttentionConfig
Returns a duplicate of the value. Read more
1.0.0 · 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 SparseAttentionConfig
impl Debug for SparseAttentionConfig
Source§impl<'de> Deserialize<'de> for SparseAttentionConfig
impl<'de> Deserialize<'de> for SparseAttentionConfig
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 SparseAttentionConfig
impl RefUnwindSafe for SparseAttentionConfig
impl Send for SparseAttentionConfig
impl Sync for SparseAttentionConfig
impl Unpin for SparseAttentionConfig
impl UnwindSafe for SparseAttentionConfig
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