From 5333c25baaf4fe136ed45edd6521dc7a2a5de851 Mon Sep 17 00:00:00 2001 From: Kevin Petit Date: Tue, 16 May 2023 09:08:48 +0100 Subject: Formalise the description of operator argument types - Standardise the terminology for operator arguments. Argument, Operand, and Parameter were used interchangeably. - Introduce a templatized tensor_t<> type for tensor arguments. Scalars are represented by rank-0 tensors. - Types can be checked with the XSD schema. Signed-off-by: Kevin Petit Change-Id: Ic57b9387950824e994c5e7f9ec1489c29159b974 --- tosa.xml | 533 ++++++++++++++++++++++++++++++++++----------------------------- 1 file changed, 285 insertions(+), 248 deletions(-) (limited to 'tosa.xml') diff --git a/tosa.xml b/tosa.xml index 430f5fd..678c6ac 100644 --- a/tosa.xml +++ b/tosa.xml @@ -16,15 +16,16 @@ ARGMAX - + Input tensor - + Axis in range from 0 to rank(shape1) - 1 + - + Output tensor, with rank = rank(shape1) - 1 @@ -51,23 +52,23 @@ AVG_POOL2D - + Input tensor - + [kernel_y, kernel_x] - + [stride_y, stride_x] - + [pad_top, pad_bottom, pad_left, pad_right] @@ -75,16 +76,19 @@ - + Enumerated type, must be one of INT32, FP16, FP32, as defined in the Supported Data Types table for this operation + - + Input tensor zero point. Must be zero for non-int8 types. + - + Output tensor zero point. Must be zero for non-int8 types. + - + Output tensor 4D @@ -115,21 +119,21 @@ CONV2D - + Input tensor - + Weight kernel size KH x KW - + Per output channel bias data. - + [pad_top, pad_bottom, pad_left, pad_right] @@ -137,23 +141,25 @@ - + [stride_y, stride_x] - + [dilation_y, dilation_x] - + Input tensor zero point. Must be zero for non-int8 types. + - + Weight zero point. Must be zero for non-int8 types. + - + Output tensor @@ -186,22 +192,22 @@ CONV3D - + Input tensor - + Weight kernel size KDxKHxKW - + Per output channel bias data. - + [pad_d0, pad_d1, pad_top, pad_bottom, pad_left, pad_right] @@ -211,24 +217,26 @@ - + [stride_d, stride_y, stride_x] - + [dilation_d, dilation_y, dilation_x] - + Input tensor zero point. Must be zero for non-int8 types. + - + Weight zero point. Must be zero for non-int8 types. + - + Output tensor @@ -261,21 +269,21 @@ DEPTHWISE_CONV2D - + Input tensor - + Weight kernel size KH x KW - + Per output channel bias data. - + [pad_top, pad_bottom, pad_left, pad_right] @@ -283,23 +291,25 @@ - + [stride_y, stride_x] - + [dilation_y, dilation_x] - + Input tensor zero point. Must be zero for non-int8 types. + - + Weight zero point. Must be zero for non-int8 types. + - + Output tensor @@ -332,24 +342,25 @@ FFT2D - + Real part of the complex input. H,W must be powers of two. - + Imaginary part of the complex input. H,W must be powers of two. - + false for forward FFT, true for inverse FFT + - + Real part of the complex output. - + Imaginary part of the complex output. @@ -365,25 +376,27 @@ FULLY_CONNECTED - + Input tensor - + Weights - + Per output channel bias data. - + Input tensor zero point. Must be zero for non-int8 types. + - + Weight zero point. Must be zero for non-int8 types. + - + Output tensor @@ -416,21 +429,23 @@ MATMUL - + Input tensor A, N matrices of size HxC - + Input tensor B, N matrices of size CxW - + Input tensor A zero point. Must be zero for non-int8 types. + - + Input tensor B zero point. Must be zero for non-int8 types. + - + Output tensor, N matrices of size HxW @@ -461,23 +476,23 @@ MAX_POOL2D - + Input tensor 4D - + [kernel_y, kernel_x] - + [stride_y, stride_x] - + [pad_top, pad_bottom, pad_left, pad_right] @@ -485,7 +500,7 @@ - + Output tensor 4D @@ -511,17 +526,17 @@ RFFT2D - + Real input. H,W must be powers of two. - + Real part of the complex output - + Imaginary part of the complex output. @@ -537,21 +552,21 @@ TRANSPOSE_CONV2D - + Input tensor - + Weight kernel size KH x KW - + Per output channel bias data. - + [out_pad_top, out_pad_bottom, out_pad_left, out_pad_right] @@ -559,23 +574,25 @@ - + [stride_y, stride_x] - + [N,OH,OW,OC] - + Input tensor zero point. Must be zero for non-int8 types. + - + Weight zero point. Must be zero for non-int8 types. + - + Output tensor @@ -610,18 +627,20 @@ CLAMP - + Input tensor - + Minimum clip value + - + Maximum clip value + - + Output tensor of same type and shape as input @@ -647,12 +666,12 @@ SIGMOID - + Input tensor - + Output tensor of same type and shape as input @@ -676,12 +695,12 @@ TANH - + Input tensor - + Output tensor of same type and shape as input @@ -707,15 +726,15 @@ ADD - + Input tensor - + Input tensor with the same rank as input1 - + Output tensor with broadcast shape if necessary @@ -741,18 +760,19 @@ ARITHMETIC_RIGHT_SHIFT - + Input tensor - + Input tensor with the same rank as input1 - + If true then the shift is rounded + - + Output tensor with broadcast shape if necessary @@ -768,15 +788,15 @@ BITWISE_AND - + Input tensor - + Input tensor with the same rank as input1 - + Output tensor with broadcast shape if necessary @@ -792,15 +812,15 @@ BITWISE_OR - + Input tensor - + Input tensor with the same rank as input1 - + Output tensor with broadcast shape if necessary @@ -816,15 +836,15 @@ BITWISE_XOR - + Input tensor - + Input tensor with the same rank as input1 - + Output tensor with broadcast shape if necessary @@ -840,15 +860,15 @@ INTDIV - + Input tensor - + Input tensor with the same rank as input1 - + Output tensor with broadcast shape if necessary @@ -862,15 +882,15 @@ LOGICAL_AND - + Input tensor - + Input tensor with the same rank as input1 - + Output tensor with broadcast shape if necessary @@ -884,15 +904,15 @@ LOGICAL_LEFT_SHIFT - + Input tensor - + Input tensor with the same rank as input1 - + Output tensor with broadcast shape if necessary @@ -908,15 +928,15 @@ LOGICAL_RIGHT_SHIFT - + Input tensor - + Input tensor with the same rank as input1 - + Output tensor with broadcast shape if necessary @@ -932,15 +952,15 @@ LOGICAL_OR - + Input tensor - + Input tensor with the same rank as input1 - + Output tensor with broadcast shape if necessary @@ -954,15 +974,15 @@ LOGICAL_XOR - + Input tensor - + Input tensor with the same rank as input1 - + Output tensor with broadcast shape if necessary @@ -976,15 +996,15 @@ MAXIMUM - + Input tensor - + Input tensor with the same rank as input1 - + Output tensor with broadcast shape if necessary @@ -1010,15 +1030,15 @@ MINIMUM - + Input tensor - + Input tensor with the same rank as input1 - + Output tensor with broadcast shape if necessary @@ -1044,18 +1064,19 @@ MUL - + Input tensor - + Input tensor with the same rank as input1 - + Result right shift (int32_t data type only) + - + Output tensor with broadcast shape if necessary @@ -1084,15 +1105,15 @@ POW - + Input tensor - + Input tensor with the same rank as input1 - + Output tensor with broadcast shape if necessary @@ -1117,15 +1138,15 @@ SUB - + Input tensor - + Input tensor with the same rank as input1 - + Output tensor with broadcast shape if necessary @@ -1151,15 +1172,15 @@ TABLE - + Input tensor - + Lookup table tensor - + Output tensor @@ -1179,12 +1200,12 @@ ABS - + Input tensor - + Output tensor of same type, size as the input tensor @@ -1209,12 +1230,12 @@ BITWISE_NOT - + Input tensor - + Output tensor of same type, size as the input tensor @@ -1229,12 +1250,12 @@ CEIL - + Input tensor - + Output tensor of same type, size as the input tensor @@ -1258,12 +1279,12 @@ CLZ - + Input tensor - + Output tensor of same type, size as the input tensor @@ -1276,12 +1297,12 @@ EXP - + Input tensor - + Output tensor of same type, size as the input tensor @@ -1305,12 +1326,12 @@ FLOOR - + Input tensor - + Output tensor of same type, size as the input tensor @@ -1334,12 +1355,12 @@ LOG - + Input tensor - + Output tensor of same type, size as the input tensor @@ -1363,12 +1384,12 @@ LOGICAL_NOT - + Input tensor - + Output tensor of same type, size as the input tensor @@ -1381,18 +1402,20 @@ NEGATE - + Input tensor - + Input 1 zero point. Must be zero for non-int8 types. + - + Output zero point. Must be zero for non-int8 types. + - + Output tensor of same type, size as the input tensor @@ -1420,12 +1443,12 @@ RECIPROCAL - + Input tensor - + Output tensor of same type, size as the input tensor @@ -1449,12 +1472,12 @@ RSQRT - + Input tensor - + Output tensor of same type, size as the input tensor @@ -1480,19 +1503,19 @@ SELECT - + Input selector tensor - + Input value tensor if input1 is True - + Input value tensor if input1 is False - + Output tensor of same type as input2 and input3, with broadcast shape if necessary @@ -1523,15 +1546,15 @@ EQUAL - + Input tensor - + Input tensor with the same rank as input1 - + Output tensor with broadcast shape if necessary @@ -1558,15 +1581,15 @@ GREATER - + Input tensor - + Input tensor with the same rank as input1 - + Output tensor with broadcast shape if necessary @@ -1593,15 +1616,15 @@ GREATER_EQUAL - + Input tensor - + Input tensor with the same rank as input1 - + Output tensor with broadcast shape if necessary @@ -1630,14 +1653,15 @@ REDUCE_ALL - + Input tensor - + Axis to reduce, in range from 0 to rank(shape1)-1 + - + Output tensor. Same rank as the input tensor. @@ -1650,14 +1674,15 @@ REDUCE_ANY - + Input tensor - + Axis to reduce, in range from 0 to rank(shape1)-1 + - + Output tensor. Same rank as the input tensor. @@ -1670,14 +1695,15 @@ REDUCE_MAX - + Input tensor - + Axis to reduce, in range from 0 to rank(shape1)-1 + - + Output tensor. Same rank as the input tensor. @@ -1704,14 +1730,15 @@ REDUCE_MIN - + Input tensor - + Axis to reduce, in range from 0 to rank(shape1)-1 + - + Output tensor. Same rank as the input tensor. @@ -1738,14 +1765,15 @@ REDUCE_PRODUCT - + Input tensor - + Axis to reduce, in range from 0 to rank(shape1)-1 + - + Output tensor. Same rank as the input tensor. @@ -1769,14 +1797,15 @@ REDUCE_SUM - + Input tensor with rank from 1 to 4 - + Axis to reduce, in range from 0 to rank(shape1)-1 + - + Output tensor. Same rank as the input tensor. @@ -1803,15 +1832,15 @@ CONCAT - - + List of input tensors. All inputs must have the same rank and data type - + Axis along which concatenation is to occur, in range from 0 to rank(shape)-1 + - + Output tensor @@ -1840,18 +1869,19 @@ PAD - + Input tensor - + Number of pad elements at the start and end of each dimension - + Constant value to be used as padding + - + Output tensor of same type as the input tensor @@ -1880,16 +1910,16 @@ RESHAPE - + Input tensor - + List of values, with each element giving the size of the result tensor for the given dimension. At most one dimension may be given as -1 to automatically calculate the dimension size. - + Output tensor of same type, size as the input tensor @@ -1918,15 +1948,16 @@ REVERSE - + Input tensor - + Axis to reverse, in range from 0 to rank(shape)-1 + - + Output tensor. Same shape as input tensor @@ -1954,21 +1985,21 @@ SLICE - + Input tensor - + List of integer coordinates, of length equal to the rank of input1. Start coordinate for slicing. - + List of integer size values, of length equal to the rank of input1. Size of the input to be used. - + Output tensor of same type as the input tensor @@ -1996,15 +2027,15 @@ used. TILE - + Input tensor - + Number of times to replicate input1 in each dimension - + Output tensor of same type, rank as the input tensor @@ -2033,15 +2064,15 @@ used. TRANSPOSE - + Input tensor - + List of integers of length equal to the rank of input1. Values must be valid dimensions within shape1, and may not be repeated. - + Output tensor of same type, rank as the input tensor @@ -2072,15 +2103,15 @@ used. GATHER - + 3D value tensor - + 2D index tensor - + 3D output tensor @@ -2107,19 +2138,19 @@ used. SCATTER - + 3D values in tensor - + 2D index tensor - + 3D input tensor - + 3D output tensor @@ -2148,28 +2179,29 @@ used. RESIZE - + Input tensor - + [scale_y_n, scale_y_d, scale_x_n, scale_x_d] - + [offset_y, offset_x] - + [border_y, border_x] - + BILINEAR or NEAREST + - + Output tensor @@ -2201,12 +2233,12 @@ used. CAST - + Input tensor - + Output tensor @@ -2319,37 +2351,42 @@ used. RESCALE - + Input tensor - + Output tensor with the same shape as input - + Input tensor zero point. Must be zero for non-int8 types. + - + Output tensor zero point. Must be zero for non-int8 types. + - + Scaling multiplier array - + Scaling shift array - + if (scale32) mul_t=int32_t else mul_t=int16_t + - + Select double round mode + - + if (per_channel) NC=shape[rank(shape)-1] else NC=1 + @@ -2380,11 +2417,11 @@ used. CONST - + Constant values - + Output tensor of the same type, size as the input tensor @@ -2413,11 +2450,11 @@ used. IDENTITY - + Input tensor - + Output tensor of the same type, size as the input tensor @@ -2447,20 +2484,20 @@ used. COND_IF - + Input condition as a size 1 tensor - + List of input tensors - + TOSA graph to execute if condition is true - + TOSA graph to execute if condition is false - + List of output tensors @@ -2468,16 +2505,16 @@ used. WHILE_LOOP - + List of input tensors - + TOSA graph to evaluate the condition - + TOSA graph to execute the loop body - + List of output tensors -- cgit v1.2.1