def quantize_dlc(dlc_path: str, input_list: str, config: dict, output_file: str):
    """Quantize a SNPE DLC.

    dlc_path: path to the DLC file.
    input_list: path to the input list file for trial inputs.
    config: a config dict with the following keys:
        use_enhanced_quantizer: bool = whether to use the enhanced quantizer.
        enable_htp: bool = whether to enable HTP.
        htp_socs: List[str] = list of HTP SoCs.
        extra_args: str = extra arguments to pass to the quantizer.
    """
    quant_cmd = "snpe-dlc-quantize"
    if platform.system() == OS.WINDOWS:
        # snpe-dlc-quant is the Windows version of the quantizer tool
        # and it does not support the --enable_htp flag
        quant_cmd = "snpe-dlc-quant"
    cmd = f"{quant_cmd} --input_dlc {dlc_path} --input_list {input_list} --output_dlc {output_file}"
    if config["use_enhanced_quantizer"]:
        cmd += " --use_enhanced_quantizer"
    if config["enable_htp"]:
        if platform.system() == OS.WINDOWS:
            logger.warning("--enable_htp is not supported on Windows")
        else:
            cmd += " --enable_htp"
    if config["htp_socs"] is not None:
        cmd += f" --htp_socs {','.join(config['htp_socs'])}"
    if config["extra_args"] is not None:
        cmd += " " + config["extra_args"]

    _, stderr = SNPERunner(use_dev_tools=True).run(cmd)

    # check if quantization succeeded
    if not ("Writing quantized model" in stderr or "Saved quantized dlc" in stderr):
        raise RuntimeError(stderr)
Quantize a SNPE DLC.

    dlc_path: path to the DLC file.
    input_list: path to the input list file for trial inputs.
    config: a config dict with the following keys:
        use_enhanced_quantizer: bool = whether to use the enhanced quantizer.
        enable_htp: bool = whether to enable HTP.
        htp_socs: List[str] = list of HTP SoCs.
        extra_args: str = extra arguments to pass to the quantizer.
    
olive/platform_sdk/qualcomm/snpe/tools/dev.py