blob: 753c2443a4f55e0fcdf4d3104c8ca23bdd20d1d5 [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,
174 Cast = 61
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000175}
176
177// Base layer table to be used as part of other layers
178table LayerBase {
179 index:uint;
180 layerName:string;
181 layerType:LayerType;
182 inputSlots:[InputSlot];
183 outputSlots:[OutputSlot];
184}
185
186table BindableLayerBase {
187 base:LayerBase;
188 layerBindingId:int;
189}
190
191// Table for each layer defined below
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100192
josh minor4a3c6102020-01-06 16:40:46 -0600193/// @deprecated Use ElementwiseUnaryLayer instead
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100194table AbsLayer {
195 base:LayerBase;
196}
197
Mike Kellyaf484012019-02-20 16:53:11 +0000198table ActivationLayer {
199 base:LayerBase;
200 descriptor:ActivationDescriptor;
201}
202
203table ActivationDescriptor {
Tee Jung86bc3d82019-10-01 11:25:56 +0900204 activationFunction:ActivationFunction = Sigmoid;
Mike Kellyaf484012019-02-20 16:53:11 +0000205 a:float;
206 b:float;
207}
208
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000209table AdditionLayer {
210 base:LayerBase;
211}
212
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100213table ArgMinMaxLayer {
214 base:LayerBase;
215 descriptor:ArgMinMaxDescriptor;
216}
217
218table ArgMinMaxDescriptor{
Tee Jung86bc3d82019-10-01 11:25:56 +0900219 argMinMaxFunction:ArgMinMaxFunction;
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100220 axis:int;
221}
222
mathad01b392e982021-04-07 12:07:30 +0100223table CastLayer {
224 base:LayerBase;
225}
226
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100227enum ComparisonOperation : byte {
228 Equal = 0,
229 Greater = 1,
230 GreaterOrEqual = 2,
231 Less = 3,
232 LessOrEqual = 4,
233 NotEqual = 5
234}
235
236table ComparisonDescriptor {
237 operation:ComparisonOperation;
238}
239
240table ComparisonLayer {
241 base:LayerBase;
242 descriptor:ComparisonDescriptor;
243}
244
Conor Kennedy76277882019-02-26 08:29:54 +0000245table ConstantLayer {
246 base:LayerBase;
247 input:ConstTensor;
248}
249
Mike Kellya0766c32019-02-19 17:22:07 +0000250table Convolution2dLayer {
251 base:LayerBase;
252 descriptor:Convolution2dDescriptor;
253 weights:ConstTensor;
254 biases:ConstTensor;
255}
256
257table Convolution2dDescriptor {
258 padLeft:uint;
259 padRight:uint;
260 padTop:uint;
261 padBottom:uint;
262 strideX:uint;
263 strideY:uint;
Matthew Benthamacad04e2019-05-13 10:02:45 +0100264 dilationX:uint = 1;
265 dilationY:uint = 1;
Mike Kellya0766c32019-02-19 17:22:07 +0000266 biasEnabled:bool = false;
267 dataLayout:DataLayout = NCHW;
268}
269
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100270table DepthToSpaceLayer {
271 base:LayerBase;
272 descriptor:DepthToSpaceDescriptor;
273}
274
275table DepthToSpaceDescriptor {
276 blockSize:uint;
277 dataLayout:DataLayout;
278}
279
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000280table DivisionLayer {
281 base:LayerBase;
282}
283
josh minor4a3c6102020-01-06 16:40:46 -0600284enum UnaryOperation : byte {
285 Abs = 0,
286 Rsqrt = 1,
287 Sqrt = 2,
288 Exp = 3,
James Conroyaba90cd2020-11-06 16:28:18 +0000289 Neg = 4,
Teresa Charlin50de4fa2021-05-31 18:47:33 +0100290 LogicalNot = 5,
291 Log = 6,
292 Sin = 7
josh minor4a3c6102020-01-06 16:40:46 -0600293}
294
295table ElementwiseUnaryDescriptor {
296 operation:UnaryOperation;
297}
298
299table ElementwiseUnaryLayer {
300 base:LayerBase;
301 descriptor:ElementwiseUnaryDescriptor;
302}
303
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100304/// @deprecated Use ComparisonLayer instead
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000305table EqualLayer {
306 base:LayerBase;
307}
308
Keith Davis300ad562020-06-04 16:34:23 +0100309table FillLayer {
310 base:LayerBase;
311 descriptor:FillDescriptor;
312}
313
314table FillDescriptor {
315 value:float;
316}
317
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000318table FloorLayer{
319 base:LayerBase;
320}
321
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000322table FullyConnectedLayer {
323 base:LayerBase;
324 descriptor:FullyConnectedDescriptor;
325 weights:ConstTensor;
326 biases:ConstTensor;
327}
328
329table FullyConnectedDescriptor {
330 biasEnabled:bool = false;
331 transposeWeightsMatrix:bool = false;
Sadik Armaganf0a6dec2021-03-25 07:46:55 +0000332 constantWeights:bool = true;
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000333}
334
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000335table GatherLayer {
336 base:LayerBase;
Teresa Charlin52664732020-06-29 16:27:03 +0100337 descriptor:GatherDescriptor;
338}
339
340table GatherDescriptor {
341 axis:int = 0;
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000342}
343
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100344/// @deprecated Use ComparisonLayer instead
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000345table GreaterLayer {
346 base:LayerBase;
347}
348
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000349table InputLayer {
350 base:BindableLayerBase;
351}
352
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100353table InstanceNormalizationLayer {
354 base:LayerBase;
355 descriptor:InstanceNormalizationDescriptor;
356}
357
358table InstanceNormalizationDescriptor {
359 gamma:float;
360 beta:float;
361 eps:float;
362 dataLayout:DataLayout;
363}
364
Sadik Armagan26257852019-10-14 13:00:47 +0100365table LogSoftmaxLayer {
366 base:LayerBase;
367 descriptor:LogSoftmaxDescriptor;
368}
369
370table LogSoftmaxDescriptor {
371 beta:float = 1;
372 axis:int = -1;
373}
374
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000375table L2NormalizationLayer {
376 base:LayerBase;
377 descriptor:L2NormalizationDescriptor;
378}
379
380table L2NormalizationDescriptor {
381 dataLayout:DataLayout = NCHW;
Ferran Balaguer0dcffec2019-06-18 16:25:06 +0100382 eps:float = 1e-12;
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000383}
384
James Conroyaba90cd2020-11-06 16:28:18 +0000385enum LogicalBinaryOperation : byte {
386 LogicalAnd = 0,
387 LogicalOr = 1
388}
389
390table LogicalBinaryDescriptor {
391 operation:LogicalBinaryOperation;
392}
393
394table LogicalBinaryLayer {
395 base:LayerBase;
396 descriptor:LogicalBinaryDescriptor;
397}
398
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000399table MinimumLayer {
400 base:LayerBase;
401}
402
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000403table MaximumLayer {
404 base:LayerBase;
405}
406
Sadik Armagan5f450272019-02-12 14:31:45 +0000407table MultiplicationLayer {
408 base:LayerBase;
409}
410
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000411table Pooling2dLayer {
412 base:LayerBase;
413 descriptor:Pooling2dDescriptor;
414}
415
416enum PoolingAlgorithm : byte {
417 Max = 0,
418 Average = 1,
419 L2 = 2
420}
421
422enum OutputShapeRounding : byte {
423 Floor = 0,
424 Ceiling = 1
425}
426
427enum PaddingMethod : byte {
428 IgnoreValue = 0,
429 Exclude = 1
430}
431
432table Pooling2dDescriptor {
433 poolType:PoolingAlgorithm;
434 padLeft:uint;
435 padRight:uint;
436 padTop:uint;
437 padBottom:uint;
438 poolWidth:uint;
439 poolHeight:uint;
440 strideX:uint;
441 strideY:uint;
442 outputShapeRounding:OutputShapeRounding;
443 paddingMethod:PaddingMethod;
444 dataLayout:DataLayout;
445}
446
Derek Lamberti87acb272019-03-27 16:51:31 +0000447table QuantizeLayer {
448 base:LayerBase;
449}
450
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000451table SoftmaxLayer {
452 base:LayerBase;
453 descriptor:SoftmaxDescriptor;
454}
455
456table SoftmaxDescriptor {
457 beta:float;
458}
459
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000460table DepthwiseConvolution2dLayer {
461 base:LayerBase;
462 descriptor:DepthwiseConvolution2dDescriptor;
463 weights:ConstTensor;
464 biases:ConstTensor;
465}
466
467table DepthwiseConvolution2dDescriptor {
468 padLeft:uint;
469 padRight:uint;
470 padTop:uint;
471 padBottom:uint;
472 strideX:uint;
473 strideY:uint;
Matthew Benthamacad04e2019-05-13 10:02:45 +0100474 dilationX:uint = 1;
475 dilationY:uint = 1;
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000476 biasEnabled:bool = false;
477 dataLayout:DataLayout = NCHW;
478}
479
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000480table OutputLayer {
481 base:BindableLayerBase;
482}
483
Saoirse Stewart263829c2019-02-19 15:54:14 +0000484table ReshapeLayer {
485 base:LayerBase;
486 descriptor:ReshapeDescriptor;
487}
488
489table ReshapeDescriptor {
490 targetShape:[uint];
491}
492
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000493table PermuteLayer {
494 base:LayerBase;
495 descriptor:PermuteDescriptor;
496}
497
498table PermuteDescriptor {
499 dimMappings:[uint];
500}
501
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000502table SpaceToBatchNdLayer {
503 base:LayerBase;
504 descriptor:SpaceToBatchNdDescriptor;
505}
506
507table SpaceToBatchNdDescriptor {
508 blockShape:[uint];
509 padList:[uint];
510 dataLayout:DataLayout;
511}
512
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100513table SpaceToDepthLayer {
514 base:LayerBase;
515 descriptor:SpaceToDepthDescriptor;
516}
517
518table SpaceToDepthDescriptor {
519 blockSize:uint;
520 dataLayout:DataLayout;
521}
522
Conor Kennedyda1f9752019-03-01 14:37:12 +0000523table SubtractionLayer {
524 base:LayerBase;
525}
526
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000527table BatchToSpaceNdLayer {
528 base:LayerBase;
529 descriptor:BatchToSpaceNdDescriptor;
530}
531
532table BatchToSpaceNdDescriptor {
533 blockShape:[uint];
534 crops:[uint];
535 dataLayout:DataLayout;
536}
537
Nina Drozd57728782019-02-27 10:53:27 +0000538enum NormalizationAlgorithmChannel : byte {
539 Across = 0,
540 Within = 1
541}
542
543enum NormalizationAlgorithmMethod : byte {
544 LocalBrightness = 0,
545 LocalContrast = 1
546}
547
548table NormalizationLayer {
549 base:LayerBase;
550 descriptor:NormalizationDescriptor;
551}
552
553table NormalizationDescriptor {
554 normChannelType:NormalizationAlgorithmChannel = Across;
555 normMethodType:NormalizationAlgorithmMethod = LocalBrightness;
556 normSize:uint;
557 alpha:float;
558 beta:float;
559 k:float;
560 dataLayout:DataLayout = NCHW;
561}
562
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000563table MeanLayer {
564 base:LayerBase;
565 descriptor:MeanDescriptor;
566}
567
568table MeanDescriptor {
569 axis:[uint];
570 keepDims:bool = false;
571}
572
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000573table PadLayer {
574 base:LayerBase;
575 descriptor:PadDescriptor;
576}
577
578table PadDescriptor {
579 padList:[uint];
David Monahan34757812019-06-19 11:47:21 +0100580 padValue:float = 0;
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000581}
582
josh minor4a3c6102020-01-06 16:40:46 -0600583/// @deprecated Use ElementwiseUnaryLayer instead
Sadik Armagan8b42a382019-03-01 14:24:49 +0000584table RsqrtLayer {
585 base:LayerBase;
586}
587
ruoyan018e7fa232019-02-28 15:09:07 +0000588table BatchNormalizationLayer {
589 base:LayerBase;
590 descriptor:BatchNormalizationDescriptor;
591 mean:ConstTensor;
592 variance:ConstTensor;
593 beta:ConstTensor;
594 gamma:ConstTensor;
595}
596
597table BatchNormalizationDescriptor {
598 eps:float;
599 dataLayout:DataLayout;
600}
601
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100602/// @deprecated Use ResizeLayer instead
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000603table ResizeBilinearLayer {
604 base:LayerBase;
605 descriptor:ResizeBilinearDescriptor;
606}
607
608table ResizeBilinearDescriptor {
609 targetWidth:uint;
610 targetHeight:uint;
611 dataLayout:DataLayout;
David Monahan4a0c9b92020-05-30 09:48:39 +0100612 alignCorners:bool;
613 halfPixelCenters:bool;
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000614}
615
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100616table SliceLayer {
617 base:LayerBase;
618 descriptor:SliceDescriptor;
619}
620
621table SliceDescriptor {
622 begin:[uint];
623 size:[uint];
624}
625
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000626table StridedSliceLayer {
627 base:LayerBase;
628 descriptor:StridedSliceDescriptor;
629}
630
631table StridedSliceDescriptor {
632 begin:[int];
633 end:[int];
634 stride:[int];
635 beginMask:int;
636 endMask:int;
637 shrinkAxisMask:int;
638 ellipsisMask:int;
639 newAxisMask:int;
640 dataLayout:DataLayout;
641}
642
Jim Flynne242f2d2019-05-22 14:24:13 +0100643table ConcatLayer {
644 base:LayerBase;
645 descriptor:OriginsDescriptor;
646}
647
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100648/// @deprecated Use ConcatLayer instead
Jim Flynnac25a1b2019-02-28 10:40:49 +0000649table MergerLayer {
650 base:LayerBase;
651 descriptor:OriginsDescriptor;
652}
653
654table UintVector {
655 data:[uint];
656}
657
658table OriginsDescriptor {
659 concatAxis:uint;
660 numViews:uint;
661 numDimensions:uint;
662 viewOrigins:[UintVector];
663}
664
Jim Flynn18ce3382019-03-08 11:08:30 +0000665table ViewsDescriptor {
666 origins:OriginsDescriptor;
667 viewSizes:[UintVector];
668}
669
670table SplitterLayer {
671 base:LayerBase;
672 descriptor:ViewsDescriptor;
673}
674
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000675table DetectionPostProcessLayer {
676 base:LayerBase;
677 descriptor:DetectionPostProcessDescriptor;
678 anchors:ConstTensor;
679}
680
681table DetectionPostProcessDescriptor {
682 maxDetections:uint;
683 maxClassesPerDetection:uint;
684 detectionsPerClass:uint;
685 nmsScoreThreshold:float;
686 nmsIouThreshold:float;
687 numClasses:uint;
688 useRegularNms:bool;
689 scaleX:float;
690 scaleY:float;
691 scaleW:float;
692 scaleH:float;
693}
694
Jim Flynn11af3752019-03-19 17:22:29 +0000695table LstmInputParams {
696 inputToForgetWeights:ConstTensor;
697 inputToCellWeights:ConstTensor;
698 inputToOutputWeights:ConstTensor;
699 recurrentToForgetWeights:ConstTensor;
700 recurrentToCellWeights:ConstTensor;
701 recurrentToOutputWeights:ConstTensor;
702 forgetGateBias:ConstTensor;
703 cellBias:ConstTensor;
704 outputGateBias:ConstTensor;
705
706 inputToInputWeights:ConstTensor;
707 recurrentToInputWeights:ConstTensor;
708 cellToInputWeights:ConstTensor;
709 inputGateBias:ConstTensor;
710
711 projectionWeights:ConstTensor;
712 projectionBias:ConstTensor;
713
714 cellToForgetWeights:ConstTensor;
715 cellToOutputWeights:ConstTensor;
Jan Eilersf8c62972019-07-17 11:07:49 +0100716
717 inputLayerNormWeights:ConstTensor;
718 forgetLayerNormWeights:ConstTensor;
719 cellLayerNormWeights:ConstTensor;
720 outputLayerNormWeights:ConstTensor;
Jim Flynn11af3752019-03-19 17:22:29 +0000721}
722
James Conroy8d333182020-05-13 10:27:58 +0100723table LstmDescriptor {
724 activationFunc:uint;
725 clippingThresCell:float;
726 clippingThresProj:float;
727 cifgEnabled:bool = true;
728 peepholeEnabled:bool = false;
729 projectionEnabled:bool = false;
730 layerNormEnabled:bool = false;
731}
732
733table LstmLayer {
734 base:LayerBase;
735 descriptor:LstmDescriptor;
736 inputParams:LstmInputParams;
737}
738
739table QLstmInputParams {
740 // Mandatory
741 inputToForgetWeights:ConstTensor;
742 inputToCellWeights:ConstTensor;
743 inputToOutputWeights:ConstTensor;
744
745 recurrentToForgetWeights:ConstTensor;
746 recurrentToCellWeights:ConstTensor;
747 recurrentToOutputWeights:ConstTensor;
748
749 forgetGateBias:ConstTensor;
750 cellBias:ConstTensor;
751 outputGateBias:ConstTensor;
752
753 // CIFG
754 inputToInputWeights:ConstTensor;
755 recurrentToInputWeights:ConstTensor;
756 inputGateBias:ConstTensor;
757
758 // Projection
759 projectionWeights:ConstTensor;
760 projectionBias:ConstTensor;
761
762 // Peephole
763 cellToInputWeights:ConstTensor;
764 cellToForgetWeights:ConstTensor;
765 cellToOutputWeights:ConstTensor;
766
767 // Layer norm
768 inputLayerNormWeights:ConstTensor;
769 forgetLayerNormWeights:ConstTensor;
770 cellLayerNormWeights:ConstTensor;
771 outputLayerNormWeights:ConstTensor;
772}
773
774table QLstmDescriptor {
775 cifgEnabled:bool = true;
776 peepholeEnabled:bool = false;
777 projectionEnabled:bool = false;
778 layerNormEnabled:bool = false;
779
780 cellClip:float;
781 projectionClip:float;
782
783 inputIntermediateScale:float;
784 forgetIntermediateScale:float;
785 cellIntermediateScale:float;
786 outputIntermediateScale:float;
787
788 hiddenStateZeroPoint:int;
789 hiddenStateScale:float;
790}
791
792table QLstmLayer {
793 base:LayerBase;
794 descriptor:QLstmDescriptor;
795 inputParams:QLstmInputParams;
796}
797
Jan Eilers5b01a892019-07-23 09:47:43 +0100798table QuantizedLstmInputParams {
799 inputToInputWeights:ConstTensor;
800 inputToForgetWeights:ConstTensor;
801 inputToCellWeights:ConstTensor;
802 inputToOutputWeights:ConstTensor;
803
804 recurrentToInputWeights:ConstTensor;
805 recurrentToForgetWeights:ConstTensor;
806 recurrentToCellWeights:ConstTensor;
807 recurrentToOutputWeights:ConstTensor;
808
809 inputGateBias:ConstTensor;
810 forgetGateBias:ConstTensor;
811 cellBias:ConstTensor;
812 outputGateBias:ConstTensor;
813}
814
Jan Eilers5b01a892019-07-23 09:47:43 +0100815table QuantizedLstmLayer {
816 base:LayerBase;
817 inputParams:QuantizedLstmInputParams;
818}
819
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000820table DequantizeLayer {
821 base:LayerBase;
822}
823
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100824table MergeLayer {
825 base:LayerBase;
826}
827
Sadik Armaganeff363d2019-04-05 15:25:46 +0100828table SwitchLayer {
829 base:LayerBase;
830}
831
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100832table PreluLayer {
833 base:LayerBase;
834}
835
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100836table TransposeConvolution2dLayer {
837 base:LayerBase;
838 descriptor:TransposeConvolution2dDescriptor;
839 weights:ConstTensor;
840 biases:ConstTensor;
841}
842
843table TransposeConvolution2dDescriptor {
844 padLeft:uint;
845 padRight:uint;
846 padTop:uint;
847 padBottom:uint;
848 strideX:uint;
849 strideY:uint;
850 biasEnabled:bool = false;
851 dataLayout:DataLayout = NCHW;
852}
853
Mike Kellyc9ea45a2020-02-28 18:11:58 +0000854table TransposeLayer {
855 base:LayerBase;
856 descriptor:TransposeDescriptor;
857}
858
859table TransposeDescriptor {
860 dimMappings:[uint];
861}
862
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100863table ResizeLayer {
864 base:LayerBase;
865 descriptor:ResizeDescriptor;
866}
867
868table ResizeDescriptor {
869 targetHeight:uint;
870 targetWidth:uint;
871 method:ResizeMethod = NearestNeighbor;
872 dataLayout:DataLayout;
David Monahan4a0c9b92020-05-30 09:48:39 +0100873 alignCorners:bool;
874 halfPixelCenters:bool;
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100875}
876
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100877table StackLayer {
878 base:LayerBase;
879 descriptor:StackDescriptor;
880}
881
882table StackDescriptor {
883 axis:uint;
884 numInputs:uint;
885 inputShape:[uint];
886}
887
Aron Virginas-Tar85121a22019-10-23 10:41:35 +0100888table StandInDescriptor {
889 numInputs:uint;
890 numOutputs:uint;
891}
892
893table StandInLayer {
894 base:LayerBase;
895 descriptor:StandInDescriptor;
896}
897
Finn Williams2605b232020-06-10 15:53:46 +0100898table RankLayer {
899 base:LayerBase;
900}
901
Sadik Armagan0c3ea5b2021-02-03 09:29:30 +0000902table ReduceLayer {
903 base:LayerBase;
904 descriptor:ReduceDescriptor;
905}
906
907table ReduceDescriptor {
Sadik Armagan0c3ea5b2021-02-03 09:29:30 +0000908 keepDims:bool = false;
909 axis:[uint];
910 reduceOperation:ReduceOperation = Sum;
911}
912
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000913union Layer {
Mike Kellyaf484012019-02-20 16:53:11 +0000914 ActivationLayer,
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000915 AdditionLayer,
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000916 BatchToSpaceNdLayer,
ruoyan018e7fa232019-02-28 15:09:07 +0000917 BatchNormalizationLayer,
Conor Kennedy76277882019-02-26 08:29:54 +0000918 ConstantLayer,
Mike Kellya0766c32019-02-19 17:22:07 +0000919 Convolution2dLayer,
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000920 DepthwiseConvolution2dLayer,
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000921 FullyConnectedLayer,
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000922 InputLayer,
Sadik Armagan5f450272019-02-12 14:31:45 +0000923 MultiplicationLayer,
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000924 OutputLayer,
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000925 PermuteLayer,
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000926 Pooling2dLayer,
Saoirse Stewart263829c2019-02-19 15:54:14 +0000927 ReshapeLayer,
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000928 SoftmaxLayer,
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000929 SpaceToBatchNdLayer,
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000930 DivisionLayer,
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000931 MinimumLayer,
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000932 EqualLayer,
Nina Drozd57728782019-02-27 10:53:27 +0000933 MaximumLayer,
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000934 NormalizationLayer,
Sadik Armagan8b42a382019-03-01 14:24:49 +0000935 PadLayer,
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000936 RsqrtLayer,
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000937 FloorLayer,
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000938 GreaterLayer,
Conor Kennedyda1f9752019-03-01 14:37:12 +0000939 ResizeBilinearLayer,
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000940 SubtractionLayer,
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000941 StridedSliceLayer,
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000942 GatherLayer,
Jim Flynnac25a1b2019-02-28 10:40:49 +0000943 MeanLayer,
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000944 MergerLayer,
Jim Flynn18ce3382019-03-08 11:08:30 +0000945 L2NormalizationLayer,
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000946 SplitterLayer,
Jim Flynn11af3752019-03-19 17:22:29 +0000947 DetectionPostProcessLayer,
Derek Lamberti87acb272019-03-27 16:51:31 +0000948 LstmLayer,
Jan Eilers5b01a892019-07-23 09:47:43 +0100949 QuantizedLstmLayer,
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000950 QuantizeLayer,
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100951 DequantizeLayer,
Sadik Armaganeff363d2019-04-05 15:25:46 +0100952 MergeLayer,
Jim Flynne242f2d2019-05-22 14:24:13 +0100953 SwitchLayer,
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100954 ConcatLayer,
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100955 SpaceToDepthLayer,
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100956 PreluLayer,
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100957 TransposeConvolution2dLayer,
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100958 ResizeLayer,
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100959 StackLayer,
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100960 AbsLayer,
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100961 ArgMinMaxLayer,
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100962 SliceLayer,
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100963 DepthToSpaceLayer,
Sadik Armagan26257852019-10-14 13:00:47 +0100964 InstanceNormalizationLayer,
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100965 LogSoftmaxLayer,
Aron Virginas-Tar85121a22019-10-23 10:41:35 +0100966 ComparisonLayer,
josh minor4a3c6102020-01-06 16:40:46 -0600967 StandInLayer,
Mike Kellyc9ea45a2020-02-28 18:11:58 +0000968 ElementwiseUnaryLayer,
James Conroy8d333182020-05-13 10:27:58 +0100969 TransposeLayer,
Keith Davis300ad562020-06-04 16:34:23 +0100970 QLstmLayer,
Finn Williams2605b232020-06-10 15:53:46 +0100971 FillLayer,
James Conroyaba90cd2020-11-06 16:28:18 +0000972 RankLayer,
Sadik Armagan0c3ea5b2021-02-03 09:29:30 +0000973 LogicalBinaryLayer,
mathad01b392e982021-04-07 12:07:30 +0100974 ReduceLayer,
975 CastLayer
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000976}
977
Saoirse Stewart49dbe0e2019-02-05 17:27:06 +0000978table AnyLayer {
979 layer:Layer;
980}
981
Tee Jungaa920c52019-11-05 10:48:25 +0000982table FeatureCompatibilityVersions {
983 bindingIdsScheme:uint = 0;
Jan Eilers53ef7952021-06-02 12:01:25 +0100984 weightsLayoutScheme:uint = 0;
Tee Jungaa920c52019-11-05 10:48:25 +0000985}
986
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000987// Root type for serialized data is the graph of the network
988table SerializedGraph {
Saoirse Stewart49dbe0e2019-02-05 17:27:06 +0000989 layers:[AnyLayer];
Tee Jungaa920c52019-11-05 10:48:25 +0000990 inputIds:[int];
991 outputIds:[int];
992 featureVersions:FeatureCompatibilityVersions;
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000993}
994
Sadik Armagan0c3ea5b2021-02-03 09:29:30 +0000995root_type SerializedGraph;