blob: 32a9bba5abc0afa1ea6b75c22e262ab24346b75a [file] [log] [blame]
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +00001//
Teresa Charlin52664732020-06-29 16:27:03 +01002// Copyright © 2017 Arm Ltd and Contributors. All rights reserved.
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +00003// SPDX-License-Identifier: MIT
4//
5
Derek Lamberti0028d1b2019-02-20 13:57:42 +00006namespace armnnSerializer;
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +00007
8file_identifier "ARMN";
9
10file_extension "armnn";
11
Mike Kellyaf484012019-02-20 16:53:11 +000012enum ActivationFunction : byte {
13 Sigmoid = 0,
14 TanH = 1,
15 Linear = 2,
16 ReLu = 3,
17 BoundedReLu = 4,
18 SoftReLu = 5,
19 LeakyReLu = 6,
20 Abs = 7,
21 Sqrt = 8,
David Monahan3b3c3812020-02-25 09:03:29 +000022 Square = 9,
Colm Donelan03fbeaf2020-02-26 15:39:23 +000023 Elu = 10,
24 HardSwish = 11
Mike Kellyaf484012019-02-20 16:53:11 +000025}
26
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +010027enum ArgMinMaxFunction : byte {
28 Min = 0,
29 Max = 1
30}
31
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +000032enum DataType : byte {
33 Float16 = 0,
34 Float32 = 1,
Derek Lambertif90c56d2020-01-10 17:14:08 +000035 QuantisedAsymm8 = 2, // deprecated
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +000036 Signed32 = 3,
Nattapat Chaimanowongcd5ac232019-03-19 12:26:36 +000037 Boolean = 4,
Derek Lambertif90c56d2020-01-10 17:14:08 +000038 QuantisedSymm16 = 5, // deprecated
39 QAsymmU8 = 6,
Francis Murtaghddb1d062020-03-10 13:51:45 +000040 QSymmS16 = 7,
Sadik Armagan1a84fe32020-03-27 15:56:57 +000041 QAsymmS8 = 8,
Mike Kelly1f140f72021-04-06 12:25:55 +010042 QSymmS8 = 9,
43 Signed64 = 10
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +000044}
45
Saoirse Stewart3166c3e2019-02-18 15:24:53 +000046enum DataLayout : byte {
47 NHWC = 0,
48 NCHW = 1
49}
50
Sadik Armagan0c3ea5b2021-02-03 09:29:30 +000051enum ReduceOperation: byte {
52 Sum = 0,
53 Max = 1,
54 Mean = 2,
55 Min = 3
56}
57
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +010058enum ResizeMethod: byte {
59 NearestNeighbor = 0,
60 Bilinear = 1,
61}
62
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +000063table TensorInfo {
64 dimensions:[uint];
65 dataType:DataType;
Sadik Armagan1a84fe32020-03-27 15:56:57 +000066 quantizationScale:float = 1.0; // @deprecated Use quantizationScales instead
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +000067 quantizationOffset:int = 0;
Sadik Armagan1a84fe32020-03-27 15:56:57 +000068 quantizationScales:[float];
69 quantizationDim:uint;
Finn Williams2605b232020-06-10 15:53:46 +010070 dimensionality:uint = 1;
Colm Donelan800b2812021-02-12 12:43:35 +000071 dimensionSpecificity:[bool];
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +000072}
73
74struct Connection {
75 sourceLayerIndex:uint;
76 outputSlotIndex:uint;
77}
78
79table ByteData {
80 data:[byte];
81}
82
83table ShortData {
84 data:[short];
85}
86
87table IntData {
88 data:[int];
89}
90
91table LongData {
92 data:[long];
93}
94
95union ConstTensorData { ByteData, ShortData, IntData, LongData }
96
97table ConstTensor {
98 info:TensorInfo;
99 data:ConstTensorData;
100}
101
102table InputSlot {
103 index:uint;
104 connection:Connection;
105}
106
107table OutputSlot {
108 index:uint;
109 tensorInfo:TensorInfo;
110}
111
112enum LayerType : uint {
113 Addition = 0,
114 Input = 1,
Sadik Armagan5f450272019-02-12 14:31:45 +0000115 Multiplication = 2,
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000116 Output = 3,
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000117 Pooling2d = 4,
Saoirse Stewart263829c2019-02-19 15:54:14 +0000118 Reshape = 5,
Mike Kellya0766c32019-02-19 17:22:07 +0000119 Softmax = 6,
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000120 Convolution2d = 7,
Mike Kellyaf484012019-02-20 16:53:11 +0000121 DepthwiseConvolution2d = 8,
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000122 Activation = 9,
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000123 Permute = 10,
Conor Kennedy76277882019-02-26 08:29:54 +0000124 FullyConnected = 11,
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000125 Constant = 12,
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000126 SpaceToBatchNd = 13,
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000127 BatchToSpaceNd = 14,
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000128 Division = 15,
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000129 Minimum = 16,
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000130 Equal = 17,
Nina Drozd57728782019-02-27 10:53:27 +0000131 Maximum = 18,
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000132 Normalization = 19,
Sadik Armagan8b42a382019-03-01 14:24:49 +0000133 Pad = 20,
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000134 Rsqrt = 21,
ruoyan018e7fa232019-02-28 15:09:07 +0000135 Floor = 22,
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000136 BatchNormalization = 23,
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000137 Greater = 24,
Conor Kennedyda1f9752019-03-01 14:37:12 +0000138 ResizeBilinear = 25,
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000139 Subtraction = 26,
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000140 StridedSlice = 27,
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000141 Gather = 28,
Jim Flynnac25a1b2019-02-28 10:40:49 +0000142 Mean = 29,
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000143 Merger = 30,
Jim Flynn18ce3382019-03-08 11:08:30 +0000144 L2Normalization = 31,
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000145 Splitter = 32,
Jim Flynn11af3752019-03-19 17:22:29 +0000146 DetectionPostProcess = 33,
Derek Lamberti87acb272019-03-27 16:51:31 +0000147 Lstm = 34,
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000148 Quantize = 35,
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100149 Dequantize = 36,
Sadik Armaganeff363d2019-04-05 15:25:46 +0100150 Merge = 37,
Jim Flynne242f2d2019-05-22 14:24:13 +0100151 Switch = 38,
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100152 Concat = 39,
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100153 SpaceToDepth = 40,
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100154 Prelu = 41,
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100155 TransposeConvolution2d = 42,
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100156 Resize = 43,
Jan Eilers5b01a892019-07-23 09:47:43 +0100157 Stack = 44,
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100158 QuantizedLstm = 45,
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100159 Abs = 46,
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100160 ArgMinMax = 47,
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100161 Slice = 48,
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100162 DepthToSpace = 49,
Sadik Armagan26257852019-10-14 13:00:47 +0100163 InstanceNormalization = 50,
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100164 LogSoftmax = 51,
Aron Virginas-Tar85121a22019-10-23 10:41:35 +0100165 Comparison = 52,
josh minor4a3c6102020-01-06 16:40:46 -0600166 StandIn = 53,
Mike Kellyc9ea45a2020-02-28 18:11:58 +0000167 ElementwiseUnary = 54,
James Conroy8d333182020-05-13 10:27:58 +0100168 Transpose = 55,
Keith Davis300ad562020-06-04 16:34:23 +0100169 QLstm = 56,
Finn Williams2605b232020-06-10 15:53:46 +0100170 Fill = 57,
James Conroyaba90cd2020-11-06 16:28:18 +0000171 Rank = 58,
Sadik Armagan0c3ea5b2021-02-03 09:29:30 +0000172 LogicalBinary = 59,
mathad01b392e982021-04-07 12:07:30 +0100173 Reduce = 60,
Keith Davis3ae3f972021-05-21 16:33:48 +0100174 Cast = 61,
175 Shape = 62
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000176}
177
178// Base layer table to be used as part of other layers
179table LayerBase {
180 index:uint;
181 layerName:string;
182 layerType:LayerType;
183 inputSlots:[InputSlot];
184 outputSlots:[OutputSlot];
185}
186
187table BindableLayerBase {
188 base:LayerBase;
189 layerBindingId:int;
190}
191
192// Table for each layer defined below
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100193
josh minor4a3c6102020-01-06 16:40:46 -0600194/// @deprecated Use ElementwiseUnaryLayer instead
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100195table AbsLayer {
196 base:LayerBase;
197}
198
Mike Kellyaf484012019-02-20 16:53:11 +0000199table ActivationLayer {
200 base:LayerBase;
201 descriptor:ActivationDescriptor;
202}
203
204table ActivationDescriptor {
Tee Jung86bc3d82019-10-01 11:25:56 +0900205 activationFunction:ActivationFunction = Sigmoid;
Mike Kellyaf484012019-02-20 16:53:11 +0000206 a:float;
207 b:float;
208}
209
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000210table AdditionLayer {
211 base:LayerBase;
212}
213
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100214table ArgMinMaxLayer {
215 base:LayerBase;
216 descriptor:ArgMinMaxDescriptor;
217}
218
219table ArgMinMaxDescriptor{
Tee Jung86bc3d82019-10-01 11:25:56 +0900220 argMinMaxFunction:ArgMinMaxFunction;
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100221 axis:int;
222}
223
mathad01b392e982021-04-07 12:07:30 +0100224table CastLayer {
225 base:LayerBase;
226}
227
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100228enum ComparisonOperation : byte {
229 Equal = 0,
230 Greater = 1,
231 GreaterOrEqual = 2,
232 Less = 3,
233 LessOrEqual = 4,
234 NotEqual = 5
235}
236
237table ComparisonDescriptor {
238 operation:ComparisonOperation;
239}
240
241table ComparisonLayer {
242 base:LayerBase;
243 descriptor:ComparisonDescriptor;
244}
245
Conor Kennedy76277882019-02-26 08:29:54 +0000246table ConstantLayer {
247 base:LayerBase;
248 input:ConstTensor;
249}
250
Mike Kellya0766c32019-02-19 17:22:07 +0000251table Convolution2dLayer {
252 base:LayerBase;
253 descriptor:Convolution2dDescriptor;
254 weights:ConstTensor;
255 biases:ConstTensor;
256}
257
258table Convolution2dDescriptor {
259 padLeft:uint;
260 padRight:uint;
261 padTop:uint;
262 padBottom:uint;
263 strideX:uint;
264 strideY:uint;
Matthew Benthamacad04e2019-05-13 10:02:45 +0100265 dilationX:uint = 1;
266 dilationY:uint = 1;
Mike Kellya0766c32019-02-19 17:22:07 +0000267 biasEnabled:bool = false;
268 dataLayout:DataLayout = NCHW;
269}
270
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100271table DepthToSpaceLayer {
272 base:LayerBase;
273 descriptor:DepthToSpaceDescriptor;
274}
275
276table DepthToSpaceDescriptor {
277 blockSize:uint;
278 dataLayout:DataLayout;
279}
280
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000281table DivisionLayer {
282 base:LayerBase;
283}
284
josh minor4a3c6102020-01-06 16:40:46 -0600285enum UnaryOperation : byte {
286 Abs = 0,
287 Rsqrt = 1,
288 Sqrt = 2,
289 Exp = 3,
James Conroyaba90cd2020-11-06 16:28:18 +0000290 Neg = 4,
Teresa Charlin50de4fa2021-05-31 18:47:33 +0100291 LogicalNot = 5,
292 Log = 6,
293 Sin = 7
josh minor4a3c6102020-01-06 16:40:46 -0600294}
295
296table ElementwiseUnaryDescriptor {
297 operation:UnaryOperation;
298}
299
300table ElementwiseUnaryLayer {
301 base:LayerBase;
302 descriptor:ElementwiseUnaryDescriptor;
303}
304
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100305/// @deprecated Use ComparisonLayer instead
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000306table EqualLayer {
307 base:LayerBase;
308}
309
Keith Davis300ad562020-06-04 16:34:23 +0100310table FillLayer {
311 base:LayerBase;
312 descriptor:FillDescriptor;
313}
314
315table FillDescriptor {
316 value:float;
317}
318
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000319table FloorLayer{
320 base:LayerBase;
321}
322
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000323table FullyConnectedLayer {
324 base:LayerBase;
325 descriptor:FullyConnectedDescriptor;
326 weights:ConstTensor;
327 biases:ConstTensor;
328}
329
330table FullyConnectedDescriptor {
331 biasEnabled:bool = false;
332 transposeWeightsMatrix:bool = false;
Sadik Armaganf0a6dec2021-03-25 07:46:55 +0000333 constantWeights:bool = true;
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000334}
335
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000336table GatherLayer {
337 base:LayerBase;
Teresa Charlin52664732020-06-29 16:27:03 +0100338 descriptor:GatherDescriptor;
339}
340
341table GatherDescriptor {
342 axis:int = 0;
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000343}
344
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100345/// @deprecated Use ComparisonLayer instead
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000346table GreaterLayer {
347 base:LayerBase;
348}
349
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000350table InputLayer {
351 base:BindableLayerBase;
352}
353
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100354table InstanceNormalizationLayer {
355 base:LayerBase;
356 descriptor:InstanceNormalizationDescriptor;
357}
358
359table InstanceNormalizationDescriptor {
360 gamma:float;
361 beta:float;
362 eps:float;
363 dataLayout:DataLayout;
364}
365
Sadik Armagan26257852019-10-14 13:00:47 +0100366table LogSoftmaxLayer {
367 base:LayerBase;
368 descriptor:LogSoftmaxDescriptor;
369}
370
371table LogSoftmaxDescriptor {
372 beta:float = 1;
373 axis:int = -1;
374}
375
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000376table L2NormalizationLayer {
377 base:LayerBase;
378 descriptor:L2NormalizationDescriptor;
379}
380
381table L2NormalizationDescriptor {
382 dataLayout:DataLayout = NCHW;
Ferran Balaguer0dcffec2019-06-18 16:25:06 +0100383 eps:float = 1e-12;
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000384}
385
James Conroyaba90cd2020-11-06 16:28:18 +0000386enum LogicalBinaryOperation : byte {
387 LogicalAnd = 0,
388 LogicalOr = 1
389}
390
391table LogicalBinaryDescriptor {
392 operation:LogicalBinaryOperation;
393}
394
395table LogicalBinaryLayer {
396 base:LayerBase;
397 descriptor:LogicalBinaryDescriptor;
398}
399
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000400table MinimumLayer {
401 base:LayerBase;
402}
403
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000404table MaximumLayer {
405 base:LayerBase;
406}
407
Sadik Armagan5f450272019-02-12 14:31:45 +0000408table MultiplicationLayer {
409 base:LayerBase;
410}
411
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000412table Pooling2dLayer {
413 base:LayerBase;
414 descriptor:Pooling2dDescriptor;
415}
416
417enum PoolingAlgorithm : byte {
418 Max = 0,
419 Average = 1,
420 L2 = 2
421}
422
423enum OutputShapeRounding : byte {
424 Floor = 0,
425 Ceiling = 1
426}
427
428enum PaddingMethod : byte {
429 IgnoreValue = 0,
430 Exclude = 1
431}
432
433table Pooling2dDescriptor {
434 poolType:PoolingAlgorithm;
435 padLeft:uint;
436 padRight:uint;
437 padTop:uint;
438 padBottom:uint;
439 poolWidth:uint;
440 poolHeight:uint;
441 strideX:uint;
442 strideY:uint;
443 outputShapeRounding:OutputShapeRounding;
444 paddingMethod:PaddingMethod;
445 dataLayout:DataLayout;
446}
447
Derek Lamberti87acb272019-03-27 16:51:31 +0000448table QuantizeLayer {
449 base:LayerBase;
450}
451
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000452table SoftmaxLayer {
453 base:LayerBase;
454 descriptor:SoftmaxDescriptor;
455}
456
457table SoftmaxDescriptor {
458 beta:float;
459}
460
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000461table DepthwiseConvolution2dLayer {
462 base:LayerBase;
463 descriptor:DepthwiseConvolution2dDescriptor;
464 weights:ConstTensor;
465 biases:ConstTensor;
466}
467
468table DepthwiseConvolution2dDescriptor {
469 padLeft:uint;
470 padRight:uint;
471 padTop:uint;
472 padBottom:uint;
473 strideX:uint;
474 strideY:uint;
Matthew Benthamacad04e2019-05-13 10:02:45 +0100475 dilationX:uint = 1;
476 dilationY:uint = 1;
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000477 biasEnabled:bool = false;
478 dataLayout:DataLayout = NCHW;
479}
480
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000481table OutputLayer {
482 base:BindableLayerBase;
483}
484
Saoirse Stewart263829c2019-02-19 15:54:14 +0000485table ReshapeLayer {
486 base:LayerBase;
487 descriptor:ReshapeDescriptor;
488}
489
490table ReshapeDescriptor {
Keith Davis3ae3f972021-05-21 16:33:48 +0100491 targetShape:[uint];
Saoirse Stewart263829c2019-02-19 15:54:14 +0000492}
493
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000494table PermuteLayer {
495 base:LayerBase;
496 descriptor:PermuteDescriptor;
497}
498
499table PermuteDescriptor {
500 dimMappings:[uint];
501}
502
Keith Davis3ae3f972021-05-21 16:33:48 +0100503table ShapeLayer {
504 base:LayerBase;
505}
506
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000507table SpaceToBatchNdLayer {
508 base:LayerBase;
509 descriptor:SpaceToBatchNdDescriptor;
510}
511
512table SpaceToBatchNdDescriptor {
513 blockShape:[uint];
514 padList:[uint];
515 dataLayout:DataLayout;
516}
517
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100518table SpaceToDepthLayer {
519 base:LayerBase;
520 descriptor:SpaceToDepthDescriptor;
521}
522
523table SpaceToDepthDescriptor {
524 blockSize:uint;
525 dataLayout:DataLayout;
526}
527
Conor Kennedyda1f9752019-03-01 14:37:12 +0000528table SubtractionLayer {
529 base:LayerBase;
530}
531
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000532table BatchToSpaceNdLayer {
533 base:LayerBase;
534 descriptor:BatchToSpaceNdDescriptor;
535}
536
537table BatchToSpaceNdDescriptor {
538 blockShape:[uint];
539 crops:[uint];
540 dataLayout:DataLayout;
541}
542
Nina Drozd57728782019-02-27 10:53:27 +0000543enum NormalizationAlgorithmChannel : byte {
544 Across = 0,
545 Within = 1
546}
547
548enum NormalizationAlgorithmMethod : byte {
549 LocalBrightness = 0,
550 LocalContrast = 1
551}
552
553table NormalizationLayer {
554 base:LayerBase;
555 descriptor:NormalizationDescriptor;
556}
557
558table NormalizationDescriptor {
559 normChannelType:NormalizationAlgorithmChannel = Across;
560 normMethodType:NormalizationAlgorithmMethod = LocalBrightness;
561 normSize:uint;
562 alpha:float;
563 beta:float;
564 k:float;
565 dataLayout:DataLayout = NCHW;
566}
567
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000568table MeanLayer {
569 base:LayerBase;
570 descriptor:MeanDescriptor;
571}
572
573table MeanDescriptor {
574 axis:[uint];
575 keepDims:bool = false;
576}
577
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000578table PadLayer {
579 base:LayerBase;
580 descriptor:PadDescriptor;
581}
582
583table PadDescriptor {
584 padList:[uint];
David Monahan34757812019-06-19 11:47:21 +0100585 padValue:float = 0;
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000586}
587
josh minor4a3c6102020-01-06 16:40:46 -0600588/// @deprecated Use ElementwiseUnaryLayer instead
Sadik Armagan8b42a382019-03-01 14:24:49 +0000589table RsqrtLayer {
590 base:LayerBase;
591}
592
ruoyan018e7fa232019-02-28 15:09:07 +0000593table BatchNormalizationLayer {
594 base:LayerBase;
595 descriptor:BatchNormalizationDescriptor;
596 mean:ConstTensor;
597 variance:ConstTensor;
598 beta:ConstTensor;
599 gamma:ConstTensor;
600}
601
602table BatchNormalizationDescriptor {
603 eps:float;
604 dataLayout:DataLayout;
605}
606
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100607/// @deprecated Use ResizeLayer instead
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000608table ResizeBilinearLayer {
609 base:LayerBase;
610 descriptor:ResizeBilinearDescriptor;
611}
612
613table ResizeBilinearDescriptor {
614 targetWidth:uint;
615 targetHeight:uint;
616 dataLayout:DataLayout;
David Monahan4a0c9b92020-05-30 09:48:39 +0100617 alignCorners:bool;
618 halfPixelCenters:bool;
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000619}
620
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100621table SliceLayer {
622 base:LayerBase;
623 descriptor:SliceDescriptor;
624}
625
626table SliceDescriptor {
627 begin:[uint];
628 size:[uint];
629}
630
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000631table StridedSliceLayer {
632 base:LayerBase;
633 descriptor:StridedSliceDescriptor;
634}
635
636table StridedSliceDescriptor {
637 begin:[int];
638 end:[int];
639 stride:[int];
640 beginMask:int;
641 endMask:int;
642 shrinkAxisMask:int;
643 ellipsisMask:int;
644 newAxisMask:int;
645 dataLayout:DataLayout;
646}
647
Jim Flynne242f2d2019-05-22 14:24:13 +0100648table ConcatLayer {
649 base:LayerBase;
650 descriptor:OriginsDescriptor;
651}
652
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100653/// @deprecated Use ConcatLayer instead
Jim Flynnac25a1b2019-02-28 10:40:49 +0000654table MergerLayer {
655 base:LayerBase;
656 descriptor:OriginsDescriptor;
657}
658
659table UintVector {
660 data:[uint];
661}
662
663table OriginsDescriptor {
664 concatAxis:uint;
665 numViews:uint;
666 numDimensions:uint;
667 viewOrigins:[UintVector];
668}
669
Jim Flynn18ce3382019-03-08 11:08:30 +0000670table ViewsDescriptor {
671 origins:OriginsDescriptor;
672 viewSizes:[UintVector];
673}
674
675table SplitterLayer {
676 base:LayerBase;
677 descriptor:ViewsDescriptor;
678}
679
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000680table DetectionPostProcessLayer {
681 base:LayerBase;
682 descriptor:DetectionPostProcessDescriptor;
683 anchors:ConstTensor;
684}
685
686table DetectionPostProcessDescriptor {
687 maxDetections:uint;
688 maxClassesPerDetection:uint;
689 detectionsPerClass:uint;
690 nmsScoreThreshold:float;
691 nmsIouThreshold:float;
692 numClasses:uint;
693 useRegularNms:bool;
694 scaleX:float;
695 scaleY:float;
696 scaleW:float;
697 scaleH:float;
698}
699
Jim Flynn11af3752019-03-19 17:22:29 +0000700table LstmInputParams {
701 inputToForgetWeights:ConstTensor;
702 inputToCellWeights:ConstTensor;
703 inputToOutputWeights:ConstTensor;
704 recurrentToForgetWeights:ConstTensor;
705 recurrentToCellWeights:ConstTensor;
706 recurrentToOutputWeights:ConstTensor;
707 forgetGateBias:ConstTensor;
708 cellBias:ConstTensor;
709 outputGateBias:ConstTensor;
710
711 inputToInputWeights:ConstTensor;
712 recurrentToInputWeights:ConstTensor;
713 cellToInputWeights:ConstTensor;
714 inputGateBias:ConstTensor;
715
716 projectionWeights:ConstTensor;
717 projectionBias:ConstTensor;
718
719 cellToForgetWeights:ConstTensor;
720 cellToOutputWeights:ConstTensor;
Jan Eilersf8c62972019-07-17 11:07:49 +0100721
722 inputLayerNormWeights:ConstTensor;
723 forgetLayerNormWeights:ConstTensor;
724 cellLayerNormWeights:ConstTensor;
725 outputLayerNormWeights:ConstTensor;
Jim Flynn11af3752019-03-19 17:22:29 +0000726}
727
James Conroy8d333182020-05-13 10:27:58 +0100728table LstmDescriptor {
729 activationFunc:uint;
730 clippingThresCell:float;
731 clippingThresProj:float;
732 cifgEnabled:bool = true;
733 peepholeEnabled:bool = false;
734 projectionEnabled:bool = false;
735 layerNormEnabled:bool = false;
736}
737
738table LstmLayer {
739 base:LayerBase;
740 descriptor:LstmDescriptor;
741 inputParams:LstmInputParams;
742}
743
744table QLstmInputParams {
745 // Mandatory
746 inputToForgetWeights:ConstTensor;
747 inputToCellWeights:ConstTensor;
748 inputToOutputWeights:ConstTensor;
749
750 recurrentToForgetWeights:ConstTensor;
751 recurrentToCellWeights:ConstTensor;
752 recurrentToOutputWeights:ConstTensor;
753
754 forgetGateBias:ConstTensor;
755 cellBias:ConstTensor;
756 outputGateBias:ConstTensor;
757
758 // CIFG
759 inputToInputWeights:ConstTensor;
760 recurrentToInputWeights:ConstTensor;
761 inputGateBias:ConstTensor;
762
763 // Projection
764 projectionWeights:ConstTensor;
765 projectionBias:ConstTensor;
766
767 // Peephole
768 cellToInputWeights:ConstTensor;
769 cellToForgetWeights:ConstTensor;
770 cellToOutputWeights:ConstTensor;
771
772 // Layer norm
773 inputLayerNormWeights:ConstTensor;
774 forgetLayerNormWeights:ConstTensor;
775 cellLayerNormWeights:ConstTensor;
776 outputLayerNormWeights:ConstTensor;
777}
778
779table QLstmDescriptor {
780 cifgEnabled:bool = true;
781 peepholeEnabled:bool = false;
782 projectionEnabled:bool = false;
783 layerNormEnabled:bool = false;
784
785 cellClip:float;
786 projectionClip:float;
787
788 inputIntermediateScale:float;
789 forgetIntermediateScale:float;
790 cellIntermediateScale:float;
791 outputIntermediateScale:float;
792
793 hiddenStateZeroPoint:int;
794 hiddenStateScale:float;
795}
796
797table QLstmLayer {
798 base:LayerBase;
799 descriptor:QLstmDescriptor;
800 inputParams:QLstmInputParams;
801}
802
Jan Eilers5b01a892019-07-23 09:47:43 +0100803table QuantizedLstmInputParams {
804 inputToInputWeights:ConstTensor;
805 inputToForgetWeights:ConstTensor;
806 inputToCellWeights:ConstTensor;
807 inputToOutputWeights:ConstTensor;
808
809 recurrentToInputWeights:ConstTensor;
810 recurrentToForgetWeights:ConstTensor;
811 recurrentToCellWeights:ConstTensor;
812 recurrentToOutputWeights:ConstTensor;
813
814 inputGateBias:ConstTensor;
815 forgetGateBias:ConstTensor;
816 cellBias:ConstTensor;
817 outputGateBias:ConstTensor;
818}
819
Jan Eilers5b01a892019-07-23 09:47:43 +0100820table QuantizedLstmLayer {
821 base:LayerBase;
822 inputParams:QuantizedLstmInputParams;
823}
824
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000825table DequantizeLayer {
826 base:LayerBase;
827}
828
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100829table MergeLayer {
830 base:LayerBase;
831}
832
Sadik Armaganeff363d2019-04-05 15:25:46 +0100833table SwitchLayer {
834 base:LayerBase;
835}
836
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100837table PreluLayer {
838 base:LayerBase;
839}
840
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100841table TransposeConvolution2dLayer {
842 base:LayerBase;
843 descriptor:TransposeConvolution2dDescriptor;
844 weights:ConstTensor;
845 biases:ConstTensor;
846}
847
848table TransposeConvolution2dDescriptor {
849 padLeft:uint;
850 padRight:uint;
851 padTop:uint;
852 padBottom:uint;
853 strideX:uint;
854 strideY:uint;
855 biasEnabled:bool = false;
856 dataLayout:DataLayout = NCHW;
857}
858
Mike Kellyc9ea45a2020-02-28 18:11:58 +0000859table TransposeLayer {
860 base:LayerBase;
861 descriptor:TransposeDescriptor;
862}
863
864table TransposeDescriptor {
865 dimMappings:[uint];
866}
867
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100868table ResizeLayer {
869 base:LayerBase;
870 descriptor:ResizeDescriptor;
871}
872
873table ResizeDescriptor {
874 targetHeight:uint;
875 targetWidth:uint;
876 method:ResizeMethod = NearestNeighbor;
877 dataLayout:DataLayout;
David Monahan4a0c9b92020-05-30 09:48:39 +0100878 alignCorners:bool;
879 halfPixelCenters:bool;
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100880}
881
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100882table StackLayer {
883 base:LayerBase;
884 descriptor:StackDescriptor;
885}
886
887table StackDescriptor {
888 axis:uint;
889 numInputs:uint;
890 inputShape:[uint];
891}
892
Aron Virginas-Tar85121a22019-10-23 10:41:35 +0100893table StandInDescriptor {
894 numInputs:uint;
895 numOutputs:uint;
896}
897
898table StandInLayer {
899 base:LayerBase;
900 descriptor:StandInDescriptor;
901}
902
Finn Williams2605b232020-06-10 15:53:46 +0100903table RankLayer {
904 base:LayerBase;
905}
906
Sadik Armagan0c3ea5b2021-02-03 09:29:30 +0000907table ReduceLayer {
908 base:LayerBase;
909 descriptor:ReduceDescriptor;
910}
911
912table ReduceDescriptor {
Sadik Armagan0c3ea5b2021-02-03 09:29:30 +0000913 keepDims:bool = false;
914 axis:[uint];
915 reduceOperation:ReduceOperation = Sum;
916}
917
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000918union Layer {
Mike Kellyaf484012019-02-20 16:53:11 +0000919 ActivationLayer,
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000920 AdditionLayer,
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000921 BatchToSpaceNdLayer,
ruoyan018e7fa232019-02-28 15:09:07 +0000922 BatchNormalizationLayer,
Conor Kennedy76277882019-02-26 08:29:54 +0000923 ConstantLayer,
Mike Kellya0766c32019-02-19 17:22:07 +0000924 Convolution2dLayer,
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000925 DepthwiseConvolution2dLayer,
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000926 FullyConnectedLayer,
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000927 InputLayer,
Sadik Armagan5f450272019-02-12 14:31:45 +0000928 MultiplicationLayer,
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000929 OutputLayer,
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000930 PermuteLayer,
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000931 Pooling2dLayer,
Saoirse Stewart263829c2019-02-19 15:54:14 +0000932 ReshapeLayer,
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000933 SoftmaxLayer,
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000934 SpaceToBatchNdLayer,
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000935 DivisionLayer,
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000936 MinimumLayer,
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000937 EqualLayer,
Nina Drozd57728782019-02-27 10:53:27 +0000938 MaximumLayer,
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000939 NormalizationLayer,
Sadik Armagan8b42a382019-03-01 14:24:49 +0000940 PadLayer,
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000941 RsqrtLayer,
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000942 FloorLayer,
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000943 GreaterLayer,
Conor Kennedyda1f9752019-03-01 14:37:12 +0000944 ResizeBilinearLayer,
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000945 SubtractionLayer,
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000946 StridedSliceLayer,
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000947 GatherLayer,
Jim Flynnac25a1b2019-02-28 10:40:49 +0000948 MeanLayer,
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000949 MergerLayer,
Jim Flynn18ce3382019-03-08 11:08:30 +0000950 L2NormalizationLayer,
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000951 SplitterLayer,
Jim Flynn11af3752019-03-19 17:22:29 +0000952 DetectionPostProcessLayer,
Derek Lamberti87acb272019-03-27 16:51:31 +0000953 LstmLayer,
Jan Eilers5b01a892019-07-23 09:47:43 +0100954 QuantizedLstmLayer,
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000955 QuantizeLayer,
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100956 DequantizeLayer,
Sadik Armaganeff363d2019-04-05 15:25:46 +0100957 MergeLayer,
Jim Flynne242f2d2019-05-22 14:24:13 +0100958 SwitchLayer,
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100959 ConcatLayer,
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100960 SpaceToDepthLayer,
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100961 PreluLayer,
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100962 TransposeConvolution2dLayer,
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100963 ResizeLayer,
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100964 StackLayer,
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100965 AbsLayer,
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100966 ArgMinMaxLayer,
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100967 SliceLayer,
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100968 DepthToSpaceLayer,
Sadik Armagan26257852019-10-14 13:00:47 +0100969 InstanceNormalizationLayer,
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100970 LogSoftmaxLayer,
Aron Virginas-Tar85121a22019-10-23 10:41:35 +0100971 ComparisonLayer,
josh minor4a3c6102020-01-06 16:40:46 -0600972 StandInLayer,
Mike Kellyc9ea45a2020-02-28 18:11:58 +0000973 ElementwiseUnaryLayer,
James Conroy8d333182020-05-13 10:27:58 +0100974 TransposeLayer,
Keith Davis300ad562020-06-04 16:34:23 +0100975 QLstmLayer,
Finn Williams2605b232020-06-10 15:53:46 +0100976 FillLayer,
James Conroyaba90cd2020-11-06 16:28:18 +0000977 RankLayer,
Sadik Armagan0c3ea5b2021-02-03 09:29:30 +0000978 LogicalBinaryLayer,
mathad01b392e982021-04-07 12:07:30 +0100979 ReduceLayer,
Keith Davis3ae3f972021-05-21 16:33:48 +0100980 CastLayer,
981 ShapeLayer
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000982}
983
Saoirse Stewart49dbe0e2019-02-05 17:27:06 +0000984table AnyLayer {
985 layer:Layer;
986}
987
Tee Jungaa920c52019-11-05 10:48:25 +0000988table FeatureCompatibilityVersions {
989 bindingIdsScheme:uint = 0;
Jan Eilers53ef7952021-06-02 12:01:25 +0100990 weightsLayoutScheme:uint = 0;
Tee Jungaa920c52019-11-05 10:48:25 +0000991}
992
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000993// Root type for serialized data is the graph of the network
994table SerializedGraph {
Saoirse Stewart49dbe0e2019-02-05 17:27:06 +0000995 layers:[AnyLayer];
Tee Jungaa920c52019-11-05 10:48:25 +0000996 inputIds:[int];
997 outputIds:[int];
998 featureVersions:FeatureCompatibilityVersions;
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000999}
1000
Sadik Armagan0c3ea5b2021-02-03 09:29:30 +00001001root_type SerializedGraph;