Device
- class Device(name='', os='', attributes=<factory>)
Create a target device representation.
The actual target device selection is done when a job is submitted.
- name
A name must be an exact match with an existing device, e.g. "Samsung Galaxy S23".
- Type:
str
- os
The OS can either be empty, a specific version, or a version interval. If a specific vesion is specified ("15.2"), it must be an exact match with an existing device. An interval can be used to get a range of OS versions. The OS interval must be a right-open mixed interval. Either side of an interval can be empty, e.g. "[12,13)" or "[12,)". If the OS is empty, this device represents the device with the latest OS version selected from all devices compatible with the name and attriutes.
- Type:
str
- attributes
Additional device attributes. The selected device is compatible with all attributes specified. Supported attributes are:
"format:phone""format:tablet""framework:tflite""framework:qnn""framework:onnx""vendor:google""vendor:samsung""vendor:xiaomi""vendor:oneplus""os:android""chipset:qualcomm-snapdragon-429""chipset:qualcomm-snapdragon-670""chipset:qualcomm-snapdragon-678""chipset:qualcomm-snapdragon-730""chipset:qualcomm-snapdragon-730g""chipset:qualcomm-snapdragon-765g""chipset:qualcomm-snapdragon-778g""chipset:qualcomm-snapdragon-845""chipset:qualcomm-snapdragon-855""chipset:qualcomm-snapdragon-865+""chipset:qualcomm-snapdragon-888""chipset:qualcomm-snapdragon-8gen1""chipset:qualcomm-snapdragon-8gen2"
- Type:
str|List[str]
サンプル
import qai_hub as hub
Select a target device for Samsung Galaxy S23 with specifically Android 13:
device = hub.Device("Samsung Galaxy S23", "13")
Select a target device with OS major version 11:
device = hub.Device(os="[11,12)", attributes="os:android")
Select a target device with a Snapdragon 8 Gen 2 chipset:
device = hub.Device(attributes="chipset:qualcomm-snapdragon-8gen2")
Fetch a list of devices using
get_devices():devices = hub.get_devices()