(config, **extra_kwargs)
| 252 | |
| 253 | |
| 254 | def instantiate_from_config(config, **extra_kwargs): |
| 255 | if not "target" in config: |
| 256 | if config == "__is_first_stage__": |
| 257 | return None |
| 258 | elif config == "__is_unconditional__": |
| 259 | return None |
| 260 | raise KeyError("Expected key `target` to instantiate.") |
| 261 | return get_obj_from_str(config["target"])(**config.get("params", dict()), **extra_kwargs) |
| 262 | |
| 263 | |
| 264 | def get_obj_from_str(string, reload=False, invalidate_cache=True): |
no test coverage detected