Skip to main content

FullAttnLayer

Struct FullAttnLayer 

Source
pub struct FullAttnLayer {
    pub wq: GpuTensor,
    pub wk: GpuTensor,
    pub wv: GpuTensor,
    pub wo: GpuTensor,
    pub q_norm: GpuTensor,
    pub k_norm: GpuTensor,
    pub attn_gate: Option<GpuTensor>,
}

Fields§

§wq: GpuTensor§wk: GpuTensor§wv: GpuTensor§wo: GpuTensor§q_norm: GpuTensor§k_norm: GpuTensor§attn_gate: Option<GpuTensor>

step35-class SEPARATE head-wise attention gate: blk.N.attn_gate.weight [n_embd, n_head_l] where n_head_l is this layer’s query-head count (64 full / 96 SWA on Step-3.7-Flash, so the width VARIES per layer). Produces one pre-sigmoid scalar per head from the post-attn_norm hidden state; the forward broadcasts sigmoid(gate) over head_dim and multiplies attn_out before wo (upstream step35.cpp:267-285).

None for every other arch. Do NOT confuse with LinearAttnLayer::wqkv_gate, which reads the SAME tensor name on qwen35’s SSM layers but is a different mechanism (a full-width z-gate, not a per-head scalar), nor with the qwen35 FUSED gate packed inside wq that ModelConfig::attn_out_gate() / q_gate_split handle.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.