xnn.common.config.loaders.from_hydra#
- xnn.common.config.loaders.from_hydra(dict_config)[source]#
Build a
Configfrom a Hydra / OmegaConfDictConfig.Converts the
DictConfigto a plain container (resolving interpolations) viaomegaconf.OmegaConf.to_container(), falling back todict()if OmegaConf is not installed, then funnels it throughfrom_dict().- Parameters:
dict_config (omegaconf.DictConfig) – The Hydra-provided configuration node.
- Returns:
The populated configuration object.
- Return type:
Examples
In your Hydra entrypoint:
from omegaconf import OmegaConf @hydra.main(config_path="configs", config_name="train") def main(cfg): config = from_hydra(cfg)