Skip to main content

G4eLayer

Struct G4eLayer 

Source
pub struct G4eLayer {
Show 20 fields pub input_norm: Vec<f32>, pub attn_out_norm: Vec<f32>, pub pre_ffn_norm: Vec<f32>, pub post_ffw_norm: Vec<f32>, pub wq: QTensor, pub wk: Option<QTensor>, pub wv: Option<QTensor>, pub wo: QTensor, pub q_norm: Vec<f32>, pub k_norm: Option<Vec<f32>>, pub kv_share_src: Option<usize>, pub sliding: bool, pub hd: usize, pub gate: QTensor, pub up: QTensor, pub down: QTensor, pub ple_gate: QTensor, pub ple_proj: QTensor, pub post_ple_norm: Vec<f32>, pub layer_scalar: Option<f32>,
}

Fields§

§input_norm: Vec<f32>

Pre-attention norm (HF input_layernorm).

§attn_out_norm: Vec<f32>

Attention-branch output norm (HF post_attention_layernorm).

§pre_ffn_norm: Vec<f32>

Pre-FFN norm (HF pre_feedforward_layernorm).

§post_ffw_norm: Vec<f32>

FFN-branch output norm (HF post_feedforward_layernorm).

§wq: QTensor§wk: Option<QTensor>

Shared-KV layers carry no k/v projections and read the cache of kv_share_src instead of appending their own.

§wv: Option<QTensor>§wo: QTensor§q_norm: Vec<f32>§k_norm: Option<Vec<f32>>§kv_share_src: Option<usize>§sliding: bool§hd: usize

Per-layer head width: head_dim on sliding layers, global_head_dim on full layers.

§gate: QTensor§up: QTensor§down: QTensor§ple_gate: QTensor

PLE injection: gelu(gate·h) ⊙ ple → proj → norm.

§ple_proj: QTensor§post_ple_norm: Vec<f32>§layer_scalar: Option<f32>

HF layer_scalar — per-block output scale (absent = 1.0).

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more