1/*
2 * Copyright (c) 2023 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16package ohos.hdi.nnrt.v2_0;
17
18import ohos.hdi.nnrt.v2_0.NnrtTypes;
19
20struct Activation
21{
22    enum ActivationType activationType;
23    float alpha;
24    float minVal;
25    float maxVal;
26    boolean approximate;
27};
28
29struct AddFusion
30{
31    enum ActivationType activationType;
32};
33
34struct ArgMaxFusion
35{
36    long axis;
37    long topK;
38    boolean keepDims;
39    boolean outMaxValue;
40};
41
42struct AvgPoolFusion
43{
44    long[] kernelSize;
45    long[] strides;
46    long[] pad;
47    enum PadMode padMode;
48    enum RoundMode roundMode;
49    enum Format format;
50    boolean global;
51    enum ActivationType activationType;
52};
53
54struct BatchToSpaceND
55{
56    long[] blockShape;
57    long[][] crops;
58};
59
60struct BiasAdd
61{
62};
63
64struct Cast
65{
66};
67
68struct Concat
69{
70    long axis;
71};
72
73struct Conv2DFusion
74{
75    long[] kernelSize;
76    long[] stride;
77    long[] dilation;
78    enum PadMode padMode;
79    long[] padList;
80    long group;
81    long inChannel;
82    long outChannel;
83    enum ActivationType activationType;
84};
85
86struct Conv2dTransposeFusion
87{
88    long[] kernelSize;
89    long[] stride;
90    long[] dilation;
91    enum PadMode padMode;
92    long[] padList;
93    long group;
94    long inChannel;
95    long outChannel;
96    enum ActivationType activationType;
97    long[] outputPaddings;
98};
99
100struct DivFusion
101{
102    enum ActivationType activationType;
103};
104
105struct Eltwise
106{
107    enum EltwiseMode mode;
108};
109
110struct ExpandDims
111{
112};
113
114struct Fill
115{
116};
117
118struct FullConnection
119{
120    boolean hasBias;
121    boolean useAxis;
122    long axis;
123    enum ActivationType activationType;
124};
125
126struct FusedBatchNorm
127{
128    float epsilon;
129};
130
131struct Gather
132{
133};
134
135struct LayerNormFusion
136{
137    long beginNormAxis;
138    float epsilon;
139    boolean elementwiseAffine;
140    long beginParamsAxis;
141};
142
143struct LessEqual
144{
145};
146
147struct MatMulFusion
148{
149    boolean transposeA;
150    boolean transposeB;
151    enum ActivationType activationType;
152};
153
154struct Maximum
155{
156};
157
158struct MaxPoolFusion
159{
160    long[] kernelSize;
161    long[] strides;
162    long[] pad;
163    enum PadMode padMode;
164    enum Format format;
165    enum RoundMode roundMode;
166    boolean global;
167    enum ActivationType activationType;
168};
169
170struct MulFusion
171{
172    enum ActivationType activationType;
173};
174
175struct OneHot
176{
177    long axis;
178};
179
180struct PadFusion
181{
182    long[][] paddings;
183    enum PaddingMode paddingMode;
184    float constantValue;
185};
186
187struct PowFusion
188{
189    float scale;
190    float shift;
191};
192
193struct PReLUFusion
194{
195    boolean channelShared;
196};
197
198struct QuantDTypeCast
199{
200    long srcT;
201    long dstT;
202};
203
204struct ReduceFusion
205{
206    boolean keepDims;
207    enum ReduceMode mode;
208    boolean reduceToEnd;
209    float coeff;
210};
211
212struct Reshape
213{
214};
215
216struct Resize
217{
218    enum ResizeMethod method;
219    long newHeight;
220    long newWidth;
221    boolean preserveAspectRatio;
222    enum CoordinateTransformMode coordinateTransformMode;
223    float cubicCoeff;
224    long excludeOutside;
225    float extrapolationValue;
226    enum NearestMode nearestMode;
227};
228
229struct Rsqrt
230{
231};
232
233struct ScaleFusion
234{
235    long axis;
236    enum ActivationType activationType;
237};
238
239struct Shape
240{
241};
242
243struct SliceFusion
244{
245    long[] axes;
246};
247
248struct Softmax
249{
250    long[] axis;
251};
252
253struct SpaceToBatchND
254{
255    long[] blockShape;
256    long[][] paddings;
257};
258
259struct Split
260{
261    long outputNum;
262    long[] sizeSplits;
263    long axis;
264};
265
266struct Sqrt
267{
268};
269
270struct SquaredDifference
271{
272};
273
274struct Squeeze
275{
276    long[] axis;
277};
278
279struct Stack
280{
281    long axis;
282};
283
284struct StridedSlice
285{
286    long beginMask;
287    long endMask;
288    long ellipsisMask;
289    long newAxisMask;
290    long shrinkAxisMask;
291};
292
293struct SubFusion
294{
295    enum ActivationType activationType;
296};
297
298struct TileFusion
299{
300    long[] dims;
301};
302
303struct TopKFusion
304{
305    boolean sorted;
306    long axis;
307};
308
309struct Transpose
310{
311};
312
313struct Unsqueeze
314{
315    long[] axis;
316};