blob: ff79f6cffe358bed01ddc02e7fa4c4f13db6dc81 [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,
158 Transpose = 55
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000159}
160
161// Base layer table to be used as part of other layers
162table LayerBase {
163 index:uint;
164 layerName:string;
165 layerType:LayerType;
166 inputSlots:[InputSlot];
167 outputSlots:[OutputSlot];
168}
169
170table BindableLayerBase {
171 base:LayerBase;
172 layerBindingId:int;
173}
174
175// Table for each layer defined below
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100176
josh minor4a3c6102020-01-06 16:40:46 -0600177/// @deprecated Use ElementwiseUnaryLayer instead
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100178table AbsLayer {
179 base:LayerBase;
180}
181
Mike Kellyaf484012019-02-20 16:53:11 +0000182table ActivationLayer {
183 base:LayerBase;
184 descriptor:ActivationDescriptor;
185}
186
187table ActivationDescriptor {
Tee Jung86bc3d82019-10-01 11:25:56 +0900188 activationFunction:ActivationFunction = Sigmoid;
Mike Kellyaf484012019-02-20 16:53:11 +0000189 a:float;
190 b:float;
191}
192
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000193table AdditionLayer {
194 base:LayerBase;
195}
196
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100197table ArgMinMaxLayer {
198 base:LayerBase;
199 descriptor:ArgMinMaxDescriptor;
200}
201
202table ArgMinMaxDescriptor{
Tee Jung86bc3d82019-10-01 11:25:56 +0900203 argMinMaxFunction:ArgMinMaxFunction;
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100204 axis:int;
205}
206
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100207enum ComparisonOperation : byte {
208 Equal = 0,
209 Greater = 1,
210 GreaterOrEqual = 2,
211 Less = 3,
212 LessOrEqual = 4,
213 NotEqual = 5
214}
215
216table ComparisonDescriptor {
217 operation:ComparisonOperation;
218}
219
220table ComparisonLayer {
221 base:LayerBase;
222 descriptor:ComparisonDescriptor;
223}
224
Conor Kennedy76277882019-02-26 08:29:54 +0000225table ConstantLayer {
226 base:LayerBase;
227 input:ConstTensor;
228}
229
Mike Kellya0766c32019-02-19 17:22:07 +0000230table Convolution2dLayer {
231 base:LayerBase;
232 descriptor:Convolution2dDescriptor;
233 weights:ConstTensor;
234 biases:ConstTensor;
235}
236
237table Convolution2dDescriptor {
238 padLeft:uint;
239 padRight:uint;
240 padTop:uint;
241 padBottom:uint;
242 strideX:uint;
243 strideY:uint;
Matthew Benthamacad04e2019-05-13 10:02:45 +0100244 dilationX:uint = 1;
245 dilationY:uint = 1;
Mike Kellya0766c32019-02-19 17:22:07 +0000246 biasEnabled:bool = false;
247 dataLayout:DataLayout = NCHW;
248}
249
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100250table DepthToSpaceLayer {
251 base:LayerBase;
252 descriptor:DepthToSpaceDescriptor;
253}
254
255table DepthToSpaceDescriptor {
256 blockSize:uint;
257 dataLayout:DataLayout;
258}
259
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000260table DivisionLayer {
261 base:LayerBase;
262}
263
josh minor4a3c6102020-01-06 16:40:46 -0600264enum UnaryOperation : byte {
265 Abs = 0,
266 Rsqrt = 1,
267 Sqrt = 2,
268 Exp = 3,
269 Neg = 4
270}
271
272table ElementwiseUnaryDescriptor {
273 operation:UnaryOperation;
274}
275
276table ElementwiseUnaryLayer {
277 base:LayerBase;
278 descriptor:ElementwiseUnaryDescriptor;
279}
280
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100281/// @deprecated Use ComparisonLayer instead
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000282table EqualLayer {
283 base:LayerBase;
284}
285
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000286table FloorLayer{
287 base:LayerBase;
288}
289
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000290table FullyConnectedLayer {
291 base:LayerBase;
292 descriptor:FullyConnectedDescriptor;
293 weights:ConstTensor;
294 biases:ConstTensor;
295}
296
297table FullyConnectedDescriptor {
298 biasEnabled:bool = false;
299 transposeWeightsMatrix:bool = false;
300}
301
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000302table GatherLayer {
303 base:LayerBase;
304}
305
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100306/// @deprecated Use ComparisonLayer instead
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000307table GreaterLayer {
308 base:LayerBase;
309}
310
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000311table InputLayer {
312 base:BindableLayerBase;
313}
314
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100315table InstanceNormalizationLayer {
316 base:LayerBase;
317 descriptor:InstanceNormalizationDescriptor;
318}
319
320table InstanceNormalizationDescriptor {
321 gamma:float;
322 beta:float;
323 eps:float;
324 dataLayout:DataLayout;
325}
326
Sadik Armagan26257852019-10-14 13:00:47 +0100327table LogSoftmaxLayer {
328 base:LayerBase;
329 descriptor:LogSoftmaxDescriptor;
330}
331
332table LogSoftmaxDescriptor {
333 beta:float = 1;
334 axis:int = -1;
335}
336
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000337table L2NormalizationLayer {
338 base:LayerBase;
339 descriptor:L2NormalizationDescriptor;
340}
341
342table L2NormalizationDescriptor {
343 dataLayout:DataLayout = NCHW;
Ferran Balaguer0dcffec2019-06-18 16:25:06 +0100344 eps:float = 1e-12;
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000345}
346
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000347table MinimumLayer {
348 base:LayerBase;
349}
350
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000351table MaximumLayer {
352 base:LayerBase;
353}
354
Sadik Armagan5f450272019-02-12 14:31:45 +0000355table MultiplicationLayer {
356 base:LayerBase;
357}
358
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000359table Pooling2dLayer {
360 base:LayerBase;
361 descriptor:Pooling2dDescriptor;
362}
363
364enum PoolingAlgorithm : byte {
365 Max = 0,
366 Average = 1,
367 L2 = 2
368}
369
370enum OutputShapeRounding : byte {
371 Floor = 0,
372 Ceiling = 1
373}
374
375enum PaddingMethod : byte {
376 IgnoreValue = 0,
377 Exclude = 1
378}
379
380table Pooling2dDescriptor {
381 poolType:PoolingAlgorithm;
382 padLeft:uint;
383 padRight:uint;
384 padTop:uint;
385 padBottom:uint;
386 poolWidth:uint;
387 poolHeight:uint;
388 strideX:uint;
389 strideY:uint;
390 outputShapeRounding:OutputShapeRounding;
391 paddingMethod:PaddingMethod;
392 dataLayout:DataLayout;
393}
394
Derek Lamberti87acb272019-03-27 16:51:31 +0000395table QuantizeLayer {
396 base:LayerBase;
397}
398
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000399table SoftmaxLayer {
400 base:LayerBase;
401 descriptor:SoftmaxDescriptor;
402}
403
404table SoftmaxDescriptor {
405 beta:float;
406}
407
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000408table DepthwiseConvolution2dLayer {
409 base:LayerBase;
410 descriptor:DepthwiseConvolution2dDescriptor;
411 weights:ConstTensor;
412 biases:ConstTensor;
413}
414
415table DepthwiseConvolution2dDescriptor {
416 padLeft:uint;
417 padRight:uint;
418 padTop:uint;
419 padBottom:uint;
420 strideX:uint;
421 strideY:uint;
Matthew Benthamacad04e2019-05-13 10:02:45 +0100422 dilationX:uint = 1;
423 dilationY:uint = 1;
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000424 biasEnabled:bool = false;
425 dataLayout:DataLayout = NCHW;
426}
427
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000428table OutputLayer {
429 base:BindableLayerBase;
430}
431
Saoirse Stewart263829c2019-02-19 15:54:14 +0000432table ReshapeLayer {
433 base:LayerBase;
434 descriptor:ReshapeDescriptor;
435}
436
437table ReshapeDescriptor {
438 targetShape:[uint];
439}
440
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000441table PermuteLayer {
442 base:LayerBase;
443 descriptor:PermuteDescriptor;
444}
445
446table PermuteDescriptor {
447 dimMappings:[uint];
448}
449
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000450table SpaceToBatchNdLayer {
451 base:LayerBase;
452 descriptor:SpaceToBatchNdDescriptor;
453}
454
455table SpaceToBatchNdDescriptor {
456 blockShape:[uint];
457 padList:[uint];
458 dataLayout:DataLayout;
459}
460
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100461table SpaceToDepthLayer {
462 base:LayerBase;
463 descriptor:SpaceToDepthDescriptor;
464}
465
466table SpaceToDepthDescriptor {
467 blockSize:uint;
468 dataLayout:DataLayout;
469}
470
Conor Kennedyda1f9752019-03-01 14:37:12 +0000471table SubtractionLayer {
472 base:LayerBase;
473}
474
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000475table BatchToSpaceNdLayer {
476 base:LayerBase;
477 descriptor:BatchToSpaceNdDescriptor;
478}
479
480table BatchToSpaceNdDescriptor {
481 blockShape:[uint];
482 crops:[uint];
483 dataLayout:DataLayout;
484}
485
Nina Drozd57728782019-02-27 10:53:27 +0000486enum NormalizationAlgorithmChannel : byte {
487 Across = 0,
488 Within = 1
489}
490
491enum NormalizationAlgorithmMethod : byte {
492 LocalBrightness = 0,
493 LocalContrast = 1
494}
495
496table NormalizationLayer {
497 base:LayerBase;
498 descriptor:NormalizationDescriptor;
499}
500
501table NormalizationDescriptor {
502 normChannelType:NormalizationAlgorithmChannel = Across;
503 normMethodType:NormalizationAlgorithmMethod = LocalBrightness;
504 normSize:uint;
505 alpha:float;
506 beta:float;
507 k:float;
508 dataLayout:DataLayout = NCHW;
509}
510
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000511table MeanLayer {
512 base:LayerBase;
513 descriptor:MeanDescriptor;
514}
515
516table MeanDescriptor {
517 axis:[uint];
518 keepDims:bool = false;
519}
520
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000521table PadLayer {
522 base:LayerBase;
523 descriptor:PadDescriptor;
524}
525
526table PadDescriptor {
527 padList:[uint];
David Monahan34757812019-06-19 11:47:21 +0100528 padValue:float = 0;
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000529}
530
josh minor4a3c6102020-01-06 16:40:46 -0600531/// @deprecated Use ElementwiseUnaryLayer instead
Sadik Armagan8b42a382019-03-01 14:24:49 +0000532table RsqrtLayer {
533 base:LayerBase;
534}
535
ruoyan018e7fa232019-02-28 15:09:07 +0000536table BatchNormalizationLayer {
537 base:LayerBase;
538 descriptor:BatchNormalizationDescriptor;
539 mean:ConstTensor;
540 variance:ConstTensor;
541 beta:ConstTensor;
542 gamma:ConstTensor;
543}
544
545table BatchNormalizationDescriptor {
546 eps:float;
547 dataLayout:DataLayout;
548}
549
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100550/// @deprecated Use ResizeLayer instead
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000551table ResizeBilinearLayer {
552 base:LayerBase;
553 descriptor:ResizeBilinearDescriptor;
554}
555
556table ResizeBilinearDescriptor {
557 targetWidth:uint;
558 targetHeight:uint;
559 dataLayout:DataLayout;
560}
561
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100562table SliceLayer {
563 base:LayerBase;
564 descriptor:SliceDescriptor;
565}
566
567table SliceDescriptor {
568 begin:[uint];
569 size:[uint];
570}
571
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000572table StridedSliceLayer {
573 base:LayerBase;
574 descriptor:StridedSliceDescriptor;
575}
576
577table StridedSliceDescriptor {
578 begin:[int];
579 end:[int];
580 stride:[int];
581 beginMask:int;
582 endMask:int;
583 shrinkAxisMask:int;
584 ellipsisMask:int;
585 newAxisMask:int;
586 dataLayout:DataLayout;
587}
588
Jim Flynne242f2d2019-05-22 14:24:13 +0100589table ConcatLayer {
590 base:LayerBase;
591 descriptor:OriginsDescriptor;
592}
593
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100594/// @deprecated Use ConcatLayer instead
Jim Flynnac25a1b2019-02-28 10:40:49 +0000595table MergerLayer {
596 base:LayerBase;
597 descriptor:OriginsDescriptor;
598}
599
600table UintVector {
601 data:[uint];
602}
603
604table OriginsDescriptor {
605 concatAxis:uint;
606 numViews:uint;
607 numDimensions:uint;
608 viewOrigins:[UintVector];
609}
610
Jim Flynn18ce3382019-03-08 11:08:30 +0000611table ViewsDescriptor {
612 origins:OriginsDescriptor;
613 viewSizes:[UintVector];
614}
615
616table SplitterLayer {
617 base:LayerBase;
618 descriptor:ViewsDescriptor;
619}
620
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000621table DetectionPostProcessLayer {
622 base:LayerBase;
623 descriptor:DetectionPostProcessDescriptor;
624 anchors:ConstTensor;
625}
626
627table DetectionPostProcessDescriptor {
628 maxDetections:uint;
629 maxClassesPerDetection:uint;
630 detectionsPerClass:uint;
631 nmsScoreThreshold:float;
632 nmsIouThreshold:float;
633 numClasses:uint;
634 useRegularNms:bool;
635 scaleX:float;
636 scaleY:float;
637 scaleW:float;
638 scaleH:float;
639}
640
Jim Flynn11af3752019-03-19 17:22:29 +0000641table LstmInputParams {
642 inputToForgetWeights:ConstTensor;
643 inputToCellWeights:ConstTensor;
644 inputToOutputWeights:ConstTensor;
645 recurrentToForgetWeights:ConstTensor;
646 recurrentToCellWeights:ConstTensor;
647 recurrentToOutputWeights:ConstTensor;
648 forgetGateBias:ConstTensor;
649 cellBias:ConstTensor;
650 outputGateBias:ConstTensor;
651
652 inputToInputWeights:ConstTensor;
653 recurrentToInputWeights:ConstTensor;
654 cellToInputWeights:ConstTensor;
655 inputGateBias:ConstTensor;
656
657 projectionWeights:ConstTensor;
658 projectionBias:ConstTensor;
659
660 cellToForgetWeights:ConstTensor;
661 cellToOutputWeights:ConstTensor;
Jan Eilersf8c62972019-07-17 11:07:49 +0100662
663 inputLayerNormWeights:ConstTensor;
664 forgetLayerNormWeights:ConstTensor;
665 cellLayerNormWeights:ConstTensor;
666 outputLayerNormWeights:ConstTensor;
Jim Flynn11af3752019-03-19 17:22:29 +0000667}
668
Jan Eilers5b01a892019-07-23 09:47:43 +0100669table QuantizedLstmInputParams {
670 inputToInputWeights:ConstTensor;
671 inputToForgetWeights:ConstTensor;
672 inputToCellWeights:ConstTensor;
673 inputToOutputWeights:ConstTensor;
674
675 recurrentToInputWeights:ConstTensor;
676 recurrentToForgetWeights:ConstTensor;
677 recurrentToCellWeights:ConstTensor;
678 recurrentToOutputWeights:ConstTensor;
679
680 inputGateBias:ConstTensor;
681 forgetGateBias:ConstTensor;
682 cellBias:ConstTensor;
683 outputGateBias:ConstTensor;
684}
685
Jim Flynn11af3752019-03-19 17:22:29 +0000686table LstmDescriptor {
687 activationFunc:uint;
688 clippingThresCell:float;
689 clippingThresProj:float;
690 cifgEnabled:bool = true;
691 peepholeEnabled:bool = false;
692 projectionEnabled:bool = false;
Jan Eilersf8c62972019-07-17 11:07:49 +0100693 layerNormEnabled:bool = false;
Jim Flynn11af3752019-03-19 17:22:29 +0000694}
695
696table LstmLayer {
697 base:LayerBase;
698 descriptor:LstmDescriptor;
699 inputParams:LstmInputParams;
700}
701
Jan Eilers5b01a892019-07-23 09:47:43 +0100702table QuantizedLstmLayer {
703 base:LayerBase;
704 inputParams:QuantizedLstmInputParams;
705}
706
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000707table DequantizeLayer {
708 base:LayerBase;
709}
710
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100711table MergeLayer {
712 base:LayerBase;
713}
714
Sadik Armaganeff363d2019-04-05 15:25:46 +0100715table SwitchLayer {
716 base:LayerBase;
717}
718
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100719table PreluLayer {
720 base:LayerBase;
721}
722
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100723table TransposeConvolution2dLayer {
724 base:LayerBase;
725 descriptor:TransposeConvolution2dDescriptor;
726 weights:ConstTensor;
727 biases:ConstTensor;
728}
729
730table TransposeConvolution2dDescriptor {
731 padLeft:uint;
732 padRight:uint;
733 padTop:uint;
734 padBottom:uint;
735 strideX:uint;
736 strideY:uint;
737 biasEnabled:bool = false;
738 dataLayout:DataLayout = NCHW;
739}
740
Mike Kellyc9ea45a2020-02-28 18:11:58 +0000741table TransposeLayer {
742 base:LayerBase;
743 descriptor:TransposeDescriptor;
744}
745
746table TransposeDescriptor {
747 dimMappings:[uint];
748}
749
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100750table ResizeLayer {
751 base:LayerBase;
752 descriptor:ResizeDescriptor;
753}
754
755table ResizeDescriptor {
756 targetHeight:uint;
757 targetWidth:uint;
758 method:ResizeMethod = NearestNeighbor;
759 dataLayout:DataLayout;
760}
761
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100762table StackLayer {
763 base:LayerBase;
764 descriptor:StackDescriptor;
765}
766
767table StackDescriptor {
768 axis:uint;
769 numInputs:uint;
770 inputShape:[uint];
771}
772
Aron Virginas-Tar85121a22019-10-23 10:41:35 +0100773table StandInDescriptor {
774 numInputs:uint;
775 numOutputs:uint;
776}
777
778table StandInLayer {
779 base:LayerBase;
780 descriptor:StandInDescriptor;
781}
782
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000783union Layer {
Mike Kellyaf484012019-02-20 16:53:11 +0000784 ActivationLayer,
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000785 AdditionLayer,
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000786 BatchToSpaceNdLayer,
ruoyan018e7fa232019-02-28 15:09:07 +0000787 BatchNormalizationLayer,
Conor Kennedy76277882019-02-26 08:29:54 +0000788 ConstantLayer,
Mike Kellya0766c32019-02-19 17:22:07 +0000789 Convolution2dLayer,
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000790 DepthwiseConvolution2dLayer,
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000791 FullyConnectedLayer,
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000792 InputLayer,
Sadik Armagan5f450272019-02-12 14:31:45 +0000793 MultiplicationLayer,
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000794 OutputLayer,
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000795 PermuteLayer,
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000796 Pooling2dLayer,
Saoirse Stewart263829c2019-02-19 15:54:14 +0000797 ReshapeLayer,
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000798 SoftmaxLayer,
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000799 SpaceToBatchNdLayer,
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000800 DivisionLayer,
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000801 MinimumLayer,
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000802 EqualLayer,
Nina Drozd57728782019-02-27 10:53:27 +0000803 MaximumLayer,
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000804 NormalizationLayer,
Sadik Armagan8b42a382019-03-01 14:24:49 +0000805 PadLayer,
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000806 RsqrtLayer,
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000807 FloorLayer,
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000808 GreaterLayer,
Conor Kennedyda1f9752019-03-01 14:37:12 +0000809 ResizeBilinearLayer,
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000810 SubtractionLayer,
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000811 StridedSliceLayer,
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000812 GatherLayer,
Jim Flynnac25a1b2019-02-28 10:40:49 +0000813 MeanLayer,
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000814 MergerLayer,
Jim Flynn18ce3382019-03-08 11:08:30 +0000815 L2NormalizationLayer,
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000816 SplitterLayer,
Jim Flynn11af3752019-03-19 17:22:29 +0000817 DetectionPostProcessLayer,
Derek Lamberti87acb272019-03-27 16:51:31 +0000818 LstmLayer,
Jan Eilers5b01a892019-07-23 09:47:43 +0100819 QuantizedLstmLayer,
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000820 QuantizeLayer,
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100821 DequantizeLayer,
Sadik Armaganeff363d2019-04-05 15:25:46 +0100822 MergeLayer,
Jim Flynne242f2d2019-05-22 14:24:13 +0100823 SwitchLayer,
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100824 ConcatLayer,
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100825 SpaceToDepthLayer,
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100826 PreluLayer,
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100827 TransposeConvolution2dLayer,
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100828 ResizeLayer,
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100829 StackLayer,
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100830 AbsLayer,
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100831 ArgMinMaxLayer,
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100832 SliceLayer,
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100833 DepthToSpaceLayer,
Sadik Armagan26257852019-10-14 13:00:47 +0100834 InstanceNormalizationLayer,
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100835 LogSoftmaxLayer,
Aron Virginas-Tar85121a22019-10-23 10:41:35 +0100836 ComparisonLayer,
josh minor4a3c6102020-01-06 16:40:46 -0600837 StandInLayer,
Mike Kellyc9ea45a2020-02-28 18:11:58 +0000838 ElementwiseUnaryLayer,
839 TransposeLayer
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000840}
841
Saoirse Stewart49dbe0e2019-02-05 17:27:06 +0000842table AnyLayer {
843 layer:Layer;
844}
845
Tee Jungaa920c52019-11-05 10:48:25 +0000846table FeatureCompatibilityVersions {
847 bindingIdsScheme:uint = 0;
848}
849
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000850// Root type for serialized data is the graph of the network
851table SerializedGraph {
Saoirse Stewart49dbe0e2019-02-05 17:27:06 +0000852 layers:[AnyLayer];
Tee Jungaa920c52019-11-05 10:48:25 +0000853 inputIds:[int];
854 outputIds:[int];
855 featureVersions:FeatureCompatibilityVersions;
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000856}
857
858root_type SerializedGraph;