blob: 532c12c70609c51e47e48804bf8e320dd889c726 [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;
David Monahan4a0c9b92020-05-30 09:48:39 +0100561 alignCorners:bool;
562 halfPixelCenters:bool;
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000563}
564
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100565table SliceLayer {
566 base:LayerBase;
567 descriptor:SliceDescriptor;
568}
569
570table SliceDescriptor {
571 begin:[uint];
572 size:[uint];
573}
574
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000575table StridedSliceLayer {
576 base:LayerBase;
577 descriptor:StridedSliceDescriptor;
578}
579
580table StridedSliceDescriptor {
581 begin:[int];
582 end:[int];
583 stride:[int];
584 beginMask:int;
585 endMask:int;
586 shrinkAxisMask:int;
587 ellipsisMask:int;
588 newAxisMask:int;
589 dataLayout:DataLayout;
590}
591
Jim Flynne242f2d2019-05-22 14:24:13 +0100592table ConcatLayer {
593 base:LayerBase;
594 descriptor:OriginsDescriptor;
595}
596
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100597/// @deprecated Use ConcatLayer instead
Jim Flynnac25a1b2019-02-28 10:40:49 +0000598table MergerLayer {
599 base:LayerBase;
600 descriptor:OriginsDescriptor;
601}
602
603table UintVector {
604 data:[uint];
605}
606
607table OriginsDescriptor {
608 concatAxis:uint;
609 numViews:uint;
610 numDimensions:uint;
611 viewOrigins:[UintVector];
612}
613
Jim Flynn18ce3382019-03-08 11:08:30 +0000614table ViewsDescriptor {
615 origins:OriginsDescriptor;
616 viewSizes:[UintVector];
617}
618
619table SplitterLayer {
620 base:LayerBase;
621 descriptor:ViewsDescriptor;
622}
623
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000624table DetectionPostProcessLayer {
625 base:LayerBase;
626 descriptor:DetectionPostProcessDescriptor;
627 anchors:ConstTensor;
628}
629
630table DetectionPostProcessDescriptor {
631 maxDetections:uint;
632 maxClassesPerDetection:uint;
633 detectionsPerClass:uint;
634 nmsScoreThreshold:float;
635 nmsIouThreshold:float;
636 numClasses:uint;
637 useRegularNms:bool;
638 scaleX:float;
639 scaleY:float;
640 scaleW:float;
641 scaleH:float;
642}
643
Jim Flynn11af3752019-03-19 17:22:29 +0000644table LstmInputParams {
645 inputToForgetWeights:ConstTensor;
646 inputToCellWeights:ConstTensor;
647 inputToOutputWeights:ConstTensor;
648 recurrentToForgetWeights:ConstTensor;
649 recurrentToCellWeights:ConstTensor;
650 recurrentToOutputWeights:ConstTensor;
651 forgetGateBias:ConstTensor;
652 cellBias:ConstTensor;
653 outputGateBias:ConstTensor;
654
655 inputToInputWeights:ConstTensor;
656 recurrentToInputWeights:ConstTensor;
657 cellToInputWeights:ConstTensor;
658 inputGateBias:ConstTensor;
659
660 projectionWeights:ConstTensor;
661 projectionBias:ConstTensor;
662
663 cellToForgetWeights:ConstTensor;
664 cellToOutputWeights:ConstTensor;
Jan Eilersf8c62972019-07-17 11:07:49 +0100665
666 inputLayerNormWeights:ConstTensor;
667 forgetLayerNormWeights:ConstTensor;
668 cellLayerNormWeights:ConstTensor;
669 outputLayerNormWeights:ConstTensor;
Jim Flynn11af3752019-03-19 17:22:29 +0000670}
671
James Conroy8d333182020-05-13 10:27:58 +0100672table LstmDescriptor {
673 activationFunc:uint;
674 clippingThresCell:float;
675 clippingThresProj:float;
676 cifgEnabled:bool = true;
677 peepholeEnabled:bool = false;
678 projectionEnabled:bool = false;
679 layerNormEnabled:bool = false;
680}
681
682table LstmLayer {
683 base:LayerBase;
684 descriptor:LstmDescriptor;
685 inputParams:LstmInputParams;
686}
687
688table QLstmInputParams {
689 // Mandatory
690 inputToForgetWeights:ConstTensor;
691 inputToCellWeights:ConstTensor;
692 inputToOutputWeights:ConstTensor;
693
694 recurrentToForgetWeights:ConstTensor;
695 recurrentToCellWeights:ConstTensor;
696 recurrentToOutputWeights:ConstTensor;
697
698 forgetGateBias:ConstTensor;
699 cellBias:ConstTensor;
700 outputGateBias:ConstTensor;
701
702 // CIFG
703 inputToInputWeights:ConstTensor;
704 recurrentToInputWeights:ConstTensor;
705 inputGateBias:ConstTensor;
706
707 // Projection
708 projectionWeights:ConstTensor;
709 projectionBias:ConstTensor;
710
711 // Peephole
712 cellToInputWeights:ConstTensor;
713 cellToForgetWeights:ConstTensor;
714 cellToOutputWeights:ConstTensor;
715
716 // Layer norm
717 inputLayerNormWeights:ConstTensor;
718 forgetLayerNormWeights:ConstTensor;
719 cellLayerNormWeights:ConstTensor;
720 outputLayerNormWeights:ConstTensor;
721}
722
723table QLstmDescriptor {
724 cifgEnabled:bool = true;
725 peepholeEnabled:bool = false;
726 projectionEnabled:bool = false;
727 layerNormEnabled:bool = false;
728
729 cellClip:float;
730 projectionClip:float;
731
732 inputIntermediateScale:float;
733 forgetIntermediateScale:float;
734 cellIntermediateScale:float;
735 outputIntermediateScale:float;
736
737 hiddenStateZeroPoint:int;
738 hiddenStateScale:float;
739}
740
741table QLstmLayer {
742 base:LayerBase;
743 descriptor:QLstmDescriptor;
744 inputParams:QLstmInputParams;
745}
746
Jan Eilers5b01a892019-07-23 09:47:43 +0100747table QuantizedLstmInputParams {
748 inputToInputWeights:ConstTensor;
749 inputToForgetWeights:ConstTensor;
750 inputToCellWeights:ConstTensor;
751 inputToOutputWeights:ConstTensor;
752
753 recurrentToInputWeights:ConstTensor;
754 recurrentToForgetWeights:ConstTensor;
755 recurrentToCellWeights:ConstTensor;
756 recurrentToOutputWeights:ConstTensor;
757
758 inputGateBias:ConstTensor;
759 forgetGateBias:ConstTensor;
760 cellBias:ConstTensor;
761 outputGateBias:ConstTensor;
762}
763
Jan Eilers5b01a892019-07-23 09:47:43 +0100764table QuantizedLstmLayer {
765 base:LayerBase;
766 inputParams:QuantizedLstmInputParams;
767}
768
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000769table DequantizeLayer {
770 base:LayerBase;
771}
772
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100773table MergeLayer {
774 base:LayerBase;
775}
776
Sadik Armaganeff363d2019-04-05 15:25:46 +0100777table SwitchLayer {
778 base:LayerBase;
779}
780
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100781table PreluLayer {
782 base:LayerBase;
783}
784
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100785table TransposeConvolution2dLayer {
786 base:LayerBase;
787 descriptor:TransposeConvolution2dDescriptor;
788 weights:ConstTensor;
789 biases:ConstTensor;
790}
791
792table TransposeConvolution2dDescriptor {
793 padLeft:uint;
794 padRight:uint;
795 padTop:uint;
796 padBottom:uint;
797 strideX:uint;
798 strideY:uint;
799 biasEnabled:bool = false;
800 dataLayout:DataLayout = NCHW;
801}
802
Mike Kellyc9ea45a2020-02-28 18:11:58 +0000803table TransposeLayer {
804 base:LayerBase;
805 descriptor:TransposeDescriptor;
806}
807
808table TransposeDescriptor {
809 dimMappings:[uint];
810}
811
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100812table ResizeLayer {
813 base:LayerBase;
814 descriptor:ResizeDescriptor;
815}
816
817table ResizeDescriptor {
818 targetHeight:uint;
819 targetWidth:uint;
820 method:ResizeMethod = NearestNeighbor;
821 dataLayout:DataLayout;
David Monahan4a0c9b92020-05-30 09:48:39 +0100822 alignCorners:bool;
823 halfPixelCenters:bool;
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100824}
825
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100826table StackLayer {
827 base:LayerBase;
828 descriptor:StackDescriptor;
829}
830
831table StackDescriptor {
832 axis:uint;
833 numInputs:uint;
834 inputShape:[uint];
835}
836
Aron Virginas-Tar85121a22019-10-23 10:41:35 +0100837table StandInDescriptor {
838 numInputs:uint;
839 numOutputs:uint;
840}
841
842table StandInLayer {
843 base:LayerBase;
844 descriptor:StandInDescriptor;
845}
846
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000847union Layer {
Mike Kellyaf484012019-02-20 16:53:11 +0000848 ActivationLayer,
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000849 AdditionLayer,
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000850 BatchToSpaceNdLayer,
ruoyan018e7fa232019-02-28 15:09:07 +0000851 BatchNormalizationLayer,
Conor Kennedy76277882019-02-26 08:29:54 +0000852 ConstantLayer,
Mike Kellya0766c32019-02-19 17:22:07 +0000853 Convolution2dLayer,
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000854 DepthwiseConvolution2dLayer,
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000855 FullyConnectedLayer,
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000856 InputLayer,
Sadik Armagan5f450272019-02-12 14:31:45 +0000857 MultiplicationLayer,
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000858 OutputLayer,
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000859 PermuteLayer,
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000860 Pooling2dLayer,
Saoirse Stewart263829c2019-02-19 15:54:14 +0000861 ReshapeLayer,
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000862 SoftmaxLayer,
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000863 SpaceToBatchNdLayer,
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000864 DivisionLayer,
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000865 MinimumLayer,
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000866 EqualLayer,
Nina Drozd57728782019-02-27 10:53:27 +0000867 MaximumLayer,
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000868 NormalizationLayer,
Sadik Armagan8b42a382019-03-01 14:24:49 +0000869 PadLayer,
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000870 RsqrtLayer,
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000871 FloorLayer,
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000872 GreaterLayer,
Conor Kennedyda1f9752019-03-01 14:37:12 +0000873 ResizeBilinearLayer,
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000874 SubtractionLayer,
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000875 StridedSliceLayer,
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000876 GatherLayer,
Jim Flynnac25a1b2019-02-28 10:40:49 +0000877 MeanLayer,
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000878 MergerLayer,
Jim Flynn18ce3382019-03-08 11:08:30 +0000879 L2NormalizationLayer,
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000880 SplitterLayer,
Jim Flynn11af3752019-03-19 17:22:29 +0000881 DetectionPostProcessLayer,
Derek Lamberti87acb272019-03-27 16:51:31 +0000882 LstmLayer,
Jan Eilers5b01a892019-07-23 09:47:43 +0100883 QuantizedLstmLayer,
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000884 QuantizeLayer,
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100885 DequantizeLayer,
Sadik Armaganeff363d2019-04-05 15:25:46 +0100886 MergeLayer,
Jim Flynne242f2d2019-05-22 14:24:13 +0100887 SwitchLayer,
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100888 ConcatLayer,
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100889 SpaceToDepthLayer,
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100890 PreluLayer,
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100891 TransposeConvolution2dLayer,
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100892 ResizeLayer,
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100893 StackLayer,
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100894 AbsLayer,
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100895 ArgMinMaxLayer,
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100896 SliceLayer,
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100897 DepthToSpaceLayer,
Sadik Armagan26257852019-10-14 13:00:47 +0100898 InstanceNormalizationLayer,
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100899 LogSoftmaxLayer,
Aron Virginas-Tar85121a22019-10-23 10:41:35 +0100900 ComparisonLayer,
josh minor4a3c6102020-01-06 16:40:46 -0600901 StandInLayer,
Mike Kellyc9ea45a2020-02-28 18:11:58 +0000902 ElementwiseUnaryLayer,
James Conroy8d333182020-05-13 10:27:58 +0100903 TransposeLayer,
904 QLstmLayer
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000905}
906
Saoirse Stewart49dbe0e2019-02-05 17:27:06 +0000907table AnyLayer {
908 layer:Layer;
909}
910
Tee Jungaa920c52019-11-05 10:48:25 +0000911table FeatureCompatibilityVersions {
912 bindingIdsScheme:uint = 0;
913}
914
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000915// Root type for serialized data is the graph of the network
916table SerializedGraph {
Saoirse Stewart49dbe0e2019-02-05 17:27:06 +0000917 layers:[AnyLayer];
Tee Jungaa920c52019-11-05 10:48:25 +0000918 inputIds:[int];
919 outputIds:[int];
920 featureVersions:FeatureCompatibilityVersions;
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000921}
922
923root_type SerializedGraph;