pub struct LoraLayerWeights {
pub layer_idx: usize,
pub q_proj: Option<LoraPair>,
pub k_proj: Option<LoraPair>,
pub v_proj: Option<LoraPair>,
pub o_proj: Option<LoraPair>,
pub gate_proj: Option<LoraPair>,
pub up_proj: Option<LoraPair>,
pub down_proj: Option<LoraPair>,
pub out_proj: Option<LoraPair>,
pub router: Option<LoraPair>,
pub experts: Option<ExpertLoraLayer>,
}Expand description
2026-09-25: One layer’s adapted modules, as LoraPairs; None means the
module is not adapted. Clone because a rotation copies the new active
slot’s layers out of the pool set before re-installing them.
Fields§
§layer_idx: usize§q_proj: Option<LoraPair>§k_proj: Option<LoraPair>§v_proj: Option<LoraPair>§o_proj: Option<LoraPair>§gate_proj: Option<LoraPair>§up_proj: Option<LoraPair>§down_proj: Option<LoraPair>§out_proj: Option<LoraPair>§router: Option<LoraPair>2026-09-25: MoE router (mlp.gate) delta. None unless the adapter
targets the router; loading such an adapter needs
METRALE_LORA_EXPERTS=1.
experts: Option<ExpertLoraLayer>2026-09-25: This layer’s routed-expert pairs. None unless the adapter
carries expert deltas (which also need METRALE_LORA_EXPERTS=1). They
live in LoraWeights::expert_pool, outside the equal-size slot pool.
Implementations§
Source§impl LoraLayerWeights
impl LoraLayerWeights
Sourcepub fn module_pair(&self, module: LoraModule) -> Option<&LoraPair>
pub fn module_pair(&self, module: LoraModule) -> Option<&LoraPair>
2026-09-25: This layer’s pair for module; None when the module is
not adapted. select_routed_pair reads pairs through it.
Trait Implementations§
Source§impl Clone for LoraLayerWeights
impl Clone for LoraLayerWeights
Source§fn clone(&self) -> LoraLayerWeights
fn clone(&self) -> LoraLayerWeights
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 moreAuto Trait Implementations§
impl Freeze for LoraLayerWeights
impl RefUnwindSafe for LoraLayerWeights
impl Send for LoraLayerWeights
impl Sync for LoraLayerWeights
impl Unpin for LoraLayerWeights
impl UnwindSafe for LoraLayerWeights
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