blob: 6a388db69996410a0ff993dc72076986e59fe12e [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,
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;
Teresa Charlin52664732020-06-29 16:27:03 +0100315 descriptor:GatherDescriptor;
316}
317
318table GatherDescriptor {
319 axis:int = 0;
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000320}
321
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100322/// @deprecated Use ComparisonLayer instead
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000323table GreaterLayer {
324 base:LayerBase;
325}
326
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000327table InputLayer {
328 base:BindableLayerBase;
329}
330
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100331table InstanceNormalizationLayer {
332 base:LayerBase;
333 descriptor:InstanceNormalizationDescriptor;
334}
335
336table InstanceNormalizationDescriptor {
337 gamma:float;
338 beta:float;
339 eps:float;
340 dataLayout:DataLayout;
341}
342
Sadik Armagan26257852019-10-14 13:00:47 +0100343table LogSoftmaxLayer {
344 base:LayerBase;
345 descriptor:LogSoftmaxDescriptor;
346}
347
348table LogSoftmaxDescriptor {
349 beta:float = 1;
350 axis:int = -1;
351}
352
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000353table L2NormalizationLayer {
354 base:LayerBase;
355 descriptor:L2NormalizationDescriptor;
356}
357
358table L2NormalizationDescriptor {
359 dataLayout:DataLayout = NCHW;
Ferran Balaguer0dcffec2019-06-18 16:25:06 +0100360 eps:float = 1e-12;
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000361}
362
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000363table MinimumLayer {
364 base:LayerBase;
365}
366
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000367table MaximumLayer {
368 base:LayerBase;
369}
370
Sadik Armagan5f450272019-02-12 14:31:45 +0000371table MultiplicationLayer {
372 base:LayerBase;
373}
374
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000375table Pooling2dLayer {
376 base:LayerBase;
377 descriptor:Pooling2dDescriptor;
378}
379
380enum PoolingAlgorithm : byte {
381 Max = 0,
382 Average = 1,
383 L2 = 2
384}
385
386enum OutputShapeRounding : byte {
387 Floor = 0,
388 Ceiling = 1
389}
390
391enum PaddingMethod : byte {
392 IgnoreValue = 0,
393 Exclude = 1
394}
395
396table Pooling2dDescriptor {
397 poolType:PoolingAlgorithm;
398 padLeft:uint;
399 padRight:uint;
400 padTop:uint;
401 padBottom:uint;
402 poolWidth:uint;
403 poolHeight:uint;
404 strideX:uint;
405 strideY:uint;
406 outputShapeRounding:OutputShapeRounding;
407 paddingMethod:PaddingMethod;
408 dataLayout:DataLayout;
409}
410
Derek Lamberti87acb272019-03-27 16:51:31 +0000411table QuantizeLayer {
412 base:LayerBase;
413}
414
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000415table SoftmaxLayer {
416 base:LayerBase;
417 descriptor:SoftmaxDescriptor;
418}
419
420table SoftmaxDescriptor {
421 beta:float;
422}
423
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000424table DepthwiseConvolution2dLayer {
425 base:LayerBase;
426 descriptor:DepthwiseConvolution2dDescriptor;
427 weights:ConstTensor;
428 biases:ConstTensor;
429}
430
431table DepthwiseConvolution2dDescriptor {
432 padLeft:uint;
433 padRight:uint;
434 padTop:uint;
435 padBottom:uint;
436 strideX:uint;
437 strideY:uint;
Matthew Benthamacad04e2019-05-13 10:02:45 +0100438 dilationX:uint = 1;
439 dilationY:uint = 1;
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000440 biasEnabled:bool = false;
441 dataLayout:DataLayout = NCHW;
442}
443
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000444table OutputLayer {
445 base:BindableLayerBase;
446}
447
Saoirse Stewart263829c2019-02-19 15:54:14 +0000448table ReshapeLayer {
449 base:LayerBase;
450 descriptor:ReshapeDescriptor;
451}
452
453table ReshapeDescriptor {
454 targetShape:[uint];
455}
456
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000457table PermuteLayer {
458 base:LayerBase;
459 descriptor:PermuteDescriptor;
460}
461
462table PermuteDescriptor {
463 dimMappings:[uint];
464}
465
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000466table SpaceToBatchNdLayer {
467 base:LayerBase;
468 descriptor:SpaceToBatchNdDescriptor;
469}
470
471table SpaceToBatchNdDescriptor {
472 blockShape:[uint];
473 padList:[uint];
474 dataLayout:DataLayout;
475}
476
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100477table SpaceToDepthLayer {
478 base:LayerBase;
479 descriptor:SpaceToDepthDescriptor;
480}
481
482table SpaceToDepthDescriptor {
483 blockSize:uint;
484 dataLayout:DataLayout;
485}
486
Conor Kennedyda1f9752019-03-01 14:37:12 +0000487table SubtractionLayer {
488 base:LayerBase;
489}
490
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000491table BatchToSpaceNdLayer {
492 base:LayerBase;
493 descriptor:BatchToSpaceNdDescriptor;
494}
495
496table BatchToSpaceNdDescriptor {
497 blockShape:[uint];
498 crops:[uint];
499 dataLayout:DataLayout;
500}
501
Nina Drozd57728782019-02-27 10:53:27 +0000502enum NormalizationAlgorithmChannel : byte {
503 Across = 0,
504 Within = 1
505}
506
507enum NormalizationAlgorithmMethod : byte {
508 LocalBrightness = 0,
509 LocalContrast = 1
510}
511
512table NormalizationLayer {
513 base:LayerBase;
514 descriptor:NormalizationDescriptor;
515}
516
517table NormalizationDescriptor {
518 normChannelType:NormalizationAlgorithmChannel = Across;
519 normMethodType:NormalizationAlgorithmMethod = LocalBrightness;
520 normSize:uint;
521 alpha:float;
522 beta:float;
523 k:float;
524 dataLayout:DataLayout = NCHW;
525}
526
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000527table MeanLayer {
528 base:LayerBase;
529 descriptor:MeanDescriptor;
530}
531
532table MeanDescriptor {
533 axis:[uint];
534 keepDims:bool = false;
535}
536
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000537table PadLayer {
538 base:LayerBase;
539 descriptor:PadDescriptor;
540}
541
542table PadDescriptor {
543 padList:[uint];
David Monahan34757812019-06-19 11:47:21 +0100544 padValue:float = 0;
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000545}
546
josh minor4a3c6102020-01-06 16:40:46 -0600547/// @deprecated Use ElementwiseUnaryLayer instead
Sadik Armagan8b42a382019-03-01 14:24:49 +0000548table RsqrtLayer {
549 base:LayerBase;
550}
551
ruoyan018e7fa232019-02-28 15:09:07 +0000552table BatchNormalizationLayer {
553 base:LayerBase;
554 descriptor:BatchNormalizationDescriptor;
555 mean:ConstTensor;
556 variance:ConstTensor;
557 beta:ConstTensor;
558 gamma:ConstTensor;
559}
560
561table BatchNormalizationDescriptor {
562 eps:float;
563 dataLayout:DataLayout;
564}
565
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100566/// @deprecated Use ResizeLayer instead
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000567table ResizeBilinearLayer {
568 base:LayerBase;
569 descriptor:ResizeBilinearDescriptor;
570}
571
572table ResizeBilinearDescriptor {
573 targetWidth:uint;
574 targetHeight:uint;
575 dataLayout:DataLayout;
David Monahan4a0c9b92020-05-30 09:48:39 +0100576 alignCorners:bool;
577 halfPixelCenters:bool;
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000578}
579
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100580table SliceLayer {
581 base:LayerBase;
582 descriptor:SliceDescriptor;
583}
584
585table SliceDescriptor {
586 begin:[uint];
587 size:[uint];
588}
589
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000590table StridedSliceLayer {
591 base:LayerBase;
592 descriptor:StridedSliceDescriptor;
593}
594
595table StridedSliceDescriptor {
596 begin:[int];
597 end:[int];
598 stride:[int];
599 beginMask:int;
600 endMask:int;
601 shrinkAxisMask:int;
602 ellipsisMask:int;
603 newAxisMask:int;
604 dataLayout:DataLayout;
605}
606
Jim Flynne242f2d2019-05-22 14:24:13 +0100607table ConcatLayer {
608 base:LayerBase;
609 descriptor:OriginsDescriptor;
610}
611
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100612/// @deprecated Use ConcatLayer instead
Jim Flynnac25a1b2019-02-28 10:40:49 +0000613table MergerLayer {
614 base:LayerBase;
615 descriptor:OriginsDescriptor;
616}
617
618table UintVector {
619 data:[uint];
620}
621
622table OriginsDescriptor {
623 concatAxis:uint;
624 numViews:uint;
625 numDimensions:uint;
626 viewOrigins:[UintVector];
627}
628
Jim Flynn18ce3382019-03-08 11:08:30 +0000629table ViewsDescriptor {
630 origins:OriginsDescriptor;
631 viewSizes:[UintVector];
632}
633
634table SplitterLayer {
635 base:LayerBase;
636 descriptor:ViewsDescriptor;
637}
638
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000639table DetectionPostProcessLayer {
640 base:LayerBase;
641 descriptor:DetectionPostProcessDescriptor;
642 anchors:ConstTensor;
643}
644
645table DetectionPostProcessDescriptor {
646 maxDetections:uint;
647 maxClassesPerDetection:uint;
648 detectionsPerClass:uint;
649 nmsScoreThreshold:float;
650 nmsIouThreshold:float;
651 numClasses:uint;
652 useRegularNms:bool;
653 scaleX:float;
654 scaleY:float;
655 scaleW:float;
656 scaleH:float;
657}
658
Jim Flynn11af3752019-03-19 17:22:29 +0000659table LstmInputParams {
660 inputToForgetWeights:ConstTensor;
661 inputToCellWeights:ConstTensor;
662 inputToOutputWeights:ConstTensor;
663 recurrentToForgetWeights:ConstTensor;
664 recurrentToCellWeights:ConstTensor;
665 recurrentToOutputWeights:ConstTensor;
666 forgetGateBias:ConstTensor;
667 cellBias:ConstTensor;
668 outputGateBias:ConstTensor;
669
670 inputToInputWeights:ConstTensor;
671 recurrentToInputWeights:ConstTensor;
672 cellToInputWeights:ConstTensor;
673 inputGateBias:ConstTensor;
674
675 projectionWeights:ConstTensor;
676 projectionBias:ConstTensor;
677
678 cellToForgetWeights:ConstTensor;
679 cellToOutputWeights:ConstTensor;
Jan Eilersf8c62972019-07-17 11:07:49 +0100680
681 inputLayerNormWeights:ConstTensor;
682 forgetLayerNormWeights:ConstTensor;
683 cellLayerNormWeights:ConstTensor;
684 outputLayerNormWeights:ConstTensor;
Jim Flynn11af3752019-03-19 17:22:29 +0000685}
686
James Conroy8d333182020-05-13 10:27:58 +0100687table LstmDescriptor {
688 activationFunc:uint;
689 clippingThresCell:float;
690 clippingThresProj:float;
691 cifgEnabled:bool = true;
692 peepholeEnabled:bool = false;
693 projectionEnabled:bool = false;
694 layerNormEnabled:bool = false;
695}
696
697table LstmLayer {
698 base:LayerBase;
699 descriptor:LstmDescriptor;
700 inputParams:LstmInputParams;
701}
702
703table QLstmInputParams {
704 // Mandatory
705 inputToForgetWeights:ConstTensor;
706 inputToCellWeights:ConstTensor;
707 inputToOutputWeights:ConstTensor;
708
709 recurrentToForgetWeights:ConstTensor;
710 recurrentToCellWeights:ConstTensor;
711 recurrentToOutputWeights:ConstTensor;
712
713 forgetGateBias:ConstTensor;
714 cellBias:ConstTensor;
715 outputGateBias:ConstTensor;
716
717 // CIFG
718 inputToInputWeights:ConstTensor;
719 recurrentToInputWeights:ConstTensor;
720 inputGateBias:ConstTensor;
721
722 // Projection
723 projectionWeights:ConstTensor;
724 projectionBias:ConstTensor;
725
726 // Peephole
727 cellToInputWeights:ConstTensor;
728 cellToForgetWeights:ConstTensor;
729 cellToOutputWeights:ConstTensor;
730
731 // Layer norm
732 inputLayerNormWeights:ConstTensor;
733 forgetLayerNormWeights:ConstTensor;
734 cellLayerNormWeights:ConstTensor;
735 outputLayerNormWeights:ConstTensor;
736}
737
738table QLstmDescriptor {
739 cifgEnabled:bool = true;
740 peepholeEnabled:bool = false;
741 projectionEnabled:bool = false;
742 layerNormEnabled:bool = false;
743
744 cellClip:float;
745 projectionClip:float;
746
747 inputIntermediateScale:float;
748 forgetIntermediateScale:float;
749 cellIntermediateScale:float;
750 outputIntermediateScale:float;
751
752 hiddenStateZeroPoint:int;
753 hiddenStateScale:float;
754}
755
756table QLstmLayer {
757 base:LayerBase;
758 descriptor:QLstmDescriptor;
759 inputParams:QLstmInputParams;
760}
761
Jan Eilers5b01a892019-07-23 09:47:43 +0100762table QuantizedLstmInputParams {
763 inputToInputWeights:ConstTensor;
764 inputToForgetWeights:ConstTensor;
765 inputToCellWeights:ConstTensor;
766 inputToOutputWeights:ConstTensor;
767
768 recurrentToInputWeights:ConstTensor;
769 recurrentToForgetWeights:ConstTensor;
770 recurrentToCellWeights:ConstTensor;
771 recurrentToOutputWeights:ConstTensor;
772
773 inputGateBias:ConstTensor;
774 forgetGateBias:ConstTensor;
775 cellBias:ConstTensor;
776 outputGateBias:ConstTensor;
777}
778
Jan Eilers5b01a892019-07-23 09:47:43 +0100779table QuantizedLstmLayer {
780 base:LayerBase;
781 inputParams:QuantizedLstmInputParams;
782}
783
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000784table DequantizeLayer {
785 base:LayerBase;
786}
787
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100788table MergeLayer {
789 base:LayerBase;
790}
791
Sadik Armaganeff363d2019-04-05 15:25:46 +0100792table SwitchLayer {
793 base:LayerBase;
794}
795
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100796table PreluLayer {
797 base:LayerBase;
798}
799
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100800table TransposeConvolution2dLayer {
801 base:LayerBase;
802 descriptor:TransposeConvolution2dDescriptor;
803 weights:ConstTensor;
804 biases:ConstTensor;
805}
806
807table TransposeConvolution2dDescriptor {
808 padLeft:uint;
809 padRight:uint;
810 padTop:uint;
811 padBottom:uint;
812 strideX:uint;
813 strideY:uint;
814 biasEnabled:bool = false;
815 dataLayout:DataLayout = NCHW;
816}
817
Mike Kellyc9ea45a2020-02-28 18:11:58 +0000818table TransposeLayer {
819 base:LayerBase;
820 descriptor:TransposeDescriptor;
821}
822
823table TransposeDescriptor {
824 dimMappings:[uint];
825}
826
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100827table ResizeLayer {
828 base:LayerBase;
829 descriptor:ResizeDescriptor;
830}
831
832table ResizeDescriptor {
833 targetHeight:uint;
834 targetWidth:uint;
835 method:ResizeMethod = NearestNeighbor;
836 dataLayout:DataLayout;
David Monahan4a0c9b92020-05-30 09:48:39 +0100837 alignCorners:bool;
838 halfPixelCenters:bool;
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100839}
840
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100841table StackLayer {
842 base:LayerBase;
843 descriptor:StackDescriptor;
844}
845
846table StackDescriptor {
847 axis:uint;
848 numInputs:uint;
849 inputShape:[uint];
850}
851
Aron Virginas-Tar85121a22019-10-23 10:41:35 +0100852table StandInDescriptor {
853 numInputs:uint;
854 numOutputs:uint;
855}
856
857table StandInLayer {
858 base:LayerBase;
859 descriptor:StandInDescriptor;
860}
861
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000862union Layer {
Mike Kellyaf484012019-02-20 16:53:11 +0000863 ActivationLayer,
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000864 AdditionLayer,
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000865 BatchToSpaceNdLayer,
ruoyan018e7fa232019-02-28 15:09:07 +0000866 BatchNormalizationLayer,
Conor Kennedy76277882019-02-26 08:29:54 +0000867 ConstantLayer,
Mike Kellya0766c32019-02-19 17:22:07 +0000868 Convolution2dLayer,
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000869 DepthwiseConvolution2dLayer,
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000870 FullyConnectedLayer,
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000871 InputLayer,
Sadik Armagan5f450272019-02-12 14:31:45 +0000872 MultiplicationLayer,
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000873 OutputLayer,
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000874 PermuteLayer,
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000875 Pooling2dLayer,
Saoirse Stewart263829c2019-02-19 15:54:14 +0000876 ReshapeLayer,
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000877 SoftmaxLayer,
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000878 SpaceToBatchNdLayer,
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000879 DivisionLayer,
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000880 MinimumLayer,
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000881 EqualLayer,
Nina Drozd57728782019-02-27 10:53:27 +0000882 MaximumLayer,
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000883 NormalizationLayer,
Sadik Armagan8b42a382019-03-01 14:24:49 +0000884 PadLayer,
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000885 RsqrtLayer,
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000886 FloorLayer,
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000887 GreaterLayer,
Conor Kennedyda1f9752019-03-01 14:37:12 +0000888 ResizeBilinearLayer,
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000889 SubtractionLayer,
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000890 StridedSliceLayer,
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000891 GatherLayer,
Jim Flynnac25a1b2019-02-28 10:40:49 +0000892 MeanLayer,
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000893 MergerLayer,
Jim Flynn18ce3382019-03-08 11:08:30 +0000894 L2NormalizationLayer,
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000895 SplitterLayer,
Jim Flynn11af3752019-03-19 17:22:29 +0000896 DetectionPostProcessLayer,
Derek Lamberti87acb272019-03-27 16:51:31 +0000897 LstmLayer,
Jan Eilers5b01a892019-07-23 09:47:43 +0100898 QuantizedLstmLayer,
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000899 QuantizeLayer,
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100900 DequantizeLayer,
Sadik Armaganeff363d2019-04-05 15:25:46 +0100901 MergeLayer,
Jim Flynne242f2d2019-05-22 14:24:13 +0100902 SwitchLayer,
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100903 ConcatLayer,
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100904 SpaceToDepthLayer,
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100905 PreluLayer,
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100906 TransposeConvolution2dLayer,
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100907 ResizeLayer,
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100908 StackLayer,
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100909 AbsLayer,
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100910 ArgMinMaxLayer,
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100911 SliceLayer,
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100912 DepthToSpaceLayer,
Sadik Armagan26257852019-10-14 13:00:47 +0100913 InstanceNormalizationLayer,
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100914 LogSoftmaxLayer,
Aron Virginas-Tar85121a22019-10-23 10:41:35 +0100915 ComparisonLayer,
josh minor4a3c6102020-01-06 16:40:46 -0600916 StandInLayer,
Mike Kellyc9ea45a2020-02-28 18:11:58 +0000917 ElementwiseUnaryLayer,
James Conroy8d333182020-05-13 10:27:58 +0100918 TransposeLayer,
Keith Davis300ad562020-06-04 16:34:23 +0100919 QLstmLayer,
920 FillLayer
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000921}
922
Saoirse Stewart49dbe0e2019-02-05 17:27:06 +0000923table AnyLayer {
924 layer:Layer;
925}
926
Tee Jungaa920c52019-11-05 10:48:25 +0000927table FeatureCompatibilityVersions {
928 bindingIdsScheme:uint = 0;
929}
930
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000931// Root type for serialized data is the graph of the network
932table SerializedGraph {
Saoirse Stewart49dbe0e2019-02-05 17:27:06 +0000933 layers:[AnyLayer];
Tee Jungaa920c52019-11-05 10:48:25 +0000934 inputIds:[int];
935 outputIds:[int];
936 featureVersions:FeatureCompatibilityVersions;
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000937}
938
Keith Davis300ad562020-06-04 16:34:23 +0100939root_type SerializedGraph;