blob: d937395858bc81ce7fef8eaec374b804e1f3faf6 [file] [log] [blame]
Eric Kunzee5e26762020-10-13 16:11:07 -07001
2// Copyright (c) 2020, 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
29DEF_ATTRIBUTE(Pool2d, 3,
30 int32_t, V, padding,
31 int32_t, V, kernel,
32 int32_t, V, stride)
33
34DEF_ATTRIBUTE(Conv2d, 3,
35 int32_t, V, padding,
36 int32_t, V, stride,
37 int32_t, V, dilation)
38
39DEF_ATTRIBUTE(TransposeConv2d, 4,
40 int32_t, V, outpad,
41 int32_t, V, stride,
42 int32_t, V, dilation,
43 int32_t, V, output_shape)
44
45DEF_ATTRIBUTE(ReluN, 2,
46 int32_t, S, max_int,
47 float, S, max_fp)
48
49DEF_ATTRIBUTE(Axis, 1,
50 int32_t, S, axis)
51
52DEF_ATTRIBUTE(Reshape, 1,
53 int32_t, V, shape)
54
55DEF_ATTRIBUTE(Slice, 2,
56 int32_t, V, begin,
57 int32_t, V, size)
58
59DEF_ATTRIBUTE(Tile, 1,
60 int32_t, V, multiples)
61
62DEF_ATTRIBUTE(Resize, 5,
63 int32_t, V, output_size,
64 int32_t, V, stride,
65 int32_t, V, offset,
66 int32_t, S, shift,
67 ResizeMode, S, mode)
68
69DEF_ATTRIBUTE(Clamp, 4,
70 int32_t, S, min_int,
71 int32_t, S, max_int,
72 float, S, min_fp,
73 float, S, max_fp)
74
75DEF_ATTRIBUTE(Rescale, 7,
76 int32_t, S, input_zp,
77 int32_t, S, output_zp,
78 int32_t, V, multiplier,
79 int32_t, V, shift,
80 bool, S, scale32,
81 bool, S, double_round,
82 bool, S, per_channel)
83
Kevin Chengaee1fac2020-11-11 13:54:06 -080084DEF_ATTRIBUTE(Mul, 1,
85 int32_t, S, shift)
86
87DEF_ATTRIBUTE(ArithmeticRightShift, 1,
88 bool, S, round)
89
Eric Kunzee5e26762020-10-13 16:11:07 -070090DEF_ATTRIBUTE(CondIf, 2,
91 string, S, then_branch,
92 string, S, else_branch)
93
94DEF_ATTRIBUTE(WhileLoop, 2,
95 string, S, cond_branch,
96 string, S, body_branch)