blob: 38f6d29458f3c1ddc39723348437143cfb1b1d11 [file] [log] [blame]
Eric Kunze2364dcd2021-04-26 11:06:57 -07001
2// Copyright (c) 2020-2021, ARM Limited.
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16/*
17 Syntax:
18 DEF_ATTRIBUTE(ATTRIBUTE_NAME, NUM_ARGS_IN_ATTRIBUTES, ARG0_TYPE, ARG0_SCALAR_OR_VECTOR, ARGS0_NAME, ...)
19
20 Description:
21 ATTRIBUTE_NAME: corresponding attribute name, must match corresponding "table XXXAttribute" in tosa.fbs
22 NUM_ARGS_IN_ATTRIBUTES: number of arguments in this attribute
23 ARG0_TYPE: data type of arg0 in attribute
24 ARG0_SCALAR_OR_VECTOR: is arg0 a scalar(S) or a vector(V)
25 ARG0_NAME: name of arg0
26 ...: variadic variables for more arguments, depending on NUM_ARGS_IN_ATTRIBUTES
27*/
28
Kevin Cheng79a41992021-08-31 16:04:40 -070029DEF_ATTRIBUTE(Pool, 3,
TatWai Chong7be71652022-05-10 17:26:20 -070030 int32_t, V, pad,
Eric Kunze2364dcd2021-04-26 11:06:57 -070031 int32_t, V, kernel,
32 int32_t, V, stride)
33
Kevin Cheng79a41992021-08-31 16:04:40 -070034DEF_ATTRIBUTE(Conv, 3,
TatWai Chong7be71652022-05-10 17:26:20 -070035 int32_t, V, pad,
Eric Kunze2364dcd2021-04-26 11:06:57 -070036 int32_t, V, stride,
37 int32_t, V, dilation)
38
Kevin Cheng79a41992021-08-31 16:04:40 -070039DEF_ATTRIBUTE(TransposeConv, 4,
Eric Kunze2364dcd2021-04-26 11:06:57 -070040 int32_t, V, outpad,
41 int32_t, V, stride,
42 int32_t, V, dilation,
43 int32_t, V, output_shape)
44
Kevin Cheng38d214c2021-10-15 15:49:19 -070045DEF_ATTRIBUTE(Pad, 3,
46 int32_t, V, padding,
47 int32_t, S, pad_const_int,
48 float, S, pad_const_fp)
Eric Kunze2364dcd2021-04-26 11:06:57 -070049
50DEF_ATTRIBUTE(Axis, 1,
51 int32_t, S, axis)
52
53DEF_ATTRIBUTE(Reshape, 1,
TatWai Chong7be71652022-05-10 17:26:20 -070054 int32_t, V, new_shape)
Eric Kunze2364dcd2021-04-26 11:06:57 -070055
56DEF_ATTRIBUTE(Slice, 2,
TatWai Chong7be71652022-05-10 17:26:20 -070057 int32_t, V, start,
Eric Kunze2364dcd2021-04-26 11:06:57 -070058 int32_t, V, size)
59
60DEF_ATTRIBUTE(Tile, 1,
61 int32_t, V, multiples)
62
63DEF_ATTRIBUTE(Resize, 7,
64 int32_t, V, output_size,
65 int32_t, V, stride,
66 int32_t, V, offset,
67 int32_t, S, shift,
68 float, V, stride_fp,
69 float, V, offset_fp,
70 ResizeMode, S, mode)
71
72DEF_ATTRIBUTE(Clamp, 4,
73 int32_t, S, min_int,
74 int32_t, S, max_int,
75 float, S, min_fp,
76 float, S, max_fp)
77
78DEF_ATTRIBUTE(Rescale, 7,
79 int32_t, S, input_zp,
80 int32_t, S, output_zp,
81 int32_t, V, multiplier,
82 int32_t, V, shift,
83 bool, S, scale32,
84 bool, S, double_round,
85 bool, S, per_channel)
86
87DEF_ATTRIBUTE(Mul, 1,
88 int32_t, S, shift)
89
90DEF_ATTRIBUTE(ArithmeticRightShift, 1,
91 bool, S, round)
92
93DEF_ATTRIBUTE(CondIf, 2,
94 string, S, then_branch,
95 string, S, else_branch)
96
97DEF_ATTRIBUTE(WhileLoop, 2,
98 string, S, cond_branch,
99 string, S, body_branch)
Kevin Cheng38d214c2021-10-15 15:49:19 -0700100
101DEF_ATTRIBUTE(Transpose, 1,
TatWai Chong7be71652022-05-10 17:26:20 -0700102 int32_t, V, perms)
Kevin Cheng38d214c2021-10-15 15:49:19 -0700103
104DEF_ATTRIBUTE(Table, 1,
TatWai Chong7be71652022-05-10 17:26:20 -0700105 int16_t, V, table)
Kevin Cheng38d214c2021-10-15 15:49:19 -0700106