blob: 6e5ee3f3d36077b98bd37c1ec77fdabfc2219e41 [file] [log] [blame]
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +00001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
3// 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,
42 QSymmS8 = 9
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +000043}
44
Saoirse Stewart3166c3e2019-02-18 15:24:53 +000045enum DataLayout : byte {
46 NHWC = 0,
47 NCHW = 1
48}
49
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +010050enum ResizeMethod: byte {
51 NearestNeighbor = 0,
52 Bilinear = 1,
53}
54
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +000055table TensorInfo {
56 dimensions:[uint];
57 dataType:DataType;
Sadik Armagan1a84fe32020-03-27 15:56:57 +000058 quantizationScale:float = 1.0; // @deprecated Use quantizationScales instead
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +000059 quantizationOffset:int = 0;
Sadik Armagan1a84fe32020-03-27 15:56:57 +000060 quantizationScales:[float];
61 quantizationDim:uint;
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +000062}
63
64struct Connection {
65 sourceLayerIndex:uint;
66 outputSlotIndex:uint;
67}
68
69table ByteData {
70 data:[byte];
71}
72
73table ShortData {
74 data:[short];
75}
76
77table IntData {
78 data:[int];
79}
80
81table LongData {
82 data:[long];
83}
84
85union ConstTensorData { ByteData, ShortData, IntData, LongData }
86
87table ConstTensor {
88 info:TensorInfo;
89 data:ConstTensorData;
90}
91
92table InputSlot {
93 index:uint;
94 connection:Connection;
95}
96
97table OutputSlot {
98 index:uint;
99 tensorInfo:TensorInfo;
100}
101
102enum LayerType : uint {
103 Addition = 0,
104 Input = 1,
Sadik Armagan5f450272019-02-12 14:31:45 +0000105 Multiplication = 2,
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000106 Output = 3,
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000107 Pooling2d = 4,
Saoirse Stewart263829c2019-02-19 15:54:14 +0000108 Reshape = 5,
Mike Kellya0766c32019-02-19 17:22:07 +0000109 Softmax = 6,
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000110 Convolution2d = 7,
Mike Kellyaf484012019-02-20 16:53:11 +0000111 DepthwiseConvolution2d = 8,
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000112 Activation = 9,
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000113 Permute = 10,
Conor Kennedy76277882019-02-26 08:29:54 +0000114 FullyConnected = 11,
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000115 Constant = 12,
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000116 SpaceToBatchNd = 13,
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000117 BatchToSpaceNd = 14,
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000118 Division = 15,
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000119 Minimum = 16,
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000120 Equal = 17,
Nina Drozd57728782019-02-27 10:53:27 +0000121 Maximum = 18,
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000122 Normalization = 19,
Sadik Armagan8b42a382019-03-01 14:24:49 +0000123 Pad = 20,
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000124 Rsqrt = 21,
ruoyan018e7fa232019-02-28 15:09:07 +0000125 Floor = 22,
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000126 BatchNormalization = 23,
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000127 Greater = 24,
Conor Kennedyda1f9752019-03-01 14:37:12 +0000128 ResizeBilinear = 25,
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000129 Subtraction = 26,
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000130 StridedSlice = 27,
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000131 Gather = 28,
Jim Flynnac25a1b2019-02-28 10:40:49 +0000132 Mean = 29,
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000133 Merger = 30,
Jim Flynn18ce3382019-03-08 11:08:30 +0000134 L2Normalization = 31,
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000135 Splitter = 32,
Jim Flynn11af3752019-03-19 17:22:29 +0000136 DetectionPostProcess = 33,
Derek Lamberti87acb272019-03-27 16:51:31 +0000137 Lstm = 34,
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000138 Quantize = 35,
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100139 Dequantize = 36,
Sadik Armaganeff363d2019-04-05 15:25:46 +0100140 Merge = 37,
Jim Flynne242f2d2019-05-22 14:24:13 +0100141 Switch = 38,
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100142 Concat = 39,
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100143 SpaceToDepth = 40,
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100144 Prelu = 41,
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100145 TransposeConvolution2d = 42,
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100146 Resize = 43,
Jan Eilers5b01a892019-07-23 09:47:43 +0100147 Stack = 44,
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100148 QuantizedLstm = 45,
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100149 Abs = 46,
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100150 ArgMinMax = 47,
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100151 Slice = 48,
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100152 DepthToSpace = 49,
Sadik Armagan26257852019-10-14 13:00:47 +0100153 InstanceNormalization = 50,
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100154 LogSoftmax = 51,
Aron Virginas-Tar85121a22019-10-23 10:41:35 +0100155 Comparison = 52,
josh minor4a3c6102020-01-06 16:40:46 -0600156 StandIn = 53,
Mike Kellyc9ea45a2020-02-28 18:11:58 +0000157 ElementwiseUnary = 54,
James Conroy8d333182020-05-13 10:27:58 +0100158 Transpose = 55,
159 QLstm = 56
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000160}
161
162// Base layer table to be used as part of other layers
163table LayerBase {
164 index:uint;
165 layerName:string;
166 layerType:LayerType;
167 inputSlots:[InputSlot];
168 outputSlots:[OutputSlot];
169}
170
171table BindableLayerBase {
172 base:LayerBase;
173 layerBindingId:int;
174}
175
176// Table for each layer defined below
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100177
josh minor4a3c6102020-01-06 16:40:46 -0600178/// @deprecated Use ElementwiseUnaryLayer instead
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100179table AbsLayer {
180 base:LayerBase;
181}
182
Mike Kellyaf484012019-02-20 16:53:11 +0000183table ActivationLayer {
184 base:LayerBase;
185 descriptor:ActivationDescriptor;
186}
187
188table ActivationDescriptor {
Tee Jung86bc3d82019-10-01 11:25:56 +0900189 activationFunction:ActivationFunction = Sigmoid;
Mike Kellyaf484012019-02-20 16:53:11 +0000190 a:float;
191 b:float;
192}
193
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000194table AdditionLayer {
195 base:LayerBase;
196}
197
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100198table ArgMinMaxLayer {
199 base:LayerBase;
200 descriptor:ArgMinMaxDescriptor;
201}
202
203table ArgMinMaxDescriptor{
Tee Jung86bc3d82019-10-01 11:25:56 +0900204 argMinMaxFunction:ArgMinMaxFunction;
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100205 axis:int;
206}
207
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100208enum ComparisonOperation : byte {
209 Equal = 0,
210 Greater = 1,
211 GreaterOrEqual = 2,
212 Less = 3,
213 LessOrEqual = 4,
214 NotEqual = 5
215}
216
217table ComparisonDescriptor {
218 operation:ComparisonOperation;
219}
220
221table ComparisonLayer {
222 base:LayerBase;
223 descriptor:ComparisonDescriptor;
224}
225
Conor Kennedy76277882019-02-26 08:29:54 +0000226table ConstantLayer {
227 base:LayerBase;
228 input:ConstTensor;
229}
230
Mike Kellya0766c32019-02-19 17:22:07 +0000231table Convolution2dLayer {
232 base:LayerBase;
233 descriptor:Convolution2dDescriptor;
234 weights:ConstTensor;
235 biases:ConstTensor;
236}
237
238table Convolution2dDescriptor {
239 padLeft:uint;
240 padRight:uint;
241 padTop:uint;
242 padBottom:uint;
243 strideX:uint;
244 strideY:uint;
Matthew Benthamacad04e2019-05-13 10:02:45 +0100245 dilationX:uint = 1;
246 dilationY:uint = 1;
Mike Kellya0766c32019-02-19 17:22:07 +0000247 biasEnabled:bool = false;
248 dataLayout:DataLayout = NCHW;
249}
250
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100251table DepthToSpaceLayer {
252 base:LayerBase;
253 descriptor:DepthToSpaceDescriptor;
254}
255
256table DepthToSpaceDescriptor {
257 blockSize:uint;
258 dataLayout:DataLayout;
259}
260
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000261table DivisionLayer {
262 base:LayerBase;
263}
264
josh minor4a3c6102020-01-06 16:40:46 -0600265enum UnaryOperation : byte {
266 Abs = 0,
267 Rsqrt = 1,
268 Sqrt = 2,
269 Exp = 3,
270 Neg = 4
271}
272
273table ElementwiseUnaryDescriptor {
274 operation:UnaryOperation;
275}
276
277table ElementwiseUnaryLayer {
278 base:LayerBase;
279 descriptor:ElementwiseUnaryDescriptor;
280}
281
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100282/// @deprecated Use ComparisonLayer instead
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000283table EqualLayer {
284 base:LayerBase;
285}
286
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000287table FloorLayer{
288 base:LayerBase;
289}
290
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000291table FullyConnectedLayer {
292 base:LayerBase;
293 descriptor:FullyConnectedDescriptor;
294 weights:ConstTensor;
295 biases:ConstTensor;
296}
297
298table FullyConnectedDescriptor {
299 biasEnabled:bool = false;
300 transposeWeightsMatrix:bool = false;
301}
302
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000303table GatherLayer {
304 base:LayerBase;
305}
306
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100307/// @deprecated Use ComparisonLayer instead
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000308table GreaterLayer {
309 base:LayerBase;
310}
311
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000312table InputLayer {
313 base:BindableLayerBase;
314}
315
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100316table InstanceNormalizationLayer {
317 base:LayerBase;
318 descriptor:InstanceNormalizationDescriptor;
319}
320
321table InstanceNormalizationDescriptor {
322 gamma:float;
323 beta:float;
324 eps:float;
325 dataLayout:DataLayout;
326}
327
Sadik Armagan26257852019-10-14 13:00:47 +0100328table LogSoftmaxLayer {
329 base:LayerBase;
330 descriptor:LogSoftmaxDescriptor;
331}
332
333table LogSoftmaxDescriptor {
334 beta:float = 1;
335 axis:int = -1;
336}
337
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000338table L2NormalizationLayer {
339 base:LayerBase;
340 descriptor:L2NormalizationDescriptor;
341}
342
343table L2NormalizationDescriptor {
344 dataLayout:DataLayout = NCHW;
Ferran Balaguer0dcffec2019-06-18 16:25:06 +0100345 eps:float = 1e-12;
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000346}
347
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000348table MinimumLayer {
349 base:LayerBase;
350}
351
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000352table MaximumLayer {
353 base:LayerBase;
354}
355
Sadik Armagan5f450272019-02-12 14:31:45 +0000356table MultiplicationLayer {
357 base:LayerBase;
358}
359
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000360table Pooling2dLayer {
361 base:LayerBase;
362 descriptor:Pooling2dDescriptor;
363}
364
365enum PoolingAlgorithm : byte {
366 Max = 0,
367 Average = 1,
368 L2 = 2
369}
370
371enum OutputShapeRounding : byte {
372 Floor = 0,
373 Ceiling = 1
374}
375
376enum PaddingMethod : byte {
377 IgnoreValue = 0,
378 Exclude = 1
379}
380
381table Pooling2dDescriptor {
382 poolType:PoolingAlgorithm;
383 padLeft:uint;
384 padRight:uint;
385 padTop:uint;
386 padBottom:uint;
387 poolWidth:uint;
388 poolHeight:uint;
389 strideX:uint;
390 strideY:uint;
391 outputShapeRounding:OutputShapeRounding;
392 paddingMethod:PaddingMethod;
393 dataLayout:DataLayout;
394}
395
Derek Lamberti87acb272019-03-27 16:51:31 +0000396table QuantizeLayer {
397 base:LayerBase;
398}
399
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000400table SoftmaxLayer {
401 base:LayerBase;
402 descriptor:SoftmaxDescriptor;
403}
404
405table SoftmaxDescriptor {
406 beta:float;
407}
408
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000409table DepthwiseConvolution2dLayer {
410 base:LayerBase;
411 descriptor:DepthwiseConvolution2dDescriptor;
412 weights:ConstTensor;
413 biases:ConstTensor;
414}
415
416table DepthwiseConvolution2dDescriptor {
417 padLeft:uint;
418 padRight:uint;
419 padTop:uint;
420 padBottom:uint;
421 strideX:uint;
422 strideY:uint;
Matthew Benthamacad04e2019-05-13 10:02:45 +0100423 dilationX:uint = 1;
424 dilationY:uint = 1;
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000425 biasEnabled:bool = false;
426 dataLayout:DataLayout = NCHW;
427}
428
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000429table OutputLayer {
430 base:BindableLayerBase;
431}
432
Saoirse Stewart263829c2019-02-19 15:54:14 +0000433table ReshapeLayer {
434 base:LayerBase;
435 descriptor:ReshapeDescriptor;
436}
437
438table ReshapeDescriptor {
439 targetShape:[uint];
440}
441
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000442table PermuteLayer {
443 base:LayerBase;
444 descriptor:PermuteDescriptor;
445}
446
447table PermuteDescriptor {
448 dimMappings:[uint];
449}
450
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000451table SpaceToBatchNdLayer {
452 base:LayerBase;
453 descriptor:SpaceToBatchNdDescriptor;
454}
455
456table SpaceToBatchNdDescriptor {
457 blockShape:[uint];
458 padList:[uint];
459 dataLayout:DataLayout;
460}
461
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100462table SpaceToDepthLayer {
463 base:LayerBase;
464 descriptor:SpaceToDepthDescriptor;
465}
466
467table SpaceToDepthDescriptor {
468 blockSize:uint;
469 dataLayout:DataLayout;
470}
471
Conor Kennedyda1f9752019-03-01 14:37:12 +0000472table SubtractionLayer {
473 base:LayerBase;
474}
475
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000476table BatchToSpaceNdLayer {
477 base:LayerBase;
478 descriptor:BatchToSpaceNdDescriptor;
479}
480
481table BatchToSpaceNdDescriptor {
482 blockShape:[uint];
483 crops:[uint];
484 dataLayout:DataLayout;
485}
486
Nina Drozd57728782019-02-27 10:53:27 +0000487enum NormalizationAlgorithmChannel : byte {
488 Across = 0,
489 Within = 1
490}
491
492enum NormalizationAlgorithmMethod : byte {
493 LocalBrightness = 0,
494 LocalContrast = 1
495}
496
497table NormalizationLayer {
498 base:LayerBase;
499 descriptor:NormalizationDescriptor;
500}
501
502table NormalizationDescriptor {
503 normChannelType:NormalizationAlgorithmChannel = Across;
504 normMethodType:NormalizationAlgorithmMethod = LocalBrightness;
505 normSize:uint;
506 alpha:float;
507 beta:float;
508 k:float;
509 dataLayout:DataLayout = NCHW;
510}
511
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000512table MeanLayer {
513 base:LayerBase;
514 descriptor:MeanDescriptor;
515}
516
517table MeanDescriptor {
518 axis:[uint];
519 keepDims:bool = false;
520}
521
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000522table PadLayer {
523 base:LayerBase;
524 descriptor:PadDescriptor;
525}
526
527table PadDescriptor {
528 padList:[uint];
David Monahan34757812019-06-19 11:47:21 +0100529 padValue:float = 0;
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000530}
531
josh minor4a3c6102020-01-06 16:40:46 -0600532/// @deprecated Use ElementwiseUnaryLayer instead
Sadik Armagan8b42a382019-03-01 14:24:49 +0000533table RsqrtLayer {
534 base:LayerBase;
535}
536
ruoyan018e7fa232019-02-28 15:09:07 +0000537table BatchNormalizationLayer {
538 base:LayerBase;
539 descriptor:BatchNormalizationDescriptor;
540 mean:ConstTensor;
541 variance:ConstTensor;
542 beta:ConstTensor;
543 gamma:ConstTensor;
544}
545
546table BatchNormalizationDescriptor {
547 eps:float;
548 dataLayout:DataLayout;
549}
550
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100551/// @deprecated Use ResizeLayer instead
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000552table ResizeBilinearLayer {
553 base:LayerBase;
554 descriptor:ResizeBilinearDescriptor;
555}
556
557table ResizeBilinearDescriptor {
558 targetWidth:uint;
559 targetHeight:uint;
560 dataLayout:DataLayout;
561}
562
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100563table SliceLayer {
564 base:LayerBase;
565 descriptor:SliceDescriptor;
566}
567
568table SliceDescriptor {
569 begin:[uint];
570 size:[uint];
571}
572
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000573table StridedSliceLayer {
574 base:LayerBase;
575 descriptor:StridedSliceDescriptor;
576}
577
578table StridedSliceDescriptor {
579 begin:[int];
580 end:[int];
581 stride:[int];
582 beginMask:int;
583 endMask:int;
584 shrinkAxisMask:int;
585 ellipsisMask:int;
586 newAxisMask:int;
587 dataLayout:DataLayout;
588}
589
Jim Flynne242f2d2019-05-22 14:24:13 +0100590table ConcatLayer {
591 base:LayerBase;
592 descriptor:OriginsDescriptor;
593}
594
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100595/// @deprecated Use ConcatLayer instead
Jim Flynnac25a1b2019-02-28 10:40:49 +0000596table MergerLayer {
597 base:LayerBase;
598 descriptor:OriginsDescriptor;
599}
600
601table UintVector {
602 data:[uint];
603}
604
605table OriginsDescriptor {
606 concatAxis:uint;
607 numViews:uint;
608 numDimensions:uint;
609 viewOrigins:[UintVector];
610}
611
Jim Flynn18ce3382019-03-08 11:08:30 +0000612table ViewsDescriptor {
613 origins:OriginsDescriptor;
614 viewSizes:[UintVector];
615}
616
617table SplitterLayer {
618 base:LayerBase;
619 descriptor:ViewsDescriptor;
620}
621
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000622table DetectionPostProcessLayer {
623 base:LayerBase;
624 descriptor:DetectionPostProcessDescriptor;
625 anchors:ConstTensor;
626}
627
628table DetectionPostProcessDescriptor {
629 maxDetections:uint;
630 maxClassesPerDetection:uint;
631 detectionsPerClass:uint;
632 nmsScoreThreshold:float;
633 nmsIouThreshold:float;
634 numClasses:uint;
635 useRegularNms:bool;
636 scaleX:float;
637 scaleY:float;
638 scaleW:float;
639 scaleH:float;
640}
641
Jim Flynn11af3752019-03-19 17:22:29 +0000642table LstmInputParams {
643 inputToForgetWeights:ConstTensor;
644 inputToCellWeights:ConstTensor;
645 inputToOutputWeights:ConstTensor;
646 recurrentToForgetWeights:ConstTensor;
647 recurrentToCellWeights:ConstTensor;
648 recurrentToOutputWeights:ConstTensor;
649 forgetGateBias:ConstTensor;
650 cellBias:ConstTensor;
651 outputGateBias:ConstTensor;
652
653 inputToInputWeights:ConstTensor;
654 recurrentToInputWeights:ConstTensor;
655 cellToInputWeights:ConstTensor;
656 inputGateBias:ConstTensor;
657
658 projectionWeights:ConstTensor;
659 projectionBias:ConstTensor;
660
661 cellToForgetWeights:ConstTensor;
662 cellToOutputWeights:ConstTensor;
Jan Eilersf8c62972019-07-17 11:07:49 +0100663
664 inputLayerNormWeights:ConstTensor;
665 forgetLayerNormWeights:ConstTensor;
666 cellLayerNormWeights:ConstTensor;
667 outputLayerNormWeights:ConstTensor;
Jim Flynn11af3752019-03-19 17:22:29 +0000668}
669
James Conroy8d333182020-05-13 10:27:58 +0100670table LstmDescriptor {
671 activationFunc:uint;
672 clippingThresCell:float;
673 clippingThresProj:float;
674 cifgEnabled:bool = true;
675 peepholeEnabled:bool = false;
676 projectionEnabled:bool = false;
677 layerNormEnabled:bool = false;
678}
679
680table LstmLayer {
681 base:LayerBase;
682 descriptor:LstmDescriptor;
683 inputParams:LstmInputParams;
684}
685
686table QLstmInputParams {
687 // Mandatory
688 inputToForgetWeights:ConstTensor;
689 inputToCellWeights:ConstTensor;
690 inputToOutputWeights:ConstTensor;
691
692 recurrentToForgetWeights:ConstTensor;
693 recurrentToCellWeights:ConstTensor;
694 recurrentToOutputWeights:ConstTensor;
695
696 forgetGateBias:ConstTensor;
697 cellBias:ConstTensor;
698 outputGateBias:ConstTensor;
699
700 // CIFG
701 inputToInputWeights:ConstTensor;
702 recurrentToInputWeights:ConstTensor;
703 inputGateBias:ConstTensor;
704
705 // Projection
706 projectionWeights:ConstTensor;
707 projectionBias:ConstTensor;
708
709 // Peephole
710 cellToInputWeights:ConstTensor;
711 cellToForgetWeights:ConstTensor;
712 cellToOutputWeights:ConstTensor;
713
714 // Layer norm
715 inputLayerNormWeights:ConstTensor;
716 forgetLayerNormWeights:ConstTensor;
717 cellLayerNormWeights:ConstTensor;
718 outputLayerNormWeights:ConstTensor;
719}
720
721table QLstmDescriptor {
722 cifgEnabled:bool = true;
723 peepholeEnabled:bool = false;
724 projectionEnabled:bool = false;
725 layerNormEnabled:bool = false;
726
727 cellClip:float;
728 projectionClip:float;
729
730 inputIntermediateScale:float;
731 forgetIntermediateScale:float;
732 cellIntermediateScale:float;
733 outputIntermediateScale:float;
734
735 hiddenStateZeroPoint:int;
736 hiddenStateScale:float;
737}
738
739table QLstmLayer {
740 base:LayerBase;
741 descriptor:QLstmDescriptor;
742 inputParams:QLstmInputParams;
743}
744
Jan Eilers5b01a892019-07-23 09:47:43 +0100745table QuantizedLstmInputParams {
746 inputToInputWeights:ConstTensor;
747 inputToForgetWeights:ConstTensor;
748 inputToCellWeights:ConstTensor;
749 inputToOutputWeights:ConstTensor;
750
751 recurrentToInputWeights:ConstTensor;
752 recurrentToForgetWeights:ConstTensor;
753 recurrentToCellWeights:ConstTensor;
754 recurrentToOutputWeights:ConstTensor;
755
756 inputGateBias:ConstTensor;
757 forgetGateBias:ConstTensor;
758 cellBias:ConstTensor;
759 outputGateBias:ConstTensor;
760}
761
Jan Eilers5b01a892019-07-23 09:47:43 +0100762table QuantizedLstmLayer {
763 base:LayerBase;
764 inputParams:QuantizedLstmInputParams;
765}
766
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000767table DequantizeLayer {
768 base:LayerBase;
769}
770
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100771table MergeLayer {
772 base:LayerBase;
773}
774
Sadik Armaganeff363d2019-04-05 15:25:46 +0100775table SwitchLayer {
776 base:LayerBase;
777}
778
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100779table PreluLayer {
780 base:LayerBase;
781}
782
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100783table TransposeConvolution2dLayer {
784 base:LayerBase;
785 descriptor:TransposeConvolution2dDescriptor;
786 weights:ConstTensor;
787 biases:ConstTensor;
788}
789
790table TransposeConvolution2dDescriptor {
791 padLeft:uint;
792 padRight:uint;
793 padTop:uint;
794 padBottom:uint;
795 strideX:uint;
796 strideY:uint;
797 biasEnabled:bool = false;
798 dataLayout:DataLayout = NCHW;
799}
800
Mike Kellyc9ea45a2020-02-28 18:11:58 +0000801table TransposeLayer {
802 base:LayerBase;
803 descriptor:TransposeDescriptor;
804}
805
806table TransposeDescriptor {
807 dimMappings:[uint];
808}
809
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100810table ResizeLayer {
811 base:LayerBase;
812 descriptor:ResizeDescriptor;
813}
814
815table ResizeDescriptor {
816 targetHeight:uint;
817 targetWidth:uint;
818 method:ResizeMethod = NearestNeighbor;
819 dataLayout:DataLayout;
820}
821
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100822table StackLayer {
823 base:LayerBase;
824 descriptor:StackDescriptor;
825}
826
827table StackDescriptor {
828 axis:uint;
829 numInputs:uint;
830 inputShape:[uint];
831}
832
Aron Virginas-Tar85121a22019-10-23 10:41:35 +0100833table StandInDescriptor {
834 numInputs:uint;
835 numOutputs:uint;
836}
837
838table StandInLayer {
839 base:LayerBase;
840 descriptor:StandInDescriptor;
841}
842
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000843union Layer {
Mike Kellyaf484012019-02-20 16:53:11 +0000844 ActivationLayer,
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000845 AdditionLayer,
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000846 BatchToSpaceNdLayer,
ruoyan018e7fa232019-02-28 15:09:07 +0000847 BatchNormalizationLayer,
Conor Kennedy76277882019-02-26 08:29:54 +0000848 ConstantLayer,
Mike Kellya0766c32019-02-19 17:22:07 +0000849 Convolution2dLayer,
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000850 DepthwiseConvolution2dLayer,
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000851 FullyConnectedLayer,
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000852 InputLayer,
Sadik Armagan5f450272019-02-12 14:31:45 +0000853 MultiplicationLayer,
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000854 OutputLayer,
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000855 PermuteLayer,
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000856 Pooling2dLayer,
Saoirse Stewart263829c2019-02-19 15:54:14 +0000857 ReshapeLayer,
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000858 SoftmaxLayer,
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000859 SpaceToBatchNdLayer,
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000860 DivisionLayer,
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000861 MinimumLayer,
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000862 EqualLayer,
Nina Drozd57728782019-02-27 10:53:27 +0000863 MaximumLayer,
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000864 NormalizationLayer,
Sadik Armagan8b42a382019-03-01 14:24:49 +0000865 PadLayer,
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000866 RsqrtLayer,
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000867 FloorLayer,
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000868 GreaterLayer,
Conor Kennedyda1f9752019-03-01 14:37:12 +0000869 ResizeBilinearLayer,
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000870 SubtractionLayer,
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000871 StridedSliceLayer,
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000872 GatherLayer,
Jim Flynnac25a1b2019-02-28 10:40:49 +0000873 MeanLayer,
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000874 MergerLayer,
Jim Flynn18ce3382019-03-08 11:08:30 +0000875 L2NormalizationLayer,
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000876 SplitterLayer,
Jim Flynn11af3752019-03-19 17:22:29 +0000877 DetectionPostProcessLayer,
Derek Lamberti87acb272019-03-27 16:51:31 +0000878 LstmLayer,
Jan Eilers5b01a892019-07-23 09:47:43 +0100879 QuantizedLstmLayer,
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000880 QuantizeLayer,
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100881 DequantizeLayer,
Sadik Armaganeff363d2019-04-05 15:25:46 +0100882 MergeLayer,
Jim Flynne242f2d2019-05-22 14:24:13 +0100883 SwitchLayer,
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100884 ConcatLayer,
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100885 SpaceToDepthLayer,
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100886 PreluLayer,
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100887 TransposeConvolution2dLayer,
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100888 ResizeLayer,
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100889 StackLayer,
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100890 AbsLayer,
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100891 ArgMinMaxLayer,
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100892 SliceLayer,
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100893 DepthToSpaceLayer,
Sadik Armagan26257852019-10-14 13:00:47 +0100894 InstanceNormalizationLayer,
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100895 LogSoftmaxLayer,
Aron Virginas-Tar85121a22019-10-23 10:41:35 +0100896 ComparisonLayer,
josh minor4a3c6102020-01-06 16:40:46 -0600897 StandInLayer,
Mike Kellyc9ea45a2020-02-28 18:11:58 +0000898 ElementwiseUnaryLayer,
James Conroy8d333182020-05-13 10:27:58 +0100899 TransposeLayer,
900 QLstmLayer
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000901}
902
Saoirse Stewart49dbe0e2019-02-05 17:27:06 +0000903table AnyLayer {
904 layer:Layer;
905}
906
Tee Jungaa920c52019-11-05 10:48:25 +0000907table FeatureCompatibilityVersions {
908 bindingIdsScheme:uint = 0;
909}
910
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000911// Root type for serialized data is the graph of the network
912table SerializedGraph {
Saoirse Stewart49dbe0e2019-02-05 17:27:06 +0000913 layers:[AnyLayer];
Tee Jungaa920c52019-11-05 10:48:25 +0000914 inputIds:[int];
915 outputIds:[int];
916 featureVersions:FeatureCompatibilityVersions;
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000917}
918
919root_type SerializedGraph;