pub struct ModelWeights {
pub embed_tokens: DenseWeight,
pub final_norm: DenseWeight,
pub lm_head: DenseWeight,
pub layers: Vec<LayerWeights>,
}Expand description
All model weights organized by layer.
Fields§
§embed_tokens: DenseWeightEmbedding table: [vocab_size, hidden_size] BF16.
final_norm: DenseWeightFinal RMS norm: [hidden_size] BF16.
lm_head: DenseWeightLM head: [hidden_size, vocab_size] BF16.
layers: Vec<LayerWeights>Per-layer weights.
Implementations§
Source§impl ModelWeights
impl ModelWeights
Sourcepub fn from_store(
store: &WeightStore,
layer_types: &[LayerType],
num_experts: usize,
gpu: &dyn GpuBackend,
config: &ModelConfig,
) -> Result<Self>
pub fn from_store( store: &WeightStore, layer_types: &[LayerType], num_experts: usize, gpu: &dyn GpuBackend, config: &ModelConfig, ) -> Result<Self>
Build typed weight references from a flat WeightStore.
layer_types maps layer index → FullAttention or LinearAttention.
num_experts is 512 for Qwen3-Next.
Auto Trait Implementations§
impl Freeze for ModelWeights
impl RefUnwindSafe for ModelWeights
impl Send for ModelWeights
impl Sync for ModelWeights
impl Unpin for ModelWeights
impl UnwindSafe for ModelWeights
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