xnn.common.config.loaders.apply_overrides#

xnn.common.config.loaders.apply_overrides(cfg, overrides)[source]#

Apply a.b=c style dotted overrides in place.

Shared by the CLI and Hydra paths so the same override syntax works everywhere. Each value is parsed with ast.literal_eval() and falls back to the raw string if parsing fails. Entries without = are skipped. Config.__post_init__() is re-run afterwards to re-synchronize the cutoffs.

Parameters:
  • cfg (Config) – The configuration to mutate.

  • overrides (list[str]) – Override strings of the form "model.cutoff=6.0".

Returns:

The same cfg instance, with overrides applied.

Return type:

Config