def get_dlc_metrics(dlc_path: str) -> str:
    """Get the metrics of a DLC file."""
    dlc_info = get_dlc_info(dlc_path)

    # number of parameters
    parameters = int(dlc_info.split("Total parameters:")[1].split()[0])

    # number of MACs
    macs = dlc_info.split("Total MACs per inference:")[1].split()[0]
    if "k" in macs:
        macs = int(macs.split("k")[0]) * 1000
    elif "M" in macs:
        macs = int(macs.split("M")[0]) * 1000000
    else:
        macs = int(macs)

    # memory
    memory_prefix = "Est. Steady-State Memory Needed to Run:"
    memory = float(dlc_info.split(memory_prefix)[1].split()[0])
    memory_unit = dlc_info.split(memory_prefix)[1].split()[1]

    # SNPE version used to create the DLC
    version = dlc_info.split("DLC created with converter version:")[1].split()[0]

    return {"parameters": parameters, "macs": macs, f"memory ({memory_unit})": memory, "snpe-version": version}
Get the metrics of a DLC file.
olive/platform_sdk/qualcomm/snpe/tools/dev.py