pub enum GraphAttn<'a> {
Full {
wq: GraphW<'a>,
wk: GraphW<'a>,
wv: GraphW<'a>,
wo: GraphW<'a>,
q_norm: Option<&'a [f32]>,
k_norm: Option<&'a [f32]>,
bias: Option<(&'a [f32], &'a [f32], &'a [f32])>,
output_gate: bool,
cpu_k: &'a [Vec<f32>],
cpu_v: &'a [Vec<f32>],
},
Gdn {},
}Expand description
A layer’s token-mixing op: standard attention or a GDN (linear-attention) block. The surrounding norms + SwiGLU FFN are common to both.
Variants§
Full
Fields
§
bias: Option<(&'a [f32], &'a [f32], &'a [f32])>(bq, bk, bv) attention biases (Qwen2). None ⇒ no bias.
Gdn
Auto Trait Implementations§
impl<'a> Freeze for GraphAttn<'a>
impl<'a> RefUnwindSafe for GraphAttn<'a>
impl<'a> Send for GraphAttn<'a>
impl<'a> Sync for GraphAttn<'a>
impl<'a> Unpin for GraphAttn<'a>
impl<'a> UnsafeUnpin for GraphAttn<'a>
impl<'a> UnwindSafe for GraphAttn<'a>
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