pub enum Role {
Router,
LmHead,
Embedding,
Attention,
Expert,
SharedExpert,
Norm,
}Expand description
Semantic role of a tensor, used for precision lookups. The set is
closed and minimal — adding a new role requires extending the
Dtype::for_role match.
Variants§
Router
MoE router gate (hidden × num_experts).
LmHead
Final unembedding (hidden × vocab).
Embedding
Token embedding (vocab × hidden).
Attention
Attention Q/K/V/O projection.
Expert
Expert FFN (gate / up / down per expert).
Shared-expert FFN, when present (DeepSeek-V3 / Qwen3.5 style).
Norm
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
Compare self to
key and return true if they are equal.