[{"data":1,"prerenderedAt":662},["ShallowReactive",2],{"navigation":3,"api-navigation":184,"\u002Flearn\u002Fconcepts\u002Flie-typing":206,"docyard:crossref-index":661},[4,8,155,174,180],{"title":5,"path":6,"stem":7},"Getting Started","\u002Fgetting-started","1.getting-started",{"title":9,"path":10,"stem":11,"children":12},"Learn","\u002Flearn","2.learn",[13,15,66,99,133],{"title":9,"path":10,"stem":14},"2.learn\u002Findex",{"title":16,"path":17,"stem":18,"children":19},"Tutorials","\u002Flearn\u002Ftutorials","2.learn\u002F1.tutorials\u002Findex",[20,21,26,30,34,38,42,46,50,54,58,62],{"title":16,"path":17,"stem":18},{"title":22,"path":23,"stem":24,"icon":25},"Why Laco?","\u002Flearn\u002Ftutorials\u002Fwhy-laco","2.learn\u002F1.tutorials\u002F01.why-laco","i-lucide-notebook",{"title":27,"path":28,"stem":29,"icon":25},"First Steps with Laco","\u002Flearn\u002Ftutorials\u002Ffirst-steps","2.learn\u002F1.tutorials\u002F02.first-steps",{"title":31,"path":32,"stem":33,"icon":25},"Lazy Call and Partial","\u002Flearn\u002Ftutorials\u002Flazy-call-and-partial","2.learn\u002F1.tutorials\u002F03.lazy-call-and-partial",{"title":35,"path":36,"stem":37,"icon":25},"Hyperparameters and Interpolation","\u002Flearn\u002Ftutorials\u002Fhyperparameters-and-interpolation","2.learn\u002F1.tutorials\u002F04.hyperparameters-and-interpolation",{"title":39,"path":40,"stem":41,"icon":25},"Loading, Saving, and the CLI","\u002Flearn\u002Ftutorials\u002Floading-saving-cli","2.learn\u002F1.tutorials\u002F05.loading-saving-cli",{"title":43,"path":44,"stem":45,"icon":25},"Nested Configs and Containers","\u002Flearn\u002Ftutorials\u002Fnested-configs-and-containers","2.learn\u002F1.tutorials\u002F06.nested-configs-and-containers",{"title":47,"path":48,"stem":49,"icon":25},"Typed Groups and Schemas","\u002Flearn\u002Ftutorials\u002Ftyped-groups-and-schemas","2.learn\u002F1.tutorials\u002F07.typed-groups-and-schemas",{"title":51,"path":52,"stem":53,"icon":25},"Pipeline Configs","\u002Flearn\u002Ftutorials\u002Fpipeline-configs","2.learn\u002F1.tutorials\u002F08.pipeline-configs",{"title":55,"path":56,"stem":57,"icon":25},"Tasks and the App Loop","\u002Flearn\u002Ftutorials\u002Ftasks-and-app-loop","2.learn\u002F1.tutorials\u002F09.tasks-and-app-loop",{"title":59,"path":60,"stem":61,"icon":25},"Tracing","\u002Flearn\u002Ftutorials\u002Ftracing","2.learn\u002F1.tutorials\u002F10.tracing",{"title":63,"path":64,"stem":65,"icon":25},"Production Patterns","\u002Flearn\u002Ftutorials\u002Fproduction-patterns","2.learn\u002F1.tutorials\u002F11.production-patterns",{"title":67,"path":68,"stem":69,"children":70},"Concepts","\u002Flearn\u002Fconcepts","2.learn\u002F2.concepts\u002Findex",[71,72,76,80,84,88,92,95],{"title":67,"path":68,"stem":69},{"title":73,"path":74,"stem":75},"Config as Python","\u002Flearn\u002Fconcepts\u002Fconfig-as-python","2.learn\u002F2.concepts\u002F1.config-as-python",{"title":77,"path":78,"stem":79},"Lazy Construction","\u002Flearn\u002Fconcepts\u002Flazy-construction","2.learn\u002F2.concepts\u002F2.lazy-construction",{"title":81,"path":82,"stem":83},"Lie-Typing","\u002Flearn\u002Fconcepts\u002Flie-typing","2.learn\u002F2.concepts\u002F3.lie-typing",{"title":85,"path":86,"stem":87},"Interpolation","\u002Flearn\u002Fconcepts\u002Finterpolation","2.learn\u002F2.concepts\u002F4.interpolation",{"title":89,"path":90,"stem":91},"Typed Groups","\u002Flearn\u002Fconcepts\u002Ftyped-groups","2.learn\u002F2.concepts\u002F5.typed-groups",{"title":59,"path":93,"stem":94},"\u002Flearn\u002Fconcepts\u002Ftracing","2.learn\u002F2.concepts\u002F6.tracing",{"title":96,"path":97,"stem":98},"App Loop","\u002Flearn\u002Fconcepts\u002Fapp-loop","2.learn\u002F2.concepts\u002F7.app-loop",{"title":100,"path":101,"stem":102,"children":103},"How-To Guides","\u002Flearn\u002Fhow-to","2.learn\u002F3.how-to\u002Findex",[104,105,109,113,117,121,125,129],{"title":100,"path":101,"stem":102},{"title":106,"path":107,"stem":108},"Override Configs","\u002Flearn\u002Fhow-to\u002Foverride-configs","2.learn\u002F3.how-to\u002F1.override-configs",{"title":110,"path":111,"stem":112},"Safe Loading","\u002Flearn\u002Fhow-to\u002Fsafe-loading","2.learn\u002F3.how-to\u002F2.safe-loading",{"title":114,"path":115,"stem":116},"Custom Resolvers","\u002Flearn\u002Fhow-to\u002Fcustom-resolvers","2.learn\u002F3.how-to\u002F3.custom-resolvers",{"title":118,"path":119,"stem":120},"Lint and Strict Mode","\u002Flearn\u002Fhow-to\u002Flint-and-strict","2.learn\u002F3.how-to\u002F4.lint-and-strict",{"title":122,"path":123,"stem":124},"Publishing a reproducible app with laco app","\u002Flearn\u002Fhow-to\u002Flaco-app","2.learn\u002F3.how-to\u002F5.laco-app",{"title":126,"path":127,"stem":128},"Reproduce an Experiment","\u002Flearn\u002Fhow-to\u002Freproduce-experiment","2.learn\u002F3.how-to\u002F6.reproduce-experiment",{"title":130,"path":131,"stem":132},"Migrate from argparse","\u002Flearn\u002Fhow-to\u002Fmigrate-from-argparse","2.learn\u002F3.how-to\u002F7.migrate-from-argparse",{"title":134,"path":135,"stem":136,"children":137},"Examples Curriculum","\u002Flearn\u002Fexamples","2.learn\u002F4.examples\u002Findex",[138,139,143,147,151],{"title":134,"path":135,"stem":136},{"title":140,"path":141,"stem":142},"Foundation Examples","\u002Flearn\u002Fexamples\u002Ffoundations","2.learn\u002F4.examples\u002F1.foundations",{"title":144,"path":145,"stem":146},"Building Blocks","\u002Flearn\u002Fexamples\u002Fbuilding-blocks","2.learn\u002F4.examples\u002F2.building-blocks",{"title":148,"path":149,"stem":150},"Typed-Group Variants","\u002Flearn\u002Fexamples\u002Ftyped-variants","2.learn\u002F4.examples\u002F3.typed-variants",{"title":152,"path":153,"stem":154},"End-to-End Pipelines","\u002Flearn\u002Fexamples\u002Fpipelines","2.learn\u002F4.examples\u002F4.pipelines",{"title":156,"path":157,"stem":158,"children":159},"Resources","\u002Fresources","3.resources",[160,162,166,170],{"title":156,"path":157,"stem":161},"3.resources\u002Findex",{"title":163,"path":164,"stem":165},"Integrations","\u002Fresources\u002Fintegrations","3.resources\u002F1.integrations",{"title":167,"path":168,"stem":169},"Migration guide: Laco 0.x → 1.0","\u002Fresources\u002Fmigration-0.x-to-1.0","3.resources\u002F2.migration-0.x-to-1.0",{"title":171,"path":172,"stem":173},"Laco vs hydra-zen","\u002Fresources\u002Flaco-vs-hydra-zen","3.resources\u002F3.laco-vs-hydra-zen",{"title":175,"path":176,"stem":177,"children":178},"API Reference","\u002Fapi","4.api\u002Findex",[179],{"title":175,"path":176,"stem":177},{"title":181,"path":182,"stem":183},"Lazy Configuration for Python","\u002F","index",[185,188,191,194,197,200,203],{"title":186,"path":187},"cli","\u002Fapi\u002Fcli",{"title":189,"path":190},"compat","\u002Fapi\u002Fcompat",{"title":192,"path":193},"handler","\u002Fapi\u002Fhandler",{"title":195,"path":196},"keys","\u002Fapi\u002Fkeys",{"title":198,"path":199},"language","\u002Fapi\u002Flanguage",{"title":201,"path":202},"ops","\u002Fapi\u002Fops",{"title":204,"path":205},"utils","\u002Fapi\u002Futils",{"id":207,"title":81,"body":208,"description":485,"extension":657,"meta":658,"navigation":519,"path":82,"seo":659,"stem":83,"__hash__":660},"content\u002F2.learn\u002F2.concepts\u002F3.lie-typing.md",{"type":209,"value":210,"toc":649},"minimark",[211,215,238,243,265,283,287,423,427,430,456,467,473,479,588,603,609,623,627,645],[212,213,81],"h1",{"id":214},"lie-typing",[216,217,218],"blockquote",{},[219,220,221,225,226,229,225,232,234,235],"p",{},[222,223,224],"strong",{},"Tutorial:"," ",[227,228,81],"a",{"href":32},[222,230,231],{},"See also:",[227,233,77],{"href":78},", ",[227,236,237],{"href":176},"API: instantiate",[239,240,242],"h2",{"id":241},"the-core-insight","The Core Insight",[219,244,245,246,250,251,254,255,258,259,261,262,264],{},"Python's type system has no way to say \"this is a ",[247,248,249],"code",{},"DictConfig"," that materializes\ninto a ",[247,252,253],{},"T"," when passed to ",[247,256,257],{},"instantiate",".\" The real runtime type is ",[247,260,249],{},";\nthe useful static type is ",[247,263,253],{},".",[219,266,267,268,271,272,275,276,278,279,282],{},"Laco resolves the tension with an intentional mismatch. ",[247,269,270],{},"L.call(nn.Linear)(...)","\nis declared to return ",[247,273,274],{},"nn.Linear",". The IDE and type-checkers accept this\ndeclaration, but at runtime it returns a ",[247,277,249],{},". This mismatch is load-\nbearing. Without it, nested composition collapses to ",[247,280,281],{},"Any"," after the first\nlevel.",[239,284,286],{"id":285},"the-six-constructs","The Six Constructs",[288,289,290,309],"table",{},[291,292,293],"thead",{},[294,295,296,300,303,306],"tr",{},[297,298,299],"th",{},"Construct",[297,301,302],{},"Static type",[297,304,305],{},"Runtime type",[297,307,308],{},"Use case",[310,311,312,331,349,368,386,405],"tbody",{},[294,313,314,320,324,328],{},[315,316,317],"td",{},[247,318,319],{},"L.call(T)(...)",[315,321,322],{},[247,323,253],{},[315,325,326],{},[247,327,249],{},[315,329,330],{},"Lazy class construction",[294,332,333,338,342,346],{},[315,334,335],{},[247,336,337],{},"L.partial(T)(...)",[315,339,340],{},[247,341,253],{},[315,343,344],{},[247,345,249],{},[315,347,348],{},"Deferred partial application",[294,350,351,356,361,365],{},[315,352,353],{},[247,354,355],{},"L.just(v)",[315,357,358],{},[247,359,360],{},"type(v)",[315,362,363],{},[247,364,249],{},[315,366,367],{},"Wrap an existing value",[294,369,370,375,379,383],{},[315,371,372],{},[247,373,374],{},"L.required[T]()",[315,376,377],{},[247,378,253],{},[315,380,381],{},[247,382,249],{},[315,384,385],{},"Mandatory placeholder",[294,387,388,393,398,402],{},[315,389,390],{},[247,391,392],{},"L.slot(G)",[315,394,395],{},[247,396,397],{},"G",[315,399,400],{},[247,401,249],{},[315,403,404],{},"Group placeholder in schema",[294,406,407,412,416,420],{},[315,408,409],{},[247,410,411],{},"L.chosen(G)",[315,413,414],{},[247,415,397],{},[315,417,418],{},[247,419,249],{},[315,421,422],{},"In-body cross-reference",[239,424,426],{"id":425},"where-the-mismatch-is-enforced","Where the Mismatch is Enforced",[219,428,429],{},"Laco enforces the mismatch at two system boundaries.",[431,432,433,442],"ol",{},[434,435,436,441],"li",{},[222,437,438],{},[247,439,440],{},"laco.load"," accepts only Laco nodes produced by the six constructs\nabove, plus primitives. It rejects plain Python objects that are not node\ninstances.",[434,443,444,449,450,452,453,455],{},[222,445,446],{},[247,447,448],{},"laco.instantiate"," converts ",[247,451,249],{}," back to the genuine ",[247,454,253],{},", both\nat runtime and in its static signature.",[219,457,458,459,461,462,464,465,264],{},"Between those two boundaries, type-checked code sees ",[247,460,253],{},". Code at runtime\nsees ",[247,463,249],{},". The mismatch matters only inside config files, where you\nconstruct nodes. It does not matter inside training code, where you consume\nthem after ",[247,466,257],{},[239,468,470],{"id":469},"lazyobjectt",[247,471,472],{},"LazyObject[T]",[219,474,475,476,478],{},"When a function receives a config node that will be instantiated inside it,\nannotate the parameter with ",[247,477,472],{},":",[480,481,486],"pre",{"className":482,"code":483,"language":484,"meta":485,"style":485},"language-python shiki shiki-themes material-theme-lighter github-light github-dark","from laco import LazyObject, instantiate\n\ndef build(model_cfg: LazyObject[nn.Module]) -> nn.Module:\n    return instantiate(model_cfg)\n","python","",[247,487,488,514,521,571],{"__ignoreMap":485},[489,490,493,497,501,504,507,511],"span",{"class":491,"line":492},"line",1,[489,494,496],{"class":495},"sVHd0","from",[489,498,500],{"class":499},"su5hD"," laco ",[489,502,503],{"class":495},"import",[489,505,506],{"class":499}," LazyObject",[489,508,510],{"class":509},"sP7_E",",",[489,512,513],{"class":499}," instantiate\n",[489,515,517],{"class":491,"line":516},2,[489,518,520],{"emptyLinePlaceholder":519},true,"\n",[489,522,524,528,532,535,539,541,543,546,549,551,555,558,561,564,566,568],{"class":491,"line":523},3,[489,525,527],{"class":526},"sbsja","def",[489,529,531],{"class":530},"sGLFI"," build",[489,533,534],{"class":509},"(",[489,536,538],{"class":537},"sFwrP","model_cfg",[489,540,478],{"class":509},[489,542,506],{"class":499},[489,544,545],{"class":509},"[",[489,547,548],{"class":499},"nn",[489,550,264],{"class":509},[489,552,554],{"class":553},"skxfh","Module",[489,556,557],{"class":509},"])",[489,559,560],{"class":509}," ->",[489,562,563],{"class":499}," nn",[489,565,264],{"class":509},[489,567,554],{"class":553},[489,569,570],{"class":509},":\n",[489,572,574,577,581,583,585],{"class":491,"line":573},4,[489,575,576],{"class":495},"    return",[489,578,580],{"class":579},"slqww"," instantiate",[489,582,534],{"class":509},[489,584,538],{"class":579},[489,586,587],{"class":509},")\n",[219,589,590,592,593,595,596,598,599,602],{},[247,591,472],{}," exists only for type-checking. It is an alias for\n",[247,594,249],{}," at runtime. The ",[247,597,257],{}," overload ",[247,600,601],{},"LazyObject[T] -> T","\nmakes the return type concrete.",[239,604,606],{"id":605},"laco_strict_nodes",[247,607,608],{},"LACO_STRICT_NODES",[219,610,611,612,615,616,618,619,622],{},"During development you can set ",[247,613,614],{},"LACO_STRICT_NODES=1"," to make ",[247,617,249],{},"\nnodes raise ",[247,620,621],{},"AttributeError"," on attribute access that isn't a config key.\nThis catches accidental use of a node as if it were the real object.",[239,624,626],{"id":625},"laco001-lint-rule","LACO001 Lint Rule",[219,628,629,632,633,636,637,640,641,644],{},[247,630,631],{},"laco-lint"," emits ",[247,634,635],{},"LACO001"," when it detects attribute access on a value\nannotated as a Laco node type. Add ",[247,638,639],{},"# noqa: LACO001"," to suppress an\nintentional access (e.g. introspecting ",[247,642,643],{},"._metadata",").",[646,647,648],"style",{},"html pre.shiki code .sVHd0, html code.shiki .sVHd0{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#D73A49;--shiki-default-font-style:inherit;--shiki-dark:#F97583;--shiki-dark-font-style:inherit}html pre.shiki code .su5hD, html code.shiki .su5hD{--shiki-light:#90A4AE;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sP7_E, html code.shiki .sP7_E{--shiki-light:#39ADB5;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sbsja, html code.shiki .sbsja{--shiki-light:#9C3EDA;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sGLFI, html code.shiki .sGLFI{--shiki-light:#6182B8;--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sFwrP, html code.shiki .sFwrP{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#24292E;--shiki-default-font-style:inherit;--shiki-dark:#E1E4E8;--shiki-dark-font-style:inherit}html pre.shiki code .skxfh, html code.shiki .skxfh{--shiki-light:#E53935;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .slqww, html code.shiki .slqww{--shiki-light:#6182B8;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":485,"searchDepth":523,"depth":523,"links":650},[651,652,653,654,655,656],{"id":241,"depth":516,"text":242},{"id":285,"depth":516,"text":286},{"id":425,"depth":516,"text":426},{"id":469,"depth":516,"text":472},{"id":605,"depth":516,"text":608},{"id":625,"depth":516,"text":626},"md",{},{"title":81,"description":485},"jrl7UykdADSHIO6mZgl4pFqmjRpXgkKz35KK3MNjz6E",{},1785687297468]