def snpe_throughput_net_run(
    dlc_path: str,
    duration: int,
    input_list: str,
    data_dir: str,
    device: SNPEDevice = "cpu",
    android_target: str = None,
    perf_profile: PerfProfile = None,
    enable_cpu_fallback: bool = False,
    android_persist_ws: bool = False,
    android_initialized: bool = False,
) -> float:
    """Run snpe-throughput-net-run on the given DLC and input list for the given duration.

    Returns the throughput value.

    dlc_path: The path to the DLC.
    duration: The duration.
    input_list: The path to the input list.
    data_dir: The path to the data directory.
    device: The device to run on.
    android_target: The android target to run on. If None, run on host.
    perf_profile: The performance profile to use.
    enable_cpu_fallback: Whether to enable CPU fallback.
    android_persist_ws: Whether to persist the workspace on android.
    android_initialized: Whether the inference session has already been initialized on android using
        init_snpe_net_adb.
    """
    cmd = f"snpe-throughput-net-run --container {dlc_path} --duration {duration} --use_{device}"

    input_raw = ""
    first = ""
    with Path(input_list).open() as f:
        for line in f:
            if line.startswith(("#", "%")):
                continue
            else:
                first = line.strip()
                break

        if ":=" in first:
            inputs = [(x.split(":=")[0], x.split(":=")[1]) for x in first.split()]
            inputs = sorted(inputs, key=lambda x: x[0])
            input_raw = ",".join([x[1] for x in inputs])
        else:
            input_raw = first
    cmd += f" --input_raw {input_raw}"

    if perf_profile is not None:
        try:
            perf_profile = PerfProfile(perf_profile)
        except ValueError:
            raise ValueError(
                f"Invalid perf profile '{perf_profile}'. Valid perf profiles are {[p.value for p in PerfProfile]}"
            ) from None
        cmd += f" --perf_profile {perf_profile}"
    if enable_cpu_fallback:
        cmd += " --enable_cpu_fallback"

    if android_target is not None:
        stdout, _ = _snpe_throughput_net_run_adb(
            cmd, android_target, data_dir, persist_ws=android_persist_ws, initialized=android_initialized
        )
    else:
        stdout, _ = SNPERunner().run(cmd)
    return float(stdout.split("Total throughput: ")[1].split(" ")[0])
Run snpe-throughput-net-run on the given DLC and input list for the given duration.

    Returns the throughput value.

    dlc_path: The path to the DLC.
    duration: The duration.
    input_list: The path to the input list.
    data_dir: The path to the data directory.
    device: The device to run on.
    android_target: The android target to run on. If None, run on host.
    perf_profile: The performance profile to use.
    enable_cpu_fallback: Whether to enable CPU fallback.
    android_persist_ws: Whether to persist the workspace on android.
    android_initialized: Whether the inference session has already been initialized on android using
        init_snpe_net_adb.
    
olive/platform_sdk/qualcomm/snpe/tools/inference.py