options
Classes
AirOperatorOptions
Marker base for operator-specific configurations.
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.
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).
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).
AirAddOptions
Options for the ADD 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).
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).
AirDequantizeOptions
Options for the DEQUANTIZE operator.
AirExpandDimsOptions
Options for the EXPAND_DIMS operator.
AirFillOptions
Options for the FILL operator.
Attributes:
-
fill_value
(int
) –The value to fill the output tensor with (default 0).
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.
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).
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).
AirSplitOptions
AirSqueezeOptions
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_shape
tuple[int, ...]
) –The shape of the input tensor.
-
pad_to
int
, 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.
AirTransposeOptions
AirUnpackOptions
AirZerosLikeOptions
Options for the ZEROS_LIKE operator.
Attributes:
-
zero_point
(int
) –The zero point for the ZEROS_LIKE 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_type
AirOpType
) –The operator type to look up.
Returns:
-
type[AirOperatorOptions]
–type[AirOperatorOptions]: The options class for the operator type.