Skip to main content

V2Layer

Struct V2Layer 

Source
pub struct V2Layer {
Show 14 fields pub norm_in: Vec<f32>, pub q_proj: CqWeight, pub k_proj: CqWeight, pub v_proj: CqWeight, pub gate_proj: CqWeight, pub out_proj: CqWeight, pub q_norm: Vec<f32>, pub k_norm: Vec<f32>, pub post_norm: Vec<f32>, pub attn_gate: f32, pub pre_hada: Vec<f32>, pub d1: Vec<f32>, pub d2: Vec<f32>, pub d3: Vec<f32>,
}
Expand description

One transformer layer’s weights.

Fields§

§norm_in: Vec<f32>

ZCRMSNorm scale before attention (ZCRMSNorm_0).

§q_proj: CqWeight§k_proj: CqWeight§v_proj: CqWeight§gate_proj: CqWeight

Produces the sigmoid gate applied to the attention output.

§out_proj: CqWeight§q_norm: Vec<f32>

Per-head ZCRMSNorm scales, head_dim long.

§k_norm: Vec<f32>§post_norm: Vec<f32>

ZCRMSNorm scale after attention (post_attn_norm).

§attn_gate: f32

Pre-sigmoid scalar gating the attention residual.

§pre_hada: Vec<f32>

ZCRMSNorm scale before HadamardMLP.

§d1: Vec<f32>

HadamardMLP diagonals, hada_n long each.

§d2: Vec<f32>§d3: Vec<f32>

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.