def _snpe_throughput_net_run_adb(
    cmd: str, android_target: str, data_dir: str, persist_ws: bool = False, initialized: bool = False
) -> tuple[str, str]:
    """Run snpe-throughput-net-run on the target Android device.

    cmd: snpe-throughput-net-run command with local paths to the dlc and input raw files.
    android_target: target Android device.
    data_dir: the path to the data directory.
    persist_ws: Whether to persist the workspace on the target device.
    Whether the snpe inference session has been initialized using init_snpe_net_adb.
    """
    dlc_path = cmd.split("--container")[1].split()[0]
    input_raw = cmd.split("--input_raw")[1].split()[0]

    target_ws = "/data/local/tmp/olive-snpe/ws"
    target_data_dir = f"{target_ws}/data"

    try:
        adb_utils.run_adb_command("root", android_target)

        # create clean target workspace
        if not initialized:
            adb_utils.run_adb_command(f"rm -rf {target_ws}", android_target, True)
        else:
            adb_utils.run_adb_command(f"rm -rf {target_data_dir}", android_target, True)
        adb_utils.run_adb_command(f"mkdir -p {target_ws} {target_data_dir}", android_target, True)

        # create input_raw with target paths
        inputs = input_raw.split(",")
        target_inputs = []
        for input_item in inputs:
            target_input = Path(input_item).resolve().relative_to(Path(data_dir).resolve())
            target_input = (Path(target_data_dir) / target_input).as_posix()
            target_inputs.append(target_input)
        target_input_raw = ",".join(target_inputs)

        # push dlc and input raw files to target
        push_pairs = []
        if not initialized:
            push_pairs = [(dlc_path, target_ws)]
        for input_item, target_input in zip(inputs, target_inputs):
            push_pairs.append((input_item, Path(target_input).parent.as_posix()))
        for src, dst in push_pairs:
            adb_utils.adb_push(src, dst, android_target)

        # create new command with target paths
        cmd = cmd.replace(dlc_path, f"{target_ws}/{Path(dlc_path).name}")
        cmd = cmd.replace(input_raw, target_input_raw)

        push_snpe = not initialized
        stdout, stderr = adb_utils.run_snpe_adb_command(cmd, android_target, push_snpe=push_snpe)
    finally:
        if not persist_ws:
            adb_utils.run_adb_command(f"rm -rf {target_ws}", android_target, True)

    return stdout, stderr
Run snpe-throughput-net-run on the target Android device.

    cmd: snpe-throughput-net-run command with local paths to the dlc and input raw files.
    android_target: target Android device.
    data_dir: the path to the data directory.
    persist_ws: Whether to persist the workspace on the target device.
    Whether the snpe inference session has been initialized using init_snpe_net_adb.
    
olive/platform_sdk/qualcomm/snpe/tools/inference.py