Compile Options

class Framework(value)[source]

Bases: str, Enum

An enumeration.

PYTORCH = 'pytorch'
ONNX = 'onnx'
ONNXRUNTIME = 'onnxruntime'
AIMET = 'aimet'
TENSORFLOW = 'tensorflow'
TFLITE = 'tensorflow_lite'
COREML = 'coreml'
TENSORRT = 'tensorrt'
QNN = 'qnn'
class Extension(value)[source]

Bases: str, Enum

An enumeration.

ONNX = '.onnx'
PT = '.pt'
AIMET = '.aimet'
H5 = '.h5'
class Runtime(value)[source]

Bases: str, Enum

An enumeration.

TFLITE = 'tflite'
QNN_LIB_AARCH64_ANDROID = 'qnn_lib_aarch64_android'
QNN_CONTEXT_BINARY = 'qnn_context_binary'
ONNX = 'onnx'
PRECOMPILED_QNN_ONNX = 'precompiled_qnn_onnx'
class QuantizeFullType(value)[source]

Bases: str, Enum

An enumeration.

INT8 = 'int8'
INT16 = 'int16'
W8A16 = 'w8a16'
W4A8 = 'w4a8'
W4A16 = 'w4a16'
class QuantizeWeightType(value)[source]

Bases: str, Enum

An enumeration.

FP16 = 'float16'
class CompileOptions(compute_unit: List[ComputeUnit] | None = None, target_runtime: Runtime | None = Runtime.TFLITE, output_names: str | None = None, truncate_64bit_tensors: bool | None = False, truncate_64bit_io: bool | None = False, force_channel_last_input: str | None = None, force_channel_last_output: str | None = None, quantize_full_type: QuantizeFullType | None = None, quantize_weight_type: QuantizeWeightType | None = None, quantize_io: bool | None = False, quantize_io_type: str | None = None, qnn_graph_name: str | None = None, qnn_context_binary_vtcm: str | None = None, qnn_context_binary_optimization_level: int | None = None)[source]

Bases: CommonOptions

Compile options for the model.

Note

For details, see CompileOptions in QAI Hub API.

target_runtime: Runtime | None = 'tflite'
output_names: str | None = None
truncate_64bit_tensors: bool | None = False
truncate_64bit_io: bool | None = False
force_channel_last_input: str | None = None
force_channel_last_output: str | None = None
quantize_full_type: QuantizeFullType | None = None
quantize_weight_type: QuantizeWeightType | None = None
quantize_io: bool | None = False
quantize_io_type: str | None = None
qnn_graph_name: str | None = None
qnn_context_binary_vtcm: str | None = None
qnn_context_binary_optimization_level: int | None = None
to_cli_string() str[source]