gradslam.config¶
- class CfgNode(init_dict: Optional[dict] = None, key_list: Optional[list] = None, new_allowed: Optional[bool] = False)[source]¶
CfgNode is a node in the configuration tree. It’s a simple wrapper around a dict and supports access to attributes via keys.
- classmethod load_cfg(cfg_file_obj_or_str)[source]¶
Load a configuration into the CfgNode.
- Parameters
cfg_file_obj_or_str (str or cfg compatible object) – Supports loading from: - A file object backed by a YAML file. - A file object backed by a Python source file that exports an sttribute “cfg” (dict or CfgNode). - A string that can be parsed as valid YAML.
- merge_from_file(cfg_filename: str)[source]¶
Load a yaml config file and merge it with this CfgNode.
- Parameters
cfg_filename (str) – Config file path.
- merge_from_list(cfg_list: list)[source]¶
Merge config (keys, values) in a list (eg. from commandline) into this CfgNode.
Eg. cfg_list = [‘FOO.BAR’, 0.5].
- merge_from_other_cfg(cfg_other)[source]¶
Merge cfg_other into the current CfgNode.
- Parameters
cfg_other –