pub struct Key {
pub segs: Vec<KeySeg>,
}Expand description
A dotted key such as model.layers.{index}.self_attn.q_proj.weight.
This is a display and matching type, not the primary key. Identity is ParamId.
Fields§
§segs: Vec<KeySeg>Implementations§
Source§impl Key
impl Key
Sourcepub fn from_dotted(text: &str) -> Self
pub fn from_dotted(text: &str) -> Self
Parse a dotted checkpoint key string, treating {…} segments as templates.
Sourcepub fn push_literal(&self, text: &str) -> Self
pub fn push_literal(&self, text: &str) -> Self
Append a prefix as written at a pp() call. A single call may carry dots
(pp("lora_layers.0")), so the text is split to keep key algebra uniform.
pub fn push(&self, seg: KeySeg) -> Self
pub fn extend(&self, segs: &[KeySeg]) -> Self
pub fn is_empty(&self) -> bool
Sourcepub fn is_template(&self) -> bool
pub fn is_template(&self) -> bool
True when the key contains a dynamic segment and so denotes a family of tensors.
Trait Implementations§
impl Eq for Key
impl StructuralPartialEq for Key
Auto Trait Implementations§
impl Freeze for Key
impl RefUnwindSafe for Key
impl Send for Key
impl Sync for Key
impl Unpin for Key
impl UnsafeUnpin for Key
impl UnwindSafe for Key
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