Instantiate object from config
(config)
| 34 | |
| 35 | |
| 36 | def instantiate_from_config(config): |
| 37 | """ |
| 38 | Instantiate object from config |
| 39 | """ |
| 40 | if not "target" in config: |
| 41 | raise KeyError("Expected key `target` to instantiate.") |
| 42 | return get_obj_from_str(config["target"])(**config.get("params", dict())) |
| 43 | |
| 44 | |
| 45 | def resume_config(cfg: OmegaConf): |
no test coverage detected