(config)
| 70 | |
| 71 | |
| 72 | def instantiate_from_config(config): |
| 73 | if not "target" in config: |
| 74 | if config == '__is_first_stage__': |
| 75 | return None |
| 76 | elif config == "__is_unconditional__": |
| 77 | return None |
| 78 | raise KeyError("Expected key `target` to instantiate.") |
| 79 | return get_obj_from_str(config["target"])(**config.get("params", dict())) |
| 80 | |
| 81 | |
| 82 | def get_obj_from_str(string, reload=False): |
no test coverage detected