kd.konfig#
Wrapper around ConfigDict to support auto-complete/type checking.
from kauldron import konfig
with konfig.imports():
from flax import linen as nn
Inside the konfig.imports() contextmanager, imports are replaced with dummy proxy objects which return konfig.ConfigDict objects when called:
cfg = konfig.ConfigDict()
cfg.model = nn.Dense(features=16) # `Dense` is actually a `ConfigDict`
cfg.model.features = 32 # ConfigDict can be mutated as usual
Finally, objects are resolved to their actual type with:
cfg = konfig.resolve(cfg)
Symbols#
Module#
Default values and configuration. |
Class#
Wrapper around ConfigDict. |
|
Protocol to better access lazy fields. |
Function#
Defines flag for |
|
Contextmanager which replace import statements by configdicts. |
|
Contextmanager which replaces list of modules with ConfigDictProxyObjects. |
|
Defines an entry in a ConfigDict that has no value yet. |
|
One-way recursive copy of the |
|
Wrap a function for lazy-evaluation. |
|
Register module aliases for nicer display. |
|
Register default values when creating the ConfigDict. |
|
Defines a required attribute in the config that has no value yet. |
|
Recursively parses a nested ConfigDict and resolves module constructors. |
|
Set which modules inside |