def dlc_to_onnx(
    dlc_path: str,
    config: dict,
    input_names: list[str],
    input_shapes: list[list[int]],
    output_names: list[str],
    output_shapes: list[list[int]],
) -> onnx.ModelProto:
    """Convert a SNPE DLC to ONNX. The DLC is wrapped in a ONNX model for use with onnxruntime SNPE EP.

    Returns an ONNX ModelProto.

    dlc_path: path to the DLC file.
    config: Config dict with the following keys:
        target_device: str = target device for the ONNX-wrapped SNPE model.
        target_opset: int = target ONNX opset for the ONNX-wrapped SNPE model.
    input_names: List[str] = list of input names.
    input_shapes: List[List[int]] = list of input shapes.
    output_names: List[str] = list of output names.
    output_shapes: List[List[int]] = list of output shapes.
    """
    # get the SNPE version used to create the DLC
    snpe_version = get_dlc_snpe_version(dlc_path)

    # create the dlc info and read the content
    dlc_info = get_dlc_info(dlc_path)
    if f"{input_names[0]}:0" in dlc_info:
        input_names = [f"{x}:0" for x in input_names]
        output_names = [f"{x}:0" for x in output_names]

    with Path(dlc_path, "rb").open() as file:
        dlc_content = file.read()

    model_name = Path(dlc_path).stem

    # Loop over all input and output tensor and its dim for the model
    inputs_tensor_val = []
    for input_name, input_shape in zip(input_names, input_shapes):
        inputs_tensor_val.append(helper.make_tensor_value_info(input_name, TensorProto.FLOAT, input_shape))

    outputs_tensor_val = []
    for output_name, output_shape in zip(output_names, output_shapes):
        outputs_tensor_val.append(helper.make_tensor_value_info(output_name, TensorProto.FLOAT, output_shape))

    # Create the node
    snpe_node = helper.make_node(
        "Snpe",
        input_names,
        output_names,
        name=model_name,
        DLC=dlc_content,
        snpe_version=snpe_version,
        target_device=config["target_device"].upper(),
        notes="snpe dlc model",
        domain="com.microsoft",
    )

    # Create the graph
    graph_def = helper.make_graph([snpe_node], model_name, inputs_tensor_val, outputs_tensor_val)

    op = onnx.OperatorSetIdProto()
    op.version = config["target_opset"]
    return helper.make_model(graph_def, producer_name="Olive", opset_imports=[op])
Convert a SNPE DLC to ONNX. The DLC is wrapped in a ONNX model for use with onnxruntime SNPE EP.

    Returns an ONNX ModelProto.

    dlc_path: path to the DLC file.
    config: Config dict with the following keys:
        target_device: str = target device for the ONNX-wrapped SNPE model.
        target_opset: int = target ONNX opset for the ONNX-wrapped SNPE model.
    input_names: List[str] = list of input names.
    input_shapes: List[List[int]] = list of input shapes.
    output_names: List[str] = list of output names.
    output_shapes: List[List[int]] = list of output shapes.
    
olive/platform_sdk/qualcomm/snpe/tools/dev.py