options
Classes
AirOperatorOptions
Marker base for operator-specific configurations.
AirAddOptions
Options for the ADD operator.
Attributes:
-
activation(AirActivationType) –fused activation function (default NONE).
AirSubOptions
Options for the SUB operator.
Attributes:
-
activation(AirActivationType) –fused activation function (default NONE).
AirAssignVariableOptions
Options for the ASSIGN_VARIABLE operator.
AirAveragePool2DOptions
Options for the AVERAGE_POOL_2D operator.
Attributes:
-
padding_height(int) –number of rows to pad at top & bottom (default 0).
-
padding_width(int) –number of columns to pad at left & right (default 0).
-
stride_height(int) –vertical step between pooling windows (default 1).
-
stride_width(int) –horizontal step between pooling windows (default 1).
-
filter_height(int) –height of the pooling window (default 1).
-
filter_width(int) –width of the pooling window (default 1).
-
activation(AirActivationType) –fused activation function (default NONE).
AirBatchMatMulOptions
Options for the BATCH_MATMUL operator.
Attributes:
-
adj_x(bool) –If True, transpose the first (left) input matrix before multiplication (default False).
-
adj_y(bool) –If True, transpose the second (right) input matrix before multiplication (default False).
-
asymmetric_quantize_inputs(bool) –If True, use asymmetric quantization for inputs (default False).
AirBatchToSpaceNDOptions
AirConcatenationOptions
Options for the CONCATENATION operator.
Attributes:
-
axis(int) –Axis along which to concatenate the input tensors (default 0).
-
activation(AirActivationType) –Activation function to apply after concatenation (default NONE).
AirConv2DOptions
Options for CONV_2D.
Attributes:
-
padding_height(int) –padding for top & bottom (default 0).
-
padding_width(int) –padding for left & right (default 0).
-
stride_height(int) –vertical stride (default 1).
-
stride_width(int) –horizontal stride (default 1).
-
dilation_height(int) –vertical dilation (default 1).
-
dilation_width(int) –horizontal dilation (default 1).
-
activation(AirActivationType) –fused activation function (default NONE).
-
bias_tensor_type(AirTensorType) –bias tensor type.
-
upscale_height(int) –implicit height upscaling factor applied before convolution.
-
upscale_width(int) –implicit width upscaling factor applied before convolution.
AirDepthToSpaceOptions
Options for the DEPTH_TO_SPACE operator.
Attributes:
-
block_size(int) –The size of the spatial block (default 0).
AirDepthwiseConv2DOptions
Options for the DEPTHWISE_CONV_2D operator.
Attributes:
-
depth_multiplier(int) –number of output channels per input channel (default 1).
-
padding_height(int) –padding for top & bottom (default 0).
-
padding_width(int) –padding for left & right (default 0).
-
stride_height(int) –vertical stride (default 1).
-
stride_width(int) –horizontal stride (default 1).
-
dilation_height(int) –vertical dilation factor (default 1).
-
dilation_width(int) –horizontal dilation factor (default 1).
-
activation(AirActivationType) –fused activation function (default NONE).
AirDequantizeOptions
Options for the DEQUANTIZE operator.
AirExpandDimsOptions
Options for the EXPAND_DIMS operator.
AirFillOptions
Options for the FILL operator.
AirFullyConnectedOptions
Options for the FULLY_CONNECTED operator.
Attributes:
-
activation(AirActivationType) –Fused activation function (default NONE).
-
weights_format(FullyConnectedWeightsFormat) –Memory layout of the weights matrix (default DEFAULT, i.e. row-major).
-
keep_num_dims(bool) –If True, preserve the input's rank in the output. Otherwise, collapse to 2D (default False).
-
asymmetric_quantize_inputs(bool) –If True, use asymmetric quantization for inputs (default False).
-
bias_tensor_type(AirTensorType) –Data type of the bias tensor. FLOAT32 for hybrid/dynamic-range quant, INT32 for full-integer quant (default FLOAT32).
AirHardSwishOptions
Options for the HARD_SWISH operator.
AirLeakyReluOptions
Options for the LEAKY_RELU operator.
Attributes:
-
alpha(float) –The slope for negative values (default 0.2).
AirLogisticOptions
Options for the LOGISTIC operator.
AirMaxPool2DOptions
Options for the MAX_POOL_2D operator.
Attributes:
-
padding_height(int) –number of rows to pad at top & bottom (default 0).
-
padding_width(int) –number of columns to pad at left & right (default 0).
-
stride_height(int) –vertical step between pooling windows (default 1).
-
stride_width(int) –horizontal step between pooling windows (default 1).
-
filter_height(int) –height of the pooling window (default 1).
-
filter_width(int) –width of the pooling window (default 1).
-
activation(AirActivationType) –fused activation function (default NONE).
AirMaximumOptions
Options for the Maximum operator.
AirMeanOptions
AirMinimumOptions
Options for the Minimum operator.
AirComparisonOptions
Options shared by comparison operators.
AirMulOptions
Options for the MUL operator.
Attributes:
-
activation(AirActivationType) –Fused activation function to apply after multiplication (default NONE).
AirPackOptions
AirPadOptions
AirQuantizeOptions
Options for the QUANTIZE operator.
AirReadVariableOptions
Options for the READ_VARIABLE operator.
Attributes:
-
init_value(int) –Initial value for the variable (default 0).
AirReduceMaxOptions
AirReduceMinOptions
AirArgMaxOptions
Options for the ARG_MAX operator.
AirArgMinOptions
Options for the ARG_MIN operator.
AirReluOptions
Options for the RELU operator.
Attributes:
-
relu_type(AirReluType) –Type of ReLU activation to use (default RELU).
AirReshapeOptions
AirShapeOptions
Options for the SHAPE operator.
Attributes:
-
out_type(int) –The data type of the output tensor (default 0).
AirSoftmaxOptions
Options for the SOFTMAX operator.
Attributes:
-
beta(float) –The beta parameter for softmax scaling (default 1.0).
AirSpaceToBatchNDOptions
AirSpaceToDepthOptions
Options for the SPACE_TO_DEPTH operator.
Attributes:
-
block_size(int) –The size of the spatial block (default 0).
AirSplitOptions
AirSqueezeOptions
AirSliceOptions
AirGatherOptions
Options for the GATHER operator.
AirGatherNdOptions
Options for the GATHER_ND operator.
AirStridedSliceOptions
Options for STRIDED_SLICE operator.
Attributes:
-
begin(tuple[int, int, int, int]) –Begin indices for each dimension.
-
end(tuple[int, int, int, int]) –End indices for each dimension.
-
stride(tuple[int, int, int, int]) –Stride values for each dimension.
-
begin_mask(int) –Mask for begin indices (default 0).
-
end_mask(int) –Mask for end indices (default 0).
-
ellipsis_mask(int) –Mask for ellipsis (default 0).
-
new_axis_mask(int) –Mask for new axes (default 0).
-
shrink_axis_mask(int) –Mask for shrink axes (default 0).
-
offset(bool) –If True, apply offset to the begin and end indices (default False).
Functions
get_slices
Compute (begin, end, stride) for each axis, padding dims and shape to pad_to dims.
Parameters:
-
(input_shapetuple[int, ...]) –The shape of the input tensor.
-
(pad_toint, default:4) –The number of dimensions to pad the input shape to (default 4).
Returns:
-
list[AirStrideSlice]–A list of AirStrideSlice, each containing (begin, end, stride) for each axis.
AirTanhOptions
Options for the TANH operator.
AirEthosUOptions
Options for the ETHOS_U operator.
Attributes:
-
co_type(int) –Command-stream type identifier encoded by Vela (default 0).
-
command_stream_size(int) –Size in bytes of the command stream tensor.
-
num_base_addresses(int) –Total number of base addresses (inputs excluding command stream plus outputs).
-
custom_options_format(int) –LiteRT CustomOptionsFormat value for the operator.
-
custom_options(tuple[int, ...]) –Raw custom options payload (typically Flexbuffers encoded).
AirTransposeConvOptions
Options for the TRANSPOSE_CONV operator.
Attributes:
-
padding_height(int) –pixels to pad input top & bottom (default 0).
-
padding_width(int) –pixels to pad input left & right (default 0).
-
padding_offsets_height(int) –Padding for top & bottom offsets (default 0).
-
padding_offsets_width(int) –Padding for left & right offsets (default 0).
-
stride_height(int) –vertical stride (default 1).
-
stride_width(int) –horizontal stride (default 1).
-
dilation_height(int) –vertical dilation factor (default 1).
-
dilation_width(int) –horizontal dilation factor (default 1).
-
activation(AirActivationType) –fused activation (default NONE).
-
bias_tensor_type(AirTensorType) –bias tensor type (default FLOAT32).
AirTransposeOptions
AirUnpackOptions
AirSvdfOptions
Options for the SVDF operator.
Attributes:
-
rank(int) –The rank of the SVDF operation (default 1).
-
activation(AirActivationType) –Fused activation function (default NONE).
-
asymmetric_quantize_inputs(bool) –If True, use asymmetric quantization for inputs (default False).
AirZerosLikeOptions
Options for the ZEROS_LIKE operator.
Attributes:
-
zero_point(int) –The zero point for the ZEROS_LIKE operator.
AirPreluOptions
Options for the PReLU operator.
Functions
register_op_options
Decorator that
1) Ensures the decorated class inherits from AirOperatorOptions, 2) Converts it into a @dataclass(**dataclass_kwargs), 3) Registers it under the given op_type string, 4) Returns the resulting dataclass.
Usage
@register_op_options("Conv2D") class AirConv2DOptions: ... fields ...
get_options_class
Retrieve the registered options dataclass for a given op_type.
If not found, falls back to the base AirOperatorOptions.
Parameters:
-
(op_typeAirOpType) –The operator type to look up.
Returns:
-
type[AirOperatorOptions]–type[AirOperatorOptions]: The options class for the operator type.