pub enum ResidualStep {
SaveResidual,
HcPre(Site),
Norm(&'static str),
Mixer,
Mlp,
HcPost(Site),
}Expand description
One step of a layer’s residual path, in execution order.
This is the wiring, as data. HF’s Glm5NextTextDecoderLayer::forward runs, per site:
hc_pre → norm → sublayer → hc_post, twice; the residual streams entering hc_pre are the
ones hc_post mixes through comb.
Variants§
SaveResidual
Snapshot the hc_mult streams as the residual for this site’s hc_post.
HcPre(Site)
hc_pre: collapse the streams to one sequence, emit post/comb.
Norm(&'static str)
RMSNorm on the collapsed sequence.
Mixer
The attention mixer.
Mlp
The MLP site. Not implemented by this slice.
HcPost(Site)
hc_post: out[j] = post[j]*block_out + Σ_i comb[i][j]*residual[i].
Trait Implementations§
Source§impl Clone for ResidualStep
impl Clone for ResidualStep
Source§fn clone(&self) -> ResidualStep
fn clone(&self) -> ResidualStep
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ResidualStep
impl Debug for ResidualStep
Source§impl PartialEq for ResidualStep
impl PartialEq for ResidualStep
impl Copy for ResidualStep
impl Eq for ResidualStep
impl StructuralPartialEq for ResidualStep
Auto Trait Implementations§
impl Freeze for ResidualStep
impl RefUnwindSafe for ResidualStep
impl Send for ResidualStep
impl Sync for ResidualStep
impl Unpin for ResidualStep
impl UnwindSafe for ResidualStep
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.