import yaml


def load_benchmark_config(opt):
    """Load all the configuration files for benchmarking."""

    # Load the codec configuration
    with open(opt.codec_config, 'r') as file:
        codec_config = yaml.load(file, Loader=yaml.FullLoader)
    if opt.slice is not None:
        codec_config['slice'] = opt.slice
    opt.codec_config = codec_config

    # Load the network configuration
    if opt.net_config != '':
        with open(opt.net_config, 'r') as file:
            net_config = yaml.load(file, Loader=yaml.FullLoader)
        opt.net_config = net_config

    return opt