pub enum Role {
Router,
LmHead,
Embedding,
Attention,
Expert,
SharedExpert,
Norm,
}Expand description
2026-09-25: Semantic role of a tensor, used for precision lookups. Adding
a role means extending the matches in Role::name, Role::from_str and
PrecisionSchedule::dtype_for.
Variants§
Router
2026-09-25: MoE router gate (hidden × num_experts).
LmHead
2026-09-25: Final unembedding (hidden × vocab).
Embedding
2026-09-25: Token embedding (vocab × hidden).
Attention
2026-09-25: Attention Q/K/V/O projection.
Expert
2026-09-25: Expert FFN (gate / up / down per expert).
2026-09-25: Shared-expert FFN, when the model has one.
Norm
2026-09-25: Layer norm scales (RMSNorm weight).
Implementations§
Trait Implementations§
impl Copy for Role
impl Eq for Role
impl StructuralPartialEq for Role
Auto Trait Implementations§
impl Freeze for Role
impl RefUnwindSafe for Role
impl Send for Role
impl Sync for Role
impl Unpin for Role
impl UnwindSafe for Role
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
Checks if this value is equivalent to the given key. Read more
§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.