def build_optimizers(opt_config, runner):
    """Builds optimizers for the given runner.

    The `opt_config` should be a dictionary, where keys are model names and
    each value is the optimizer configuration for a particumar model. All built
    optimizers will be saved in `runner.optimizers`, which is also a dictionary.

    NOTE: The model names should match the keys of `runner.models`.

    Args:
        opt_config: The configuration to build the optimizers.
        runner: The runner to build the optimizer for.
    """
    if not opt_config:
        return

    assert isinstance(opt_config, dict)
    for name, config in opt_config.items():
        if not name or not config:
            continue
        if name in runner.optimizers:
            raise AttributeError(f'Optimizer `{name}` has already existed!')
        if name not in runner.models:
            raise AttributeError(f'Model `{name}` is missing!')
        runner.optimizers[name] = build_optimizer(config, runner.models[name])
Builds optimizers for the given runner.

    The `opt_config` should be a dictionary, where keys are model names and
    each value is the optimizer configuration for a particumar model. All built
    optimizers will be saved in `runner.optimizers`, which is also a dictionary.

    NOTE: The model names should match the keys of `runner.models`.

    Args:
        opt_config: The configuration to build the optimizers.
        runner: The runner to build the optimizer for.
    
runners/optimizer.py