Beaver.MLIR.Dialect.TOSA (beaver v0.4.7)
Summary
Functions
tosa.abs - Elementwise abs operator.
tosa.add - Elementwise addition operator.
tosa.apply_scale - Rescale scalar operator for Tosa tensor operators
tosa.argmax - Perform argmax on the input.
tosa.arithmetic_right_shift - Elementwise Arithmetic Right Shift.
tosa.avg_pool2d - Performs average pooling on the input.
tosa.bitwise_and - Bitwise AND operator.
tosa.bitwise_not - Bitwise NOT operator.
tosa.bitwise_or - Bitwise OR operator.
tosa.bitwise_xor - Bitwise XOR operator.
tosa.cast - Cast operation.
tosa.ceil - Elementwise ceil operator.
tosa.clamp - Computes clamp(features, min, max).
tosa.clz - Elementwise count leading zero operator.
tosa.concat - Concatenates tensors along one dimension.
tosa.cond_if - Conditional if operator.
tosa.const
tosa.const_shape
tosa.conv2d - 2D Convolution operator.
tosa.conv3d - 3D Convolution operator.
tosa.cos - Elementwise cos operator.
tosa.custom - Custom operator wrapper for Tosa
tosa.depthwise_conv2d - Depthwise 2D Convolution operator.
tosa.equal - Returns the truth value of (input1 == input2) element-wise.
tosa.erf - Computes gauss error function of input.
tosa.exp - Elementwise exp operator.
tosa.fft2d - Performs FFT2D operation on the input.
tosa.floor - Elementwise floor operator.
tosa.gather - Gather operation.
tosa.greater - Returns the truth value of (input1 > input2) element-wise.
tosa.greater_equal - Returns the truth value of (input1 >= input2) element-wise.
tosa.identity - Identity operator.
tosa.intdiv - Integer divide operator.
tosa.log - Elementwise log operator.
tosa.logical_and - Returns the truth value of input1 AND input2 element-wise.
tosa.logical_left_shift - Elementwise Logical Left Shift.
tosa.logical_not - Returns the truth value of NOT input1 element-wise.
tosa.logical_or - Returns the truth value of x OR y element-wise.
tosa.logical_right_shift - Elementwise Logical Right Shift.
tosa.logical_xor - Returns the truth value of input1 XOR input2 element-wise.
tosa.matmul - Matrix multiplication operator.
tosa.max_pool2d - Performs max pooling on the input.
tosa.maximum - Elementwise Maximum.
tosa.minimum - Elementwise Minimum.
tosa.mul - Multiplication operator.
tosa.negate - Elementwise negate operator.
tosa.pad - Pads a tensor with value specified.
tosa.pow - Computes the power of one value to another.
tosa.reciprocal - Elementwise reciprocal operator.
tosa.reduce_all - Reduce All operator.
tosa.reduce_any - Reduce Any operator.
tosa.reduce_max - Reduce Max operator.
tosa.reduce_min - Reduce Min operator.
tosa.reduce_product - Reduce Product operator.
tosa.reduce_sum - Reduce Sum operator.
tosa.rescale - Tosa rescale operator.
tosa.reshape - Reshape operator.
tosa.resize - Resize operation, supports various resize/upsample modes.
tosa.reverse - Reverse operator.
tosa.rfft2d - Performs RFFT2D operation on the input.
tosa.rsqrt - Elementwise 1/sqrt operator.
tosa.scatter - Scatter operation.
tosa.select - Elementwise select operator.
tosa.sigmoid - Computes elementwise sigmoid of input.
tosa.sin - Elementwise sin operator.
tosa.slice - Slice operator.
tosa.sub - Elementwise subtraction operator.
tosa.table - Table lookup operator.
tosa.tanh - Computes elementwise hyperbolic tangent of input.
tosa.tile - Tile operator.
tosa.transpose - Transpose operator.
tosa.transpose_conv2d - Transpose 2D Convolution operator.
tosa.variable
tosa.variable_read
tosa.variable_write - write_buffer operator
tosa.while_loop - output = input; While (Cond(output)) {output = Body(output)}
tosa.yield - yield operator
Functions
tosa.abs - Elementwise abs operator.
Operands
input1- Single,Tosa_Tensor, tosa-conformant tensor of number values
Results
output- Single,Tosa_Tensor, tosa-conformant tensor of number values
Description
Elementwise absolute value operation.
Example:
%output = tosa.abs(%input1) : (tensor<21x3xf32>) -> tensor<21x3xf32>
tosa.add - Elementwise addition operator.
Operands
input1- Single,Tosa_Tensor, tosa-conformant tensor of number valuesinput2- Single,Tosa_Tensor, tosa-conformant tensor of number values
Results
output- Single,Tosa_Tensor, tosa-conformant tensor of number values
Description
Elementwise addition of input1 and input2. Axis of size 1 will be broadcast, as necessary. Rank of input tensors must match.
Example:
// Elementwise addition.
%out = tosa.add %input1, %input2 : tensor<12x6xf32>, tensor<12x6xf32> -> tensor<12x6xf32>
// Elementwise addition with broadcasting.
%out = tosa.add %input1, %input2 : tensor<12x6xsi32>, tensor<1x1xsi32> -> tensor<12x6xsi32>
tosa.apply_scale - Rescale scalar operator for Tosa tensor operators
Attributes
rounding_mode- Single,Tosa_RoundingModeAttr, Supported rounding modes
Operands
value- Single,Tosa_IntLike, signless-integer-likemultiplier- Single,Tosa_IntLike, signless-integer-likeshift- Single,Tosa_Int8Like, signless-integer-8-bit-like
Results
output- Single,Tosa_IntLike, signless-integer-like
Description
Applies rescaling for fixed point values. This behavior is replicated in multiple quantized operations (mul, convolution, rescale, matmul, pooling).
The commonplace implementation is to use i64 operations to avoid integer overflow with target specific implementations can use native operations to avoid wider than necessary types.
tosa.argmax - Perform argmax on the input.
Attributes
axis- Single,I32Attr, 32-bit signless integer attributenan_mode- Single,Tosa_NanPropagationModeAttr, Supported NaN propagation strategies
Operands
input- Single,Tosa_TensorAtLeast1D, tosa-conformant tensor of at least rank 1
Results
output- Single,Tosa_Tensor, tosa-conformant tensor of number values
Description
This returns the index with the largest value across the given axis of the input tensor. If multiple locations have equal values, returns the first match along the search axis.
tosa.arithmetic_right_shift - Elementwise Arithmetic Right Shift.
Attributes
round- Single,BoolAttr, bool attribute
Operands
input1- Single,Tosa_Tensor, tosa-conformant tensor of number valuesinput2- Single,Tosa_Tensor, tosa-conformant tensor of number values
Results
output- Single,Tosa_Tensor, tosa-conformant tensor of number values
Description
Elementwise arithmetic right shift of input1 by the amount specified in input2. Axis of size 1 will be broadcast, as necessary. Rank of input tensors must match.
tosa.avg_pool2d - Performs average pooling on the input.
Attributes
kernel- Single,Tosa_IntArrayAttr2, i64 dense array attribute with exactly 2 elementsstride- Single,Tosa_IntArrayAttr2, i64 dense array attribute with exactly 2 elementspad- Single,Tosa_IntArrayAttr4, i64 dense array attribute with exactly 4 elementsacc_type- Single, anonymous/composite constraint, type attribute of 32-bit signless integer or 48-bit signless integer or 16-bit float or 32-bit float
Operands
input- Single,Tosa_Tensor4D, 4-d tosa-conformant tensorinput_zp- Single,Tosa_ScalarIntOrFloatTensor, tosa-conformant unranked tensor of unsigned integer or signless integer or floating-point values or tosa-conformant scalar tensor of unsigned integer or signless integer or floating-point valuesoutput_zp- Single,Tosa_ScalarIntOrFloatTensor, tosa-conformant unranked tensor of unsigned integer or signless integer or floating-point values or tosa-conformant scalar tensor of unsigned integer or signless integer or floating-point values
Results
output- Single,Tosa_Tensor4D, 4-d tosa-conformant tensor
Description
This performs an average pooling over the given input tensor. A sliding window of size given by <kernel size> is passed over the input tensor, with the mean value being placed in the output tensor. When calculating the average, only the number of valid input tensor values, but not padding, are used to calculate the divisor.
tosa.bitwise_and - Bitwise AND operator.
Operands
input1- Single,Tosa_Tensor, tosa-conformant tensor of number valuesinput2- Single,Tosa_Tensor, tosa-conformant tensor of number values
Results
output- Single,Tosa_Tensor, tosa-conformant tensor of number values
Description
Elementwise bitwise AND of input1 and input2. Axis of size 1 will be broadcast as necessary. Rank of input tensors must match.
tosa.bitwise_not - Bitwise NOT operator.
Operands
input1- Single,Tosa_Tensor, tosa-conformant tensor of number values
Results
output- Single,Tosa_Tensor, tosa-conformant tensor of number values
Description
Elementwise bitwise NOT of input tensor.
tosa.bitwise_or - Bitwise OR operator.
Operands
input1- Single,Tosa_Tensor, tosa-conformant tensor of number valuesinput2- Single,Tosa_Tensor, tosa-conformant tensor of number values
Results
output- Single,Tosa_Tensor, tosa-conformant tensor of number values
Description
Elementwise bitwise OR of input1 and input2. Axis of size 1 will be broadcast as necessary. Rank of input tensors must match.
tosa.bitwise_xor - Bitwise XOR operator.
Operands
input1- Single,Tosa_Tensor, tosa-conformant tensor of number valuesinput2- Single,Tosa_Tensor, tosa-conformant tensor of number values
Results
output- Single,Tosa_Tensor, tosa-conformant tensor of number values
Description
Elementwise bitwise XOR of input1 and input2. Axis of size 1 will be broadcast as necessary. Rank of input tensors must match.
tosa.cast - Cast operation.
Operands
input- Single,Tosa_Tensor, tosa-conformant tensor of number values
Results
output- Single,Tosa_Tensor, tosa-conformant tensor of number values
Description
Casts a tensor from one data type to another.
- This table is showing the supported conversions from the TOSA Specification.
- The MLIR dialect here can be used to represent other conversions.
| Mode | Input | Output |
|---|---|---|
| fp16 to fp32 | float16 | float32 |
| fp16 to int 16 | float16 | int16 |
| fp16 to int 32 | float16 | int32 |
| fp16 to int 8 | float16 | int8 |
| fp32 to fp16 | float32 | float16 |
| fp32 to int 16 | float32 | int16 |
| fp32 to int 32 | float32 | int32 |
| fp32 to int 8 | float32 | int8 |
| int 16 to fp16 | int16 | float16 |
| int 16 to fp32 | int16 | float32 |
| int 32 to fp16 | int32 | float16 |
| int 32 to fp32 | int32 | float32 |
| int 8 to fp16 | int8 | float16 |
| int 8 to fp32 | int8 | float32 |
| bool to int 16 | Boolean | int16 |
| bool to int 32 | Boolean | int32 |
| bool to int 8 | Boolean | int8 |
| int 16 to bool | int16 | Boolean |
| int 16 to int 32 | int16 | int32 |
| int 16 to int 8 | int16 | int8 |
| int 32 to bool | int32 | Boolean |
| int 32 to int 16 | int32 | int16 |
| int 32 to int 8 | int32 | int8 |
| int 8 to bool | int8 | Boolean |
| int 8 to int 16 | int8 | int16 |
| int 8 to int 32 | int8 | int32 |
| bf16 to fp32 | bf16 | float32 |
| bf16 to int 16 | bf16 | int16 |
| bf16 to int 32 | bf16 | int32 |
| bf16 to int 8 | bf16 | int8 |
| fp32 to bf16 | float32 | bf16 |
| int 16 to bf16 | int16 | bf16 |
| int 32 to bf16 | int32 | bf16 |
| int 8 to bf16 | int8 | bf16 |
| bf16 to fp8e4m3 | bf16 | fp8e4m3 |
| fp8e4m3 to bf16 | fp8e4m3 | bf16 |
| bf16 to fp8e5m2 | bf16 | fp8e5m2 |
| fp8e5m2 to bf16 | fp8e5m2 | bf16 |
| fp16 to fp8e4m3 | float16 | fp8e4m3 |
| fp32 to fp8e4m3 | float32 | fp8e4m3 |
| fp8e4m3 to fp16 | fp8e4m3 | float16 |
| fp8e4m3 to fp32 | fp8e4m3 | float32 |
| fp16 to fp8e5m2 | float16 | fp8e5m2 |
| fp32 to fp8e5m2 | float32 | fp8e5m2 |
| fp8e5m2 to fp16 | fp8e5m2 | float16 |
| fp8e5m2 to fp32 | fp8e5m2 | float32 |
tosa.ceil - Elementwise ceil operator.
Operands
input1- Single,Tosa_Tensor, tosa-conformant tensor of number values
Results
output- Single,Tosa_Tensor, tosa-conformant tensor of number values
Description
Elementwise ceiling operation.
tosa.clamp - Computes clamp(features, min, max).
Attributes
min_val- Single,Tosa_IntOrFloatAttr, arbitrary integer attribute or arbitrary float attributemax_val- Single,Tosa_IntOrFloatAttr, arbitrary integer attribute or arbitrary float attributenan_mode- Single,Tosa_NanPropagationModeAttr, Supported NaN propagation strategies
Operands
input- Single,Tosa_Tensor, tosa-conformant tensor of number values
Results
output- Single,Tosa_Tensor, tosa-conformant tensor of number values
Description
Clamp to an arbitrary minimum and maximum value. Maximum and minimum values are specified as values in the range of the input type. No zero point subtraction is done to the values, thus to clamp to the zero point value, the zero point itself should be supplied as the minimum value.
tosa.clz - Elementwise count leading zero operator.
Operands
input1- Single,Tosa_Tensor, tosa-conformant tensor of number values
Results
output- Single,Tosa_Tensor, tosa-conformant tensor of number values
Description
Elementwise count leading zeros operation.
tosa.concat - Concatenates tensors along one dimension.
This op has support for result type inference.
Attributes
axis- Single,I32Attr, 32-bit signless integer attribute
Operands
input1- Variadic,Tosa_TensorAtLeast1D, variadic of tosa-conformant tensor of at least rank 1
Results
output- Single,Tosa_TensorAtLeast1D, tosa-conformant tensor of at least rank 1
Description
Concatenate a list of tensors along a given axis. No data conversion happens during a concat operation.
tosa.cond_if - Conditional if operator.
Operands
condition- Single,Tosa_I1Tensor, tosa-conformant tensor of 1-bit signless integer valuesinput_list- Variadic,Tosa_Tensor, variadic of tosa-conformant tensor of number values
Results
output_list- Variadic,Tosa_Tensor, variadic of tosa-conformant tensor of number values
Description
Evaluates a Boolean condition and then takes one of two distinct execution paths. This implements the semantic If-then-else structure.
tosa.const
tosa.const_shape
tosa.conv2d - 2D Convolution operator.
Attributes
pad- Single,Tosa_IntArrayAttr4, i64 dense array attribute with exactly 4 elementsstride- Single,Tosa_IntArrayAttr2, i64 dense array attribute with exactly 2 elementsdilation- Single,Tosa_IntArrayAttr2, i64 dense array attribute with exactly 2 elementsacc_type- Single, anonymous/composite constraint, type attribute of 32-bit signless integer or 48-bit signless integer or 16-bit float or 32-bit floatlocal_bound- Optional,BoolAttr, bool attribute
Operands
input- Single,Tosa_Tensor4D, 4-d tosa-conformant tensorweight- Single,Tosa_Tensor4D, 4-d tosa-conformant tensorbias- Single,Tosa_Tensor1D, 1-d tosa-conformant tensorinput_zp- Single,Tosa_ScalarIntOrFloatTensor, tosa-conformant unranked tensor of unsigned integer or signless integer or floating-point values or tosa-conformant scalar tensor of unsigned integer or signless integer or floating-point valuesweight_zp- Single,Tosa_ScalarIntOrFloatTensor, tosa-conformant unranked tensor of unsigned integer or signless integer or floating-point values or tosa-conformant scalar tensor of unsigned integer or signless integer or floating-point values
Results
output- Single,Tosa_Tensor4D, 4-d tosa-conformant tensor
Description
Performs a 2D convolution over the given tensor input, using the weight tensor. Implementations may choose to skip calculation of multiplies in the padding area.
tosa.conv3d - 3D Convolution operator.
Attributes
pad- Single,Tosa_IntArrayAttr6, i64 dense array attribute with exactly 6 elementsstride- Single,Tosa_IntArrayAttr3, i64 dense array attribute with exactly 3 elementsdilation- Single,Tosa_IntArrayAttr3, i64 dense array attribute with exactly 3 elementsacc_type- Single, anonymous/composite constraint, type attribute of 32-bit signless integer or 48-bit signless integer or 16-bit float or 32-bit floatlocal_bound- Optional,BoolAttr, bool attribute
Operands
input- Single,Tosa_Tensor5D, 5-d tosa-conformant tensorweight- Single,Tosa_Tensor5D, 5-d tosa-conformant tensorbias- Single,Tosa_Tensor1D, 1-d tosa-conformant tensorinput_zp- Single,Tosa_ScalarIntOrFloatTensor, tosa-conformant unranked tensor of unsigned integer or signless integer or floating-point values or tosa-conformant scalar tensor of unsigned integer or signless integer or floating-point valuesweight_zp- Single,Tosa_ScalarIntOrFloatTensor, tosa-conformant unranked tensor of unsigned integer or signless integer or floating-point values or tosa-conformant scalar tensor of unsigned integer or signless integer or floating-point values
Results
output- Single,Tosa_Tensor5D, 5-d tosa-conformant tensor
Description
Performs a 3D convolution over the given input tensor. Implementations may choose to skip calculation of multiplies in the padding area.
tosa.cos - Elementwise cos operator.
Operands
input1- Single,Tosa_FloatTensor, tosa-conformant tensor of floating-point values
Results
output- Single,Tosa_FloatTensor, tosa-conformant tensor of floating-point values
Description
Elementwise cosine operation for values given in radians.
tosa.custom - Custom operator wrapper for Tosa
Attributes
operator_name- Single,StrAttr, string attributedomain_name- Single,StrAttr, string attributeimplementation_attrs- Single,StrAttr, string attribute
Operands
input_list- Variadic,Tosa_Tensor, variadic of tosa-conformant tensor of number values
Results
output_list- Variadic,Tosa_Tensor, variadic of tosa-conformant tensor of number values
Description
Hardware implementing TOSA may choose to add additional custom operators that are not expressed in the existing TOSA operations. These operators are not expected to be portable across TOSA implementations. The input and output signatures must be expressed in the corresponding TOSA node.
operator_name is a string that tells the backend which custom operator is
being called.
domain_name is a string identifier which can help avoid name collisions on
the identifier field.
implementation_attrs is a string which is a backend and identifier specific
set of attributes to the custom operator.
input_list is the set of tensor inputs to the custom operator.
output_list is the list of tensors returned by the operator. The number of operators
is backend specific.
Example:
%out = tosa.custom %in {domain_name = "tosa_mlir_test", operator_name =
"custom_test", implementation_attrs = ""}: (tensor<10xi32>) ->
(tensor<10xi32>)
tosa.depthwise_conv2d - Depthwise 2D Convolution operator.
Attributes
pad- Single,Tosa_IntArrayAttr4, i64 dense array attribute with exactly 4 elementsstride- Single,Tosa_IntArrayAttr2, i64 dense array attribute with exactly 2 elementsdilation- Single,Tosa_IntArrayAttr2, i64 dense array attribute with exactly 2 elementsacc_type- Single, anonymous/composite constraint, type attribute of 32-bit signless integer or 48-bit signless integer or 16-bit float or 32-bit floatlocal_bound- Optional,BoolAttr, bool attribute
Operands
input- Single,Tosa_Tensor4D, 4-d tosa-conformant tensorweight- Single,Tosa_Tensor4D, 4-d tosa-conformant tensorbias- Single,Tosa_Tensor1D, 1-d tosa-conformant tensorinput_zp- Single,Tosa_ScalarIntOrFloatTensor, tosa-conformant unranked tensor of unsigned integer or signless integer or floating-point values or tosa-conformant scalar tensor of unsigned integer or signless integer or floating-point valuesweight_zp- Single,Tosa_ScalarIntOrFloatTensor, tosa-conformant unranked tensor of unsigned integer or signless integer or floating-point values or tosa-conformant scalar tensor of unsigned integer or signless integer or floating-point values
Results
output- Single,Tosa_Tensor4D, 4-d tosa-conformant tensor
Description
Performs 2D convolutions separately over each channel of the given tensor input, using the weight tensor. Implementations may choose to skip calculation of multiplies in the padding area.
tosa.equal - Returns the truth value of (input1 == input2) element-wise.
This op has support for result type inference.
Operands
input1- Single,Tosa_Tensor, tosa-conformant tensor of number valuesinput2- Single,Tosa_Tensor, tosa-conformant tensor of number values
Results
output- Single,Tosa_I1Tensor, tosa-conformant tensor of 1-bit signless integer values
Description
Elementwise comparison operation.
tosa.erf - Computes gauss error function of input.
Operands
input- Single,Tosa_Tensor, tosa-conformant tensor of number values
Results
output- Single,Tosa_Tensor, tosa-conformant tensor of number values
Description
Gauss error function: $ erf(x) = \frac{2}{\sqrt{\pi}} \int_{0}^{x} e^{-t^2} dt $ For quantized integer data types, the TABLE operator should be used instead with the following definition. The ERF table has 513 entries each of 16-bit precision and covering the input range -4.0 to +4.0 in steps of 1/64.
tosa.exp - Elementwise exp operator.
Operands
input1- Single,Tosa_Tensor, tosa-conformant tensor of number values
Results
output- Single,Tosa_Tensor, tosa-conformant tensor of number values
Description
Elementwise e to the x operation
tosa.fft2d - Performs FFT2D operation on the input.
Attributes
inverse- Single,BoolAttr, bool attributelocal_bound- Optional,BoolAttr, bool attribute
Operands
input_real- Single,Tosa_Tensor3D, 3-d tosa-conformant tensorinput_imag- Single,Tosa_Tensor3D, 3-d tosa-conformant tensor
Results
output_real- Single,Tosa_Tensor3D, 3-d tosa-conformant tensoroutput_imag- Single,Tosa_Tensor3D, 3-d tosa-conformant tensor
Description
Performs a batched complex 2D Fast Fourier Transform over the input. The complex input values are constructed from the corresponding values in the input_real and input_imag tensors. The resulting values in the output are split into the output_real and output_imag tensors. No normalization is applied on either the forward or inverse versions of the operation.
Example:
%output_real, %output_imag = tosa.fft2d %input_real, %input_imag : (tensor<8x9xf32>, tensor<8x9xf32>) -> (tensor<8x9xf32>, tensor<8x9xf32>)
tosa.floor - Elementwise floor operator.
Operands
input1- Single,Tosa_Tensor, tosa-conformant tensor of number values
Results
output- Single,Tosa_Tensor, tosa-conformant tensor of number values
Description
Elementwise floor operation.
tosa.gather - Gather operation.
Operands
values- Single,Tosa_Tensor3D, 3-d tosa-conformant tensorindices- Single,Tosa_Int32Tensor2D, tosa-conformant unranked tensor of number values or 2D tensor of 32-bit signless integer values
Results
output- Single,Tosa_Tensor3D, 3-d tosa-conformant tensor
Description
Generate a tensor for which each element in the output is a subtensor of the values tensor based on the indices. N is the number of batches, W the number of indices in each batch, K the range of each index and C the number data channels for each index.
tosa.greater - Returns the truth value of (input1 > input2) element-wise.
Operands
input1- Single,Tosa_Tensor, tosa-conformant tensor of number valuesinput2- Single,Tosa_Tensor, tosa-conformant tensor of number values
Results
output- Single,Tosa_I1Tensor, tosa-conformant tensor of 1-bit signless integer values
Description
Elementwise greater than comparison operation.
tosa.greater_equal - Returns the truth value of (input1 >= input2) element-wise.
Operands
input1- Single,Tosa_Tensor, tosa-conformant tensor of number valuesinput2- Single,Tosa_Tensor, tosa-conformant tensor of number values
Results
output- Single,Tosa_I1Tensor, tosa-conformant tensor of 1-bit signless integer values
Description
Elementwise comparison operation.
tosa.identity - Identity operator.
Operands
input1- Single,Tosa_Tensor, tosa-conformant tensor of number values
Results
output- Single,Tosa_Tensor, tosa-conformant tensor of number values
Description
Returns a tensor with the same shape, type, and contents as the input.
tosa.intdiv - Integer divide operator.
Operands
input1- Single,Tosa_Int32Tensor, tosa-conformant tensor of 32-bit signless integer valuesinput2- Single,Tosa_Int32Tensor, tosa-conformant tensor of 32-bit signless integer values
Results
output- Single,Tosa_Int32Tensor, tosa-conformant tensor of 32-bit signless integer values
Description
Elementwise integer divide of input1 by input2. Axis of size 1 will be broadcast as necessary. Rank of input tensors must match. The result of the divide is truncated towards zero. Expected use is for operations on non-scaled integers. Floating point divide should use RECIPROCAL and MUL. Quantized integer divide should use TABLE (for 1/x) and MUL.
tosa.log - Elementwise log operator.
Operands
input1- Single,Tosa_Tensor, tosa-conformant tensor of number values
Results
output- Single,Tosa_Tensor, tosa-conformant tensor of number values
Description
Elementwise natural logarithm operation
tosa.logical_and - Returns the truth value of input1 AND input2 element-wise.
Operands
input1- Single,Tosa_I1Tensor, tosa-conformant tensor of 1-bit signless integer valuesinput2- Single,Tosa_I1Tensor, tosa-conformant tensor of 1-bit signless integer values
Results
output- Single,Tosa_I1Tensor, tosa-conformant tensor of 1-bit signless integer values
Description
Elementwise logical AND of input1 and input2. Axis of size 1 will be broadcast, as necessary. Rank of input tensors must match.
tosa.logical_left_shift - Elementwise Logical Left Shift.
Operands
input1- Single,Tosa_Tensor, tosa-conformant tensor of number valuesinput2- Single,Tosa_Tensor, tosa-conformant tensor of number values
Results
output- Single,Tosa_Tensor, tosa-conformant tensor of number values
Description
Elementwise logical left-shift of input1 by the amount specified in input2. Axis of size 1 will be broadcast, as necessary. Rank of input tensors must match.
tosa.logical_not - Returns the truth value of NOT input1 element-wise.
Operands
input1- Single,Tosa_I1Tensor, tosa-conformant tensor of 1-bit signless integer values
Results
output- Single,Tosa_I1Tensor, tosa-conformant tensor of 1-bit signless integer values
Description
Elementwise logical NOT of input.
tosa.logical_or - Returns the truth value of x OR y element-wise.
Operands
input1- Single,Tosa_I1Tensor, tosa-conformant tensor of 1-bit signless integer valuesinput2- Single,Tosa_I1Tensor, tosa-conformant tensor of 1-bit signless integer values
Results
output- Single,Tosa_I1Tensor, tosa-conformant tensor of 1-bit signless integer values
Description
Elementwise logical OR of input1 and input2. Axis of size 1 will be broadcast as necessary. Rank of input tensors must match.
tosa.logical_right_shift - Elementwise Logical Right Shift.
Operands
input1- Single,Tosa_Tensor, tosa-conformant tensor of number valuesinput2- Single,Tosa_Tensor, tosa-conformant tensor of number values
Results
output- Single,Tosa_Tensor, tosa-conformant tensor of number values
Description
Elementwise logical right shift of input1 by the amount specified in input2. Axis of size 1 will be broadcast, as necessary. Rank of input tensors must match.
tosa.logical_xor - Returns the truth value of input1 XOR input2 element-wise.
Operands
input1- Single,Tosa_I1Tensor, tosa-conformant tensor of 1-bit signless integer valuesinput2- Single,Tosa_I1Tensor, tosa-conformant tensor of 1-bit signless integer values
Results
output- Single,Tosa_I1Tensor, tosa-conformant tensor of 1-bit signless integer values
Description
Elementwise logical XOR of input1 and input2. Axis of size 1 will be broadcast as necessary. Rank of input tensors must match.
tosa.matmul - Matrix multiplication operator.
Operands
a- Single,Tosa_Tensor3D, 3-d tosa-conformant tensorb- Single,Tosa_Tensor3D, 3-d tosa-conformant tensora_zp- Single,Tosa_ScalarIntOrFloatTensor, tosa-conformant unranked tensor of unsigned integer or signless integer or floating-point values or tosa-conformant scalar tensor of unsigned integer or signless integer or floating-point valuesb_zp- Single,Tosa_ScalarIntOrFloatTensor, tosa-conformant unranked tensor of unsigned integer or signless integer or floating-point values or tosa-conformant scalar tensor of unsigned integer or signless integer or floating-point values
Results
output- Single,Tosa_Tensor3D, 3-d tosa-conformant tensor
Description
Performs two dimensional matrix multiplications.
tosa.max_pool2d - Performs max pooling on the input.
Attributes
kernel- Single,Tosa_IntArrayAttr2, i64 dense array attribute with exactly 2 elementsstride- Single,Tosa_IntArrayAttr2, i64 dense array attribute with exactly 2 elementspad- Single,Tosa_IntArrayAttr4, i64 dense array attribute with exactly 4 elementsnan_mode- Single,Tosa_NanPropagationModeAttr, Supported NaN propagation strategies
Operands
input- Single,Tosa_Tensor4D, 4-d tosa-conformant tensor
Results
output- Single,Tosa_Tensor4D, 4-d tosa-conformant tensor
Description
This performs a max pooling over the given input tensor. A sliding window of size given by <kernel size> is passed over the input tensor, with the maximum value being placed in the output tensor.
tosa.maximum - Elementwise Maximum.
Attributes
nan_mode- Single,Tosa_NanPropagationModeAttr, Supported NaN propagation strategies
Operands
input1- Single,Tosa_Tensor, tosa-conformant tensor of number valuesinput2- Single,Tosa_Tensor, tosa-conformant tensor of number values
Results
output- Single,Tosa_Tensor, tosa-conformant tensor of number values
Description
Elementwise max of input1 and input2. Axis of size 1 will be broadcast, as necessary. Rank of input tensors must match.
tosa.minimum - Elementwise Minimum.
Attributes
nan_mode- Single,Tosa_NanPropagationModeAttr, Supported NaN propagation strategies
Operands
input1- Single,Tosa_Tensor, tosa-conformant tensor of number valuesinput2- Single,Tosa_Tensor, tosa-conformant tensor of number values
Results
output- Single,Tosa_Tensor, tosa-conformant tensor of number values
Description
Elementwise minimum of input1 and input2. Axis of size 1 will be broadcast, as necessary. Rank of input tensors must match.
tosa.mul - Multiplication operator.
Operands
input1- Single,Tosa_Tensor, tosa-conformant tensor of number valuesinput2- Single,Tosa_Tensor, tosa-conformant tensor of number valuesshift- Single,Tosa_ScalarInt8Tensor, tosa-conformant unranked tensor of 8-bit signless integer values or tosa-conformant scalar tensor of 8-bit signless integer values
Results
output- Single,Tosa_Tensor, tosa-conformant tensor of number values
Description
Elementwise multiplication (Hadamard product) of input1 and input2. Axis of size 1 will be broadcast, as necessary. Rank of input tensors must match.
tosa.negate - Elementwise negate operator.
Operands
input1- Single,Tosa_Tensor, tosa-conformant tensor of number valuesinput1_zp- Single,Tosa_ScalarIntOrFloatTensor, tosa-conformant unranked tensor of unsigned integer or signless integer or floating-point values or tosa-conformant scalar tensor of unsigned integer or signless integer or floating-point valuesoutput_zp- Single,Tosa_ScalarIntOrFloatTensor, tosa-conformant unranked tensor of unsigned integer or signless integer or floating-point values or tosa-conformant scalar tensor of unsigned integer or signless integer or floating-point values
Results
output- Single,Tosa_Tensor, tosa-conformant tensor of number values
Description
Elementwise negation operation.
tosa.pad - Pads a tensor with value specified.
Operands
input1- Single,Tosa_TensorAtLeast1D, tosa-conformant tensor of at least rank 1padding- Single,Tosa_Shape, Shape with static rank and Index element typepad_const- Single,Tosa_ScalarTensor, tosa-conformant unranked tensor of unsigned integer or signless integer or floating-point values or tosa-conformant scalar tensor of number values
Results
output- Single,Tosa_TensorAtLeast1D, tosa-conformant tensor of at least rank 1
Description
Pads a tensor along the borders of each dimension with a supplied value. Returns a new tensor with the padding included. The pad_const value includes the zero point if the tensor uses a zero point.
Example:
%pad_const = "tosa.const"() {values = dense<3.14> : tensor<1xf32>} : () -> tensor<1xf32>
%padding = tosa.const_shape {values = dense<[1, 2, 3, 4]> : tensor<4xindex>} : () -> !tosa.shape<4>
tosa.pad %arg0, %padding, %pad_const: (tensor<1x2xf32>, !tosa.shape<4>, tensor<1xf32>) -> (tensor<4x9xf32>)Example 2:
%pad_const = "tosa.const"() {values = dense<3.14> : tensor<1xf32>} : () -> tensor<1xf32>
%padding = tosa.const_shape {values = dense<[-1, 2, 3, 4]> : tensor<4xindex>} : () -> !tosa.shape<4>
tosa.pad %arg0, %padding, %pad_const : (tensor<1x2xf32>, !tosa.shape<4>, tensor<1xf32>) -> (tensor<?x9xf32>)
tosa.pow - Computes the power of one value to another.
Operands
input1- Single,Tosa_Tensor, tosa-conformant tensor of number valuesinput2- Single,Tosa_Tensor, tosa-conformant tensor of number values
Results
output- Single,Tosa_Tensor, tosa-conformant tensor of number values
Description
Elementwise input1 value raised to the power of input2. Axis of size 1 will be broadcast, as necessary. Rank of input tensors must match.
tosa.reciprocal - Elementwise reciprocal operator.
Operands
input1- Single,Tosa_Tensor, tosa-conformant tensor of number values
Results
output- Single,Tosa_Tensor, tosa-conformant tensor of number values
Description
Elementwise reciprocal operation. For integer operation, a TABLE should be used with the appropriate ranges.
tosa.reduce_all - Reduce All operator.
This op has support for result type inference.
Attributes
axis- Single,I32Attr, 32-bit signless integer attribute
Operands
input- Single,Tosa_TensorAtLeast1D, tosa-conformant tensor of at least rank 1
Results
output- Single,Tosa_TensorAtLeast1D, tosa-conformant tensor of at least rank 1
Description
Reduce a tensor along the given axis with a logical AND operation.
tosa.reduce_any - Reduce Any operator.
This op has support for result type inference.
Attributes
axis- Single,I32Attr, 32-bit signless integer attribute
Operands
input- Single,Tosa_TensorAtLeast1D, tosa-conformant tensor of at least rank 1
Results
output- Single,Tosa_TensorAtLeast1D, tosa-conformant tensor of at least rank 1
Description
Reduce a tensor along the given axis with a logical OR operation.
tosa.reduce_max - Reduce Max operator.
This op has support for result type inference.
Attributes
axis- Single,I32Attr, 32-bit signless integer attributenan_mode- Single,Tosa_NanPropagationModeAttr, Supported NaN propagation strategies
Operands
input- Single,Tosa_TensorAtLeast1D, tosa-conformant tensor of at least rank 1
Results
output- Single,Tosa_TensorAtLeast1D, tosa-conformant tensor of at least rank 1
Description
Reduce a tensor along the given axis with a maximum operation.
tosa.reduce_min - Reduce Min operator.
This op has support for result type inference.
Attributes
axis- Single,I32Attr, 32-bit signless integer attributenan_mode- Single,Tosa_NanPropagationModeAttr, Supported NaN propagation strategies
Operands
input- Single,Tosa_TensorAtLeast1D, tosa-conformant tensor of at least rank 1
Results
output- Single,Tosa_TensorAtLeast1D, tosa-conformant tensor of at least rank 1
Description
Reduce a tensor along the given axis with a minimum operation.
tosa.reduce_product - Reduce Product operator.
This op has support for result type inference.
Attributes
axis- Single,I32Attr, 32-bit signless integer attribute
Operands
input- Single,Tosa_TensorAtLeast1D, tosa-conformant tensor of at least rank 1
Results
output- Single,Tosa_TensorAtLeast1D, tosa-conformant tensor of at least rank 1
Description
Reduce a tensor along the given axis by computing the product of the axis.
tosa.reduce_sum - Reduce Sum operator.
This op has support for result type inference.
Attributes
axis- Single,I32Attr, 32-bit signless integer attribute
Operands
input- Single,Tosa_TensorAtLeast1D, tosa-conformant tensor of at least rank 1
Results
output- Single,Tosa_TensorAtLeast1D, tosa-conformant tensor of at least rank 1
Description
Reduce a tensor along the given axis by computing the sum of the axis.
tosa.rescale - Tosa rescale operator.
Attributes
scale32- Single,BoolAttr, bool attributerounding_mode- Single,Tosa_RoundingModeAttr, Supported rounding modesper_channel- Single,BoolAttr, bool attributeinput_unsigned- Single,BoolAttr, bool attributeoutput_unsigned- Single,BoolAttr, bool attribute
Operands
input- Single,Tosa_Tensor, tosa-conformant tensor of number valuesmultiplier- Single,Tosa_1DInt16Or32Tensor, 1D tensor of 16-bit signless integer or 32-bit signless integer valuesshift- Single,Tosa_1DInt8Tensor, 1D tensor of 8-bit signless integer valuesinput_zp- Single,Tosa_ScalarIntOrFloatTensor, tosa-conformant unranked tensor of unsigned integer or signless integer or floating-point values or tosa-conformant scalar tensor of unsigned integer or signless integer or floating-point valuesoutput_zp- Single,Tosa_ScalarIntOrFloatTensor, tosa-conformant unranked tensor of unsigned integer or signless integer or floating-point values or tosa-conformant scalar tensor of unsigned integer or signless integer or floating-point values
Results
output- Single,Tosa_Tensor, tosa-conformant tensor of number values
Description
RESCALE is defined using an integer multiply, add, and shift.
Rescale supports two precisions of multiplier: 16-bit and 32-bit. The 32-bit multiplier version supports two rounding modes to enable simpler lowering of existing frameworks that use two stage rounding. All arithmetic is designed so that it does not overflow a 64-bit accumulator and that the result fits in 32 bits. In particular, a 48-bit value cannot be scaled with the 32-bit multiplier because the accumulator would need to have 80 bits.
The shift and value range are limited to allow a variety of implementations. The limit of 62 on shift allows the shift to be decomposed as two right shifts of 31.
Supported rescalings:
- This table is showing the supported conversions from the TOSA Specification.
- The MLIR dialect here can be used to represent other conversions.
| Mode | Input | Output | Unsigned input | Unsigned output |
|---|---|---|---|---|
| signed 16 to 16 | int16 | int16 | false | false |
| signed 16 to 32 | int16 | int32 | false | false |
| signed 16 to 8 | int16 | int8 | false | false |
| signed 32 to 16 | int32 | int16 | false | false |
| signed 32 to 32 | int32 | int32 | false | false |
| signed 32 to 8 | int32 | int8 | false | false |
| signed 8 to 16 | int8 | int16 | false | false |
| signed 8 to 32 | int8 | int32 | false | false |
| signed 8 to 8 | int8 | int8 | false | false |
| signed 48 to 16 | int48 | int16 | false | false |
| signed 48 to 32 | int48 | int32 | false | false |
| signed 48 to 8 | int48 | int8 | false | false |
| unsigned 8 to signed 8 | uint8 | int8 | true | false |
| signed 8 to unsigned 8 | int8 | uint8 | false | true |
tosa.reshape - Reshape operator.
This op has support for result type inference.
Operands
input1- Single,Tosa_Tensor, tosa-conformant tensor of number valuesshape- Single,Tosa_Shape, Shape with static rank and Index element type
Results
output- Single,Tosa_Tensor, tosa-conformant tensor of number values
Description
Returns a tensor with the same type/values as the input, with a new shape specified by the shape argument. Reshape may operate on tensors of any rank. No data conversion happens during a reshape operation.
tosa.resize - Resize operation, supports various resize/upsample modes.
Attributes
mode- Single,Tosa_ResizeModeAttr, Supported resize/upsampling strategies
Operands
input- Single,Tosa_Tensor4D, 4-d tosa-conformant tensorscale- Single,Rank4TosaShape, Tosa shape type of rank 4offset- Single,Rank2TosaShape, Tosa shape type of rank 2border- Single,Rank2TosaShape, Tosa shape type of rank 2
Results
output- Single,Tosa_Tensor4D, 4-d tosa-conformant tensor
Description
Resizes a tensor. Resize is only allowed in the H and W dimensions.
The height dimension is scaled by factor (scale_y_n/scale_y_d). The width dimension is scaled by factor (scale_x_n/scale_x_d).
The NEAREST_NEIGHBOR mode returns the value of the input tensor closest to the calculated sample position for both floating-point and integer data formats.
Floating-point BILINEAR mode returns a bilinearly interpolated output value based on the four closest input sample positions.
For integer BILINEAR interpolation mode, the output value must be scaled by 1/(scale_y_n * scale_x_n) in a following operation to complete the interpolation (for example with a RESCALE operator).
The output dimensions can be derived from the input dimensions by inverting the scale as described in the pseudocode. The [border_y, border_x] values adjust the output size to allow fractional sampling beyond integer input position (IH - 1,IW - 1).
The limit MAX_SCALE is applied to each scale ratio after reduction of the ratio. Individual scale numerator and denominator values are allowed to be larger than MAX_SCALE.
tosa.reverse - Reverse operator.
Attributes
axis- Single,I32Attr, 32-bit signless integer attribute
Operands
input1- Single,Tosa_TensorAtLeast1D, tosa-conformant tensor of at least rank 1
Results
output- Single,Tosa_TensorAtLeast1D, tosa-conformant tensor of at least rank 1
Description
Returns a tensor with the same type/values as the input, with the data reversed along the given axis. No data conversion happens during a reverse operation.
tosa.rfft2d - Performs RFFT2D operation on the input.
Attributes
local_bound- Optional,BoolAttr, bool attribute
Operands
input_real- Single,Tosa_Tensor3D, 3-d tosa-conformant tensor
Results
output_real- Single,Tosa_Tensor3D, 3-d tosa-conformant tensoroutput_imag- Single,Tosa_Tensor3D, 3-d tosa-conformant tensor
Description
Performs a batched 2D real-valued Fast Fourier Transform over the input where the input tensor consists of real values producing complex valued output. The complex output values will be split into the output_real and output_imag tensor arguments. RFFT2D takes advantage of Hermitian symmetry to only calculate the first half of the final output axis. Implementations may choose to skip calculation of the imaginary values at (0,0), (0,W/2), (H/2,0), and (H/2, W/2). If the calculation is skipped, the result at that location must be zero.
Example:
%ouput_real, %output_imag = tosa.rfft2d %input_real : (tensor<8x16xf32>) -> (tensor<8x9xf32>, tensor<8x9xf32>)
tosa.rsqrt - Elementwise 1/sqrt operator.
Operands
input1- Single,Tosa_Tensor, tosa-conformant tensor of number values
Results
output- Single,Tosa_Tensor, tosa-conformant tensor of number values
Description
Elementwise reciprocal square root operation. For integer operation, a TABLE should be used with the appropriate ranges.
tosa.scatter - Scatter operation.
Operands
values_in- Single,Tosa_Tensor3D, 3-d tosa-conformant tensorindices- Single,Tosa_Int32Tensor2D, tosa-conformant unranked tensor of number values or 2D tensor of 32-bit signless integer valuesinput- Single,Tosa_Tensor3D, 3-d tosa-conformant tensor
Results
values_out- Single,Tosa_Tensor3D, 3-d tosa-conformant tensor
Description
The values_out tensor is set to the values_in tensor with data modified as follows: data from the input tensor is inserted at the positions specified by the indices tensor. N is the number of batches, W the number of indices in each batch, K the range of each index and C the number data channels for each index. It is not permitted to repeat the same output index within a single SCATTER operation and so each output index occurs at most once. It follows that K >= W. In use cases that require multiple updates to the same output position, these must be decomposed into multiple SCATTER operations.
tosa.select - Elementwise select operator.
Operands
input1- Single,Tosa_I1Tensor, tosa-conformant tensor of 1-bit signless integer valuesinput2- Single,Tosa_Tensor, tosa-conformant tensor of number valuesinput3- Single,Tosa_Tensor, tosa-conformant tensor of number values
Results
output- Single,Tosa_Tensor, tosa-conformant tensor of number values
Description
Elementwise select of the output based on a condition.
tosa.sigmoid - Computes elementwise sigmoid of input.
Operands
input- Single,Tosa_Tensor, tosa-conformant tensor of number values
Results
output- Single,Tosa_Tensor, tosa-conformant tensor of number values
Description
Applies the sigmoid logistic function to each element of the input tensor: $ sigmoid(x) = \frac{1}{1 + e^{-x}} $.
For quantized integer data types, the TABLE operator should be used instead. Each implementation may choose an appropriate TABLE given the scale and zero point of the input data. Eight or sixteen bit precision tables may be used based on the input tensor to the sigmoid function.
tosa.sin - Elementwise sin operator.
Operands
input1- Single,Tosa_FloatTensor, tosa-conformant tensor of floating-point values
Results
output- Single,Tosa_FloatTensor, tosa-conformant tensor of floating-point values
Description
Elementwise sine operation for values given in radians.
tosa.slice - Slice operator.
Operands
input1- Single,Tosa_TensorAtLeast1D, tosa-conformant tensor of at least rank 1start- Single,Tosa_Shape, Shape with static rank and Index element typesize- Single,Tosa_Shape, Shape with static rank and Index element type
Results
output- Single,Tosa_TensorAtLeast1D, tosa-conformant tensor of at least rank 1
Description
Extracts a slice of input1, beginning at the start coordinates, and extending for size elements in each direction. No data conversion happens during a slice operation.
tosa.sub - Elementwise subtraction operator.
Operands
input1- Single,Tosa_Tensor, tosa-conformant tensor of number valuesinput2- Single,Tosa_Tensor, tosa-conformant tensor of number values
Results
output- Single,Tosa_Tensor, tosa-conformant tensor of number values
Description
Elementwise subtraction of input1 and input2. Axis of size 1 will be broadcast as necessary. Rank of input tensors must match.
tosa.table - Table lookup operator.
Operands
input1- Single,Tosa_Tensor, tosa-conformant tensor of number valuestable- Single,Tosa_Tensor1D, 1-d tosa-conformant tensor
Results
output- Single,Tosa_Tensor, tosa-conformant tensor of number values
Description
Table lookup operation. For int8_t TABLE operation, perform a 256 entry table lookup returning an int8_t value. For int16_t tables, the int16_t input is treated as a fixed-point 9.7 value. The most significant 9 bits are used to index into the table. The fractional 7 bits are used to interpolate based on table[index] and table[index+1]. For int16_t inputs, the TABLE operator returns a 16.7 interpolated value in an int32_t. This value can then be input to the RESCALE operator to scale to the required output data type. Note that int16_t table has 513 values to handle table[index+1] when index=511.
An int16_t to int16_t table lookup can be constructed in TOSA as follows:
- Use the TABLE operator to produce a fixed point 16.7 interpolated result
- Use RESCALE (in_t=int32_t, out_t=int16_t, scale=1<<14, shift=21) to scale the output to int16_t range (or alternate scale as required)
tosa.tanh - Computes elementwise hyperbolic tangent of input.
Operands
input- Single,Tosa_Tensor, tosa-conformant tensor of number values
Results
output- Single,Tosa_Tensor, tosa-conformant tensor of number values
Description
Parameterized hyperbolic tangent: $ tanh(x) = \frac{1 - e^{-2x}}{1 + e^{-2x}} $.
For quantized integer data types, the TABLE operator should be used instead. Each implementation may choose an appropriate TABLE given the scale and zero point of the input data. Eight or sixteen bit precision tables may be used based on the input tensor to the tanh function.
tosa.tile - Tile operator.
Operands
input1- Single,Tosa_TensorAtLeast1D, tosa-conformant tensor of at least rank 1multiples- Single,Tosa_Shape, Shape with static rank and Index element type
Results
output- Single,Tosa_TensorAtLeast1D, tosa-conformant tensor of at least rank 1
Description
Replicates input1 multiples times along each dimension.
tosa.transpose - Transpose operator.
Attributes
perms- Single,DenseI32ArrayAttr, i32 dense array attribute
Operands
input1- Single,Tosa_TensorAtLeast1D, tosa-conformant tensor of at least rank 1
Results
output- Single,Tosa_TensorAtLeast1D, tosa-conformant tensor of at least rank 1
Description
Permutes the dimensions of the input tensor input1 based on the perms argument. Each value in the perms list must be a valid dimension of the input tensor and may not be repeated.
tosa.transpose_conv2d - Transpose 2D Convolution operator.
Attributes
out_pad- Single,Tosa_IntArrayAttr4, i64 dense array attribute with exactly 4 elementsstride- Single,Tosa_IntArrayAttr2, i64 dense array attribute with exactly 2 elementsacc_type- Single, anonymous/composite constraint, type attribute of 32-bit signless integer or 48-bit signless integer or 16-bit float or 32-bit floatlocal_bound- Optional,BoolAttr, bool attribute
Operands
input- Single,Tosa_Tensor4D, 4-d tosa-conformant tensorweight- Single,Tosa_Tensor4D, 4-d tosa-conformant tensorbias- Single,Tosa_Tensor1D, 1-d tosa-conformant tensorinput_zp- Single,Tosa_ScalarIntOrFloatTensor, tosa-conformant unranked tensor of unsigned integer or signless integer or floating-point values or tosa-conformant scalar tensor of unsigned integer or signless integer or floating-point valuesweight_zp- Single,Tosa_ScalarIntOrFloatTensor, tosa-conformant unranked tensor of unsigned integer or signless integer or floating-point values or tosa-conformant scalar tensor of unsigned integer or signless integer or floating-point values
Results
output- Single,Tosa_Tensor4D, 4-d tosa-conformant tensor
Description
Performs a 2D transposed convolution over the given tensor input, using the weights tensor. Implementations may choose to skip calculation of multiplies by zero at fractional input positions.
tosa.variable
tosa.variable_read
tosa.variable_write - write_buffer operator
Attributes
name- Single,SymbolNameAttr, string attribute
Operands
input1- Single,Tosa_Tensor, tosa-conformant tensor of number values
Description
Assigns a value to the pseudo-buffer resource holding a persistent mutable tensor.
tosa.while_loop - output = input; While (Cond(output)) {output = Body(output)}
Operands
input_list- Variadic,Tosa_Tensor, variadic of tosa-conformant tensor of number values
Results
output_list- Variadic,Tosa_Tensor, variadic of tosa-conformant tensor of number values
Description
Generates and evaluates a Boolean condition and either executes a loop body or exits the loop. This action is performed repeatedly after updating and re-evaluating the Boolean condition every iteration. This implements the semantic foreach or while iterative loop structure.
tosa.yield - yield operator
Operands
inputs- Variadic,Tosa_Tensor, variadic of tosa-conformant tensor of number values
Description
return operation within the conditional and body of structured control flow. Operation takes variadic operands but produces no results of its own.