pub struct ModuleInstance {
pub id: ModuleInstanceId,
pub def: ModuleDefId,
pub parent: Option<ModuleInstanceId>,
pub via_field: Option<String>,
pub prefix: Key,
pub root: String,
pub prefix_derived: bool,
pub repeat: Option<Repeat>,
pub origin: SrcSpan,
pub children: Vec<ModuleInstanceId>,
pub certainty: Certainty,
}Expand description
A module definition built at one specific VarBuilder prefix.
Fields§
§id: ModuleInstanceId§def: ModuleDefId§parent: Option<ModuleInstanceId>§via_field: Option<String>Field name in the parent struct, when this came from a field initializer. Absent when containment and prefix nesting diverge.
prefix: KeyPrefix at this instance. May be a template.
root: StringWhich VarBuilder root this prefix belongs to, named after the constructor parameter
it entered through (e.g. base_vb vs train_vb). Two prefixes are only comparable
within the same root: distinct roots are distinct namespaces, and in practice one is
frozen mmapped weights while another is a trainable VarMap.
prefix_derived: boolTrue when the prefix was not written in source but computed as the longest common
prefix of this instance’s descendants. Grouping structs (Layer { .. } literals) have
no builder of their own, so their prefix is derived rather than observed.
repeat: Option<Repeat>§origin: SrcSpan§children: Vec<ModuleInstanceId>§certainty: CertaintyTrait Implementations§
Source§impl Clone for ModuleInstance
impl Clone for ModuleInstance
Source§fn clone(&self) -> ModuleInstance
fn clone(&self) -> ModuleInstance
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more