espnet3.utils.stage_configs.resolve_search_directories
espnet3.utils.stage_configs.resolve_search_directories
espnet3.utils.stage_configs.resolve_search_directories(system_cls: type, requested_stage: str, configs_by_role: Mapping[str, DictConfig | None], cli_dir_overrides: Mapping[str, str | Path], visited: set | None = None) → Dict[str, Path]
Directory to search for each in-scope stage’s saved config snapshot.
Only the requested stage and stages declared before it are considered - a later, unrelated stage’s unresolvable log_dir never raises or appears in the result. For each in-scope stage: a CLI directory override for its canonical log_dir key wins; otherwise, if this run’s own config for that stage can already resolve log_dir (via resolve_stage_log_dir()), that value is used. A stage with neither is simply omitted from the result - this is not an error, since a directory may still be discovered later from a loaded snapshot (see merge_stage_config_from_snapshots()).
- Parameters:
- system_cls – The system class whose declared stages sets the inheritance order.
- requested_stage – The stage whose saved config search this is for.
- configs_by_role – This run’s own, not-yet-resolved config for each role, as in
build_stage_configs(). - cli_dir_overrides – Canonical log_dir key (e.g. “exp_dir”, not an alias - alias-to-canonical translation is the CLI parser’s job) -> directory explicitly given this run.
- visited – Optional set the caller may reuse across calls; populated with (stage_name, directory) pairs this call resolved.
- Returns: Stage name -> directory to search, for every in-scope stage that resolved to one.
