pub struct AttentionProblem {
pub batch: usize,
pub num_heads: usize,
pub seq_q: usize,
pub seq_kv: usize,
pub head_dim: usize,
pub val_dim: usize,
pub masked: bool,
pub causal: bool,
}Expand description
Description of an attention problem to solve, regardless of actual data
Fields§
§batch: usizeBatch size
num_heads: usizeNumber of attention heads
seq_q: usizeQuery sequence length
seq_kv: usizeKey/Value sequence length
head_dim: usizeDimension of each head (d)
val_dim: usizeDimension of each value vector.
Usually equal to head_dim, but may differ in some variants
masked: boolWhether a mask is supplied (shape is always [batch, seq_q, heads, seq_kv])
causal: boolWhether there is a causal mask
Trait Implementations§
Source§impl Clone for AttentionProblem
impl Clone for AttentionProblem
Auto Trait Implementations§
impl Freeze for AttentionProblem
impl RefUnwindSafe for AttentionProblem
impl Send for AttentionProblem
impl Sync for AttentionProblem
impl Unpin for AttentionProblem
impl UnsafeUnpin for AttentionProblem
impl UnwindSafe for AttentionProblem
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