blob: 18415ce7853a897806c4991b19f13b3e86eadc22 [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,
Keith Davis300ad562020-06-04 16:34:23 +0100159 QLstm = 56,
160 Fill = 57
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000161}
162
163// Base layer table to be used as part of other layers
164table LayerBase {
165 index:uint;
166 layerName:string;
167 layerType:LayerType;
168 inputSlots:[InputSlot];
169 outputSlots:[OutputSlot];
170}
171
172table BindableLayerBase {
173 base:LayerBase;
174 layerBindingId:int;
175}
176
177// Table for each layer defined below
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100178
josh minor4a3c6102020-01-06 16:40:46 -0600179/// @deprecated Use ElementwiseUnaryLayer instead
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100180table AbsLayer {
181 base:LayerBase;
182}
183
Mike Kellyaf484012019-02-20 16:53:11 +0000184table ActivationLayer {
185 base:LayerBase;
186 descriptor:ActivationDescriptor;
187}
188
189table ActivationDescriptor {
Tee Jung86bc3d82019-10-01 11:25:56 +0900190 activationFunction:ActivationFunction = Sigmoid;
Mike Kellyaf484012019-02-20 16:53:11 +0000191 a:float;
192 b:float;
193}
194
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000195table AdditionLayer {
196 base:LayerBase;
197}
198
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100199table ArgMinMaxLayer {
200 base:LayerBase;
201 descriptor:ArgMinMaxDescriptor;
202}
203
204table ArgMinMaxDescriptor{
Tee Jung86bc3d82019-10-01 11:25:56 +0900205 argMinMaxFunction:ArgMinMaxFunction;
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100206 axis:int;
207}
208
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100209enum ComparisonOperation : byte {
210 Equal = 0,
211 Greater = 1,
212 GreaterOrEqual = 2,
213 Less = 3,
214 LessOrEqual = 4,
215 NotEqual = 5
216}
217
218table ComparisonDescriptor {
219 operation:ComparisonOperation;
220}
221
222table ComparisonLayer {
223 base:LayerBase;
224 descriptor:ComparisonDescriptor;
225}
226
Conor Kennedy76277882019-02-26 08:29:54 +0000227table ConstantLayer {
228 base:LayerBase;
229 input:ConstTensor;
230}
231
Mike Kellya0766c32019-02-19 17:22:07 +0000232table Convolution2dLayer {
233 base:LayerBase;
234 descriptor:Convolution2dDescriptor;
235 weights:ConstTensor;
236 biases:ConstTensor;
237}
238
239table Convolution2dDescriptor {
240 padLeft:uint;
241 padRight:uint;
242 padTop:uint;
243 padBottom:uint;
244 strideX:uint;
245 strideY:uint;
Matthew Benthamacad04e2019-05-13 10:02:45 +0100246 dilationX:uint = 1;
247 dilationY:uint = 1;
Mike Kellya0766c32019-02-19 17:22:07 +0000248 biasEnabled:bool = false;
249 dataLayout:DataLayout = NCHW;
250}
251
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100252table DepthToSpaceLayer {
253 base:LayerBase;
254 descriptor:DepthToSpaceDescriptor;
255}
256
257table DepthToSpaceDescriptor {
258 blockSize:uint;
259 dataLayout:DataLayout;
260}
261
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000262table DivisionLayer {
263 base:LayerBase;
264}
265
josh minor4a3c6102020-01-06 16:40:46 -0600266enum UnaryOperation : byte {
267 Abs = 0,
268 Rsqrt = 1,
269 Sqrt = 2,
270 Exp = 3,
271 Neg = 4
272}
273
274table ElementwiseUnaryDescriptor {
275 operation:UnaryOperation;
276}
277
278table ElementwiseUnaryLayer {
279 base:LayerBase;
280 descriptor:ElementwiseUnaryDescriptor;
281}
282
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100283/// @deprecated Use ComparisonLayer instead
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000284table EqualLayer {
285 base:LayerBase;
286}
287
Keith Davis300ad562020-06-04 16:34:23 +0100288table FillLayer {
289 base:LayerBase;
290 descriptor:FillDescriptor;
291}
292
293table FillDescriptor {
294 value:float;
295}
296
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000297table FloorLayer{
298 base:LayerBase;
299}
300
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000301table FullyConnectedLayer {
302 base:LayerBase;
303 descriptor:FullyConnectedDescriptor;
304 weights:ConstTensor;
305 biases:ConstTensor;
306}
307
308table FullyConnectedDescriptor {
309 biasEnabled:bool = false;
310 transposeWeightsMatrix:bool = false;
311}
312
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000313table GatherLayer {
314 base:LayerBase;
315}
316
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100317/// @deprecated Use ComparisonLayer instead
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000318table GreaterLayer {
319 base:LayerBase;
320}
321
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000322table InputLayer {
323 base:BindableLayerBase;
324}
325
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100326table InstanceNormalizationLayer {
327 base:LayerBase;
328 descriptor:InstanceNormalizationDescriptor;
329}
330
331table InstanceNormalizationDescriptor {
332 gamma:float;
333 beta:float;
334 eps:float;
335 dataLayout:DataLayout;
336}
337
Sadik Armagan26257852019-10-14 13:00:47 +0100338table LogSoftmaxLayer {
339 base:LayerBase;
340 descriptor:LogSoftmaxDescriptor;
341}
342
343table LogSoftmaxDescriptor {
344 beta:float = 1;
345 axis:int = -1;
346}
347
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000348table L2NormalizationLayer {
349 base:LayerBase;
350 descriptor:L2NormalizationDescriptor;
351}
352
353table L2NormalizationDescriptor {
354 dataLayout:DataLayout = NCHW;
Ferran Balaguer0dcffec2019-06-18 16:25:06 +0100355 eps:float = 1e-12;
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000356}
357
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000358table MinimumLayer {
359 base:LayerBase;
360}
361
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000362table MaximumLayer {
363 base:LayerBase;
364}
365
Sadik Armagan5f450272019-02-12 14:31:45 +0000366table MultiplicationLayer {
367 base:LayerBase;
368}
369
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000370table Pooling2dLayer {
371 base:LayerBase;
372 descriptor:Pooling2dDescriptor;
373}
374
375enum PoolingAlgorithm : byte {
376 Max = 0,
377 Average = 1,
378 L2 = 2
379}
380
381enum OutputShapeRounding : byte {
382 Floor = 0,
383 Ceiling = 1
384}
385
386enum PaddingMethod : byte {
387 IgnoreValue = 0,
388 Exclude = 1
389}
390
391table Pooling2dDescriptor {
392 poolType:PoolingAlgorithm;
393 padLeft:uint;
394 padRight:uint;
395 padTop:uint;
396 padBottom:uint;
397 poolWidth:uint;
398 poolHeight:uint;
399 strideX:uint;
400 strideY:uint;
401 outputShapeRounding:OutputShapeRounding;
402 paddingMethod:PaddingMethod;
403 dataLayout:DataLayout;
404}
405
Derek Lamberti87acb272019-03-27 16:51:31 +0000406table QuantizeLayer {
407 base:LayerBase;
408}
409
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000410table SoftmaxLayer {
411 base:LayerBase;
412 descriptor:SoftmaxDescriptor;
413}
414
415table SoftmaxDescriptor {
416 beta:float;
417}
418
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000419table DepthwiseConvolution2dLayer {
420 base:LayerBase;
421 descriptor:DepthwiseConvolution2dDescriptor;
422 weights:ConstTensor;
423 biases:ConstTensor;
424}
425
426table DepthwiseConvolution2dDescriptor {
427 padLeft:uint;
428 padRight:uint;
429 padTop:uint;
430 padBottom:uint;
431 strideX:uint;
432 strideY:uint;
Matthew Benthamacad04e2019-05-13 10:02:45 +0100433 dilationX:uint = 1;
434 dilationY:uint = 1;
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000435 biasEnabled:bool = false;
436 dataLayout:DataLayout = NCHW;
437}
438
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000439table OutputLayer {
440 base:BindableLayerBase;
441}
442
Saoirse Stewart263829c2019-02-19 15:54:14 +0000443table ReshapeLayer {
444 base:LayerBase;
445 descriptor:ReshapeDescriptor;
446}
447
448table ReshapeDescriptor {
449 targetShape:[uint];
450}
451
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000452table PermuteLayer {
453 base:LayerBase;
454 descriptor:PermuteDescriptor;
455}
456
457table PermuteDescriptor {
458 dimMappings:[uint];
459}
460
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000461table SpaceToBatchNdLayer {
462 base:LayerBase;
463 descriptor:SpaceToBatchNdDescriptor;
464}
465
466table SpaceToBatchNdDescriptor {
467 blockShape:[uint];
468 padList:[uint];
469 dataLayout:DataLayout;
470}
471
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100472table SpaceToDepthLayer {
473 base:LayerBase;
474 descriptor:SpaceToDepthDescriptor;
475}
476
477table SpaceToDepthDescriptor {
478 blockSize:uint;
479 dataLayout:DataLayout;
480}
481
Conor Kennedyda1f9752019-03-01 14:37:12 +0000482table SubtractionLayer {
483 base:LayerBase;
484}
485
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000486table BatchToSpaceNdLayer {
487 base:LayerBase;
488 descriptor:BatchToSpaceNdDescriptor;
489}
490
491table BatchToSpaceNdDescriptor {
492 blockShape:[uint];
493 crops:[uint];
494 dataLayout:DataLayout;
495}
496
Nina Drozd57728782019-02-27 10:53:27 +0000497enum NormalizationAlgorithmChannel : byte {
498 Across = 0,
499 Within = 1
500}
501
502enum NormalizationAlgorithmMethod : byte {
503 LocalBrightness = 0,
504 LocalContrast = 1
505}
506
507table NormalizationLayer {
508 base:LayerBase;
509 descriptor:NormalizationDescriptor;
510}
511
512table NormalizationDescriptor {
513 normChannelType:NormalizationAlgorithmChannel = Across;
514 normMethodType:NormalizationAlgorithmMethod = LocalBrightness;
515 normSize:uint;
516 alpha:float;
517 beta:float;
518 k:float;
519 dataLayout:DataLayout = NCHW;
520}
521
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000522table MeanLayer {
523 base:LayerBase;
524 descriptor:MeanDescriptor;
525}
526
527table MeanDescriptor {
528 axis:[uint];
529 keepDims:bool = false;
530}
531
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000532table PadLayer {
533 base:LayerBase;
534 descriptor:PadDescriptor;
535}
536
537table PadDescriptor {
538 padList:[uint];
David Monahan34757812019-06-19 11:47:21 +0100539 padValue:float = 0;
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000540}
541
josh minor4a3c6102020-01-06 16:40:46 -0600542/// @deprecated Use ElementwiseUnaryLayer instead
Sadik Armagan8b42a382019-03-01 14:24:49 +0000543table RsqrtLayer {
544 base:LayerBase;
545}
546
ruoyan018e7fa232019-02-28 15:09:07 +0000547table BatchNormalizationLayer {
548 base:LayerBase;
549 descriptor:BatchNormalizationDescriptor;
550 mean:ConstTensor;
551 variance:ConstTensor;
552 beta:ConstTensor;
553 gamma:ConstTensor;
554}
555
556table BatchNormalizationDescriptor {
557 eps:float;
558 dataLayout:DataLayout;
559}
560
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100561/// @deprecated Use ResizeLayer instead
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000562table ResizeBilinearLayer {
563 base:LayerBase;
564 descriptor:ResizeBilinearDescriptor;
565}
566
567table ResizeBilinearDescriptor {
568 targetWidth:uint;
569 targetHeight:uint;
570 dataLayout:DataLayout;
David Monahan4a0c9b92020-05-30 09:48:39 +0100571 alignCorners:bool;
572 halfPixelCenters:bool;
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000573}
574
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100575table SliceLayer {
576 base:LayerBase;
577 descriptor:SliceDescriptor;
578}
579
580table SliceDescriptor {
581 begin:[uint];
582 size:[uint];
583}
584
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000585table StridedSliceLayer {
586 base:LayerBase;
587 descriptor:StridedSliceDescriptor;
588}
589
590table StridedSliceDescriptor {
591 begin:[int];
592 end:[int];
593 stride:[int];
594 beginMask:int;
595 endMask:int;
596 shrinkAxisMask:int;
597 ellipsisMask:int;
598 newAxisMask:int;
599 dataLayout:DataLayout;
600}
601
Jim Flynne242f2d2019-05-22 14:24:13 +0100602table ConcatLayer {
603 base:LayerBase;
604 descriptor:OriginsDescriptor;
605}
606
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100607/// @deprecated Use ConcatLayer instead
Jim Flynnac25a1b2019-02-28 10:40:49 +0000608table MergerLayer {
609 base:LayerBase;
610 descriptor:OriginsDescriptor;
611}
612
613table UintVector {
614 data:[uint];
615}
616
617table OriginsDescriptor {
618 concatAxis:uint;
619 numViews:uint;
620 numDimensions:uint;
621 viewOrigins:[UintVector];
622}
623
Jim Flynn18ce3382019-03-08 11:08:30 +0000624table ViewsDescriptor {
625 origins:OriginsDescriptor;
626 viewSizes:[UintVector];
627}
628
629table SplitterLayer {
630 base:LayerBase;
631 descriptor:ViewsDescriptor;
632}
633
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000634table DetectionPostProcessLayer {
635 base:LayerBase;
636 descriptor:DetectionPostProcessDescriptor;
637 anchors:ConstTensor;
638}
639
640table DetectionPostProcessDescriptor {
641 maxDetections:uint;
642 maxClassesPerDetection:uint;
643 detectionsPerClass:uint;
644 nmsScoreThreshold:float;
645 nmsIouThreshold:float;
646 numClasses:uint;
647 useRegularNms:bool;
648 scaleX:float;
649 scaleY:float;
650 scaleW:float;
651 scaleH:float;
652}
653
Jim Flynn11af3752019-03-19 17:22:29 +0000654table LstmInputParams {
655 inputToForgetWeights:ConstTensor;
656 inputToCellWeights:ConstTensor;
657 inputToOutputWeights:ConstTensor;
658 recurrentToForgetWeights:ConstTensor;
659 recurrentToCellWeights:ConstTensor;
660 recurrentToOutputWeights:ConstTensor;
661 forgetGateBias:ConstTensor;
662 cellBias:ConstTensor;
663 outputGateBias:ConstTensor;
664
665 inputToInputWeights:ConstTensor;
666 recurrentToInputWeights:ConstTensor;
667 cellToInputWeights:ConstTensor;
668 inputGateBias:ConstTensor;
669
670 projectionWeights:ConstTensor;
671 projectionBias:ConstTensor;
672
673 cellToForgetWeights:ConstTensor;
674 cellToOutputWeights:ConstTensor;
Jan Eilersf8c62972019-07-17 11:07:49 +0100675
676 inputLayerNormWeights:ConstTensor;
677 forgetLayerNormWeights:ConstTensor;
678 cellLayerNormWeights:ConstTensor;
679 outputLayerNormWeights:ConstTensor;
Jim Flynn11af3752019-03-19 17:22:29 +0000680}
681
James Conroy8d333182020-05-13 10:27:58 +0100682table LstmDescriptor {
683 activationFunc:uint;
684 clippingThresCell:float;
685 clippingThresProj:float;
686 cifgEnabled:bool = true;
687 peepholeEnabled:bool = false;
688 projectionEnabled:bool = false;
689 layerNormEnabled:bool = false;
690}
691
692table LstmLayer {
693 base:LayerBase;
694 descriptor:LstmDescriptor;
695 inputParams:LstmInputParams;
696}
697
698table QLstmInputParams {
699 // Mandatory
700 inputToForgetWeights:ConstTensor;
701 inputToCellWeights:ConstTensor;
702 inputToOutputWeights:ConstTensor;
703
704 recurrentToForgetWeights:ConstTensor;
705 recurrentToCellWeights:ConstTensor;
706 recurrentToOutputWeights:ConstTensor;
707
708 forgetGateBias:ConstTensor;
709 cellBias:ConstTensor;
710 outputGateBias:ConstTensor;
711
712 // CIFG
713 inputToInputWeights:ConstTensor;
714 recurrentToInputWeights:ConstTensor;
715 inputGateBias:ConstTensor;
716
717 // Projection
718 projectionWeights:ConstTensor;
719 projectionBias:ConstTensor;
720
721 // Peephole
722 cellToInputWeights:ConstTensor;
723 cellToForgetWeights:ConstTensor;
724 cellToOutputWeights:ConstTensor;
725
726 // Layer norm
727 inputLayerNormWeights:ConstTensor;
728 forgetLayerNormWeights:ConstTensor;
729 cellLayerNormWeights:ConstTensor;
730 outputLayerNormWeights:ConstTensor;
731}
732
733table QLstmDescriptor {
734 cifgEnabled:bool = true;
735 peepholeEnabled:bool = false;
736 projectionEnabled:bool = false;
737 layerNormEnabled:bool = false;
738
739 cellClip:float;
740 projectionClip:float;
741
742 inputIntermediateScale:float;
743 forgetIntermediateScale:float;
744 cellIntermediateScale:float;
745 outputIntermediateScale:float;
746
747 hiddenStateZeroPoint:int;
748 hiddenStateScale:float;
749}
750
751table QLstmLayer {
752 base:LayerBase;
753 descriptor:QLstmDescriptor;
754 inputParams:QLstmInputParams;
755}
756
Jan Eilers5b01a892019-07-23 09:47:43 +0100757table QuantizedLstmInputParams {
758 inputToInputWeights:ConstTensor;
759 inputToForgetWeights:ConstTensor;
760 inputToCellWeights:ConstTensor;
761 inputToOutputWeights:ConstTensor;
762
763 recurrentToInputWeights:ConstTensor;
764 recurrentToForgetWeights:ConstTensor;
765 recurrentToCellWeights:ConstTensor;
766 recurrentToOutputWeights:ConstTensor;
767
768 inputGateBias:ConstTensor;
769 forgetGateBias:ConstTensor;
770 cellBias:ConstTensor;
771 outputGateBias:ConstTensor;
772}
773
Jan Eilers5b01a892019-07-23 09:47:43 +0100774table QuantizedLstmLayer {
775 base:LayerBase;
776 inputParams:QuantizedLstmInputParams;
777}
778
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000779table DequantizeLayer {
780 base:LayerBase;
781}
782
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100783table MergeLayer {
784 base:LayerBase;
785}
786
Sadik Armaganeff363d2019-04-05 15:25:46 +0100787table SwitchLayer {
788 base:LayerBase;
789}
790
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100791table PreluLayer {
792 base:LayerBase;
793}
794
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100795table TransposeConvolution2dLayer {
796 base:LayerBase;
797 descriptor:TransposeConvolution2dDescriptor;
798 weights:ConstTensor;
799 biases:ConstTensor;
800}
801
802table TransposeConvolution2dDescriptor {
803 padLeft:uint;
804 padRight:uint;
805 padTop:uint;
806 padBottom:uint;
807 strideX:uint;
808 strideY:uint;
809 biasEnabled:bool = false;
810 dataLayout:DataLayout = NCHW;
811}
812
Mike Kellyc9ea45a2020-02-28 18:11:58 +0000813table TransposeLayer {
814 base:LayerBase;
815 descriptor:TransposeDescriptor;
816}
817
818table TransposeDescriptor {
819 dimMappings:[uint];
820}
821
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100822table ResizeLayer {
823 base:LayerBase;
824 descriptor:ResizeDescriptor;
825}
826
827table ResizeDescriptor {
828 targetHeight:uint;
829 targetWidth:uint;
830 method:ResizeMethod = NearestNeighbor;
831 dataLayout:DataLayout;
David Monahan4a0c9b92020-05-30 09:48:39 +0100832 alignCorners:bool;
833 halfPixelCenters:bool;
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100834}
835
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100836table StackLayer {
837 base:LayerBase;
838 descriptor:StackDescriptor;
839}
840
841table StackDescriptor {
842 axis:uint;
843 numInputs:uint;
844 inputShape:[uint];
845}
846
Aron Virginas-Tar85121a22019-10-23 10:41:35 +0100847table StandInDescriptor {
848 numInputs:uint;
849 numOutputs:uint;
850}
851
852table StandInLayer {
853 base:LayerBase;
854 descriptor:StandInDescriptor;
855}
856
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000857union Layer {
Mike Kellyaf484012019-02-20 16:53:11 +0000858 ActivationLayer,
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000859 AdditionLayer,
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000860 BatchToSpaceNdLayer,
ruoyan018e7fa232019-02-28 15:09:07 +0000861 BatchNormalizationLayer,
Conor Kennedy76277882019-02-26 08:29:54 +0000862 ConstantLayer,
Mike Kellya0766c32019-02-19 17:22:07 +0000863 Convolution2dLayer,
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000864 DepthwiseConvolution2dLayer,
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000865 FullyConnectedLayer,
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000866 InputLayer,
Sadik Armagan5f450272019-02-12 14:31:45 +0000867 MultiplicationLayer,
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000868 OutputLayer,
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000869 PermuteLayer,
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000870 Pooling2dLayer,
Saoirse Stewart263829c2019-02-19 15:54:14 +0000871 ReshapeLayer,
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000872 SoftmaxLayer,
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000873 SpaceToBatchNdLayer,
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000874 DivisionLayer,
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000875 MinimumLayer,
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000876 EqualLayer,
Nina Drozd57728782019-02-27 10:53:27 +0000877 MaximumLayer,
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000878 NormalizationLayer,
Sadik Armagan8b42a382019-03-01 14:24:49 +0000879 PadLayer,
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000880 RsqrtLayer,
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000881 FloorLayer,
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000882 GreaterLayer,
Conor Kennedyda1f9752019-03-01 14:37:12 +0000883 ResizeBilinearLayer,
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000884 SubtractionLayer,
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000885 StridedSliceLayer,
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000886 GatherLayer,
Jim Flynnac25a1b2019-02-28 10:40:49 +0000887 MeanLayer,
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000888 MergerLayer,
Jim Flynn18ce3382019-03-08 11:08:30 +0000889 L2NormalizationLayer,
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000890 SplitterLayer,
Jim Flynn11af3752019-03-19 17:22:29 +0000891 DetectionPostProcessLayer,
Derek Lamberti87acb272019-03-27 16:51:31 +0000892 LstmLayer,
Jan Eilers5b01a892019-07-23 09:47:43 +0100893 QuantizedLstmLayer,
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000894 QuantizeLayer,
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100895 DequantizeLayer,
Sadik Armaganeff363d2019-04-05 15:25:46 +0100896 MergeLayer,
Jim Flynne242f2d2019-05-22 14:24:13 +0100897 SwitchLayer,
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100898 ConcatLayer,
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100899 SpaceToDepthLayer,
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100900 PreluLayer,
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100901 TransposeConvolution2dLayer,
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100902 ResizeLayer,
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100903 StackLayer,
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100904 AbsLayer,
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100905 ArgMinMaxLayer,
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100906 SliceLayer,
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100907 DepthToSpaceLayer,
Sadik Armagan26257852019-10-14 13:00:47 +0100908 InstanceNormalizationLayer,
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100909 LogSoftmaxLayer,
Aron Virginas-Tar85121a22019-10-23 10:41:35 +0100910 ComparisonLayer,
josh minor4a3c6102020-01-06 16:40:46 -0600911 StandInLayer,
Mike Kellyc9ea45a2020-02-28 18:11:58 +0000912 ElementwiseUnaryLayer,
James Conroy8d333182020-05-13 10:27:58 +0100913 TransposeLayer,
Keith Davis300ad562020-06-04 16:34:23 +0100914 QLstmLayer,
915 FillLayer
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000916}
917
Saoirse Stewart49dbe0e2019-02-05 17:27:06 +0000918table AnyLayer {
919 layer:Layer;
920}
921
Tee Jungaa920c52019-11-05 10:48:25 +0000922table FeatureCompatibilityVersions {
923 bindingIdsScheme:uint = 0;
924}
925
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000926// Root type for serialized data is the graph of the network
927table SerializedGraph {
Saoirse Stewart49dbe0e2019-02-05 17:27:06 +0000928 layers:[AnyLayer];
Tee Jungaa920c52019-11-05 10:48:25 +0000929 inputIds:[int];
930 outputIds:[int];
931 featureVersions:FeatureCompatibilityVersions;
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000932}
933
Keith Davis300ad562020-06-04 16:34:23 +0100934root_type SerializedGraph;