blob: 0756784cd313013f31819dfd7fe1928a1d8ce72c [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,
22 Square = 9
23}
24
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +010025enum ArgMinMaxFunction : byte {
26 Min = 0,
27 Max = 1
28}
29
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +000030enum DataType : byte {
31 Float16 = 0,
32 Float32 = 1,
33 QuantisedAsymm8 = 2,
34 Signed32 = 3,
Nattapat Chaimanowongcd5ac232019-03-19 12:26:36 +000035 Boolean = 4,
36 QuantisedSymm16 = 5
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +000037}
38
Saoirse Stewart3166c3e2019-02-18 15:24:53 +000039enum DataLayout : byte {
40 NHWC = 0,
41 NCHW = 1
42}
43
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +010044enum ResizeMethod: byte {
45 NearestNeighbor = 0,
46 Bilinear = 1,
47}
48
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +000049table TensorInfo {
50 dimensions:[uint];
51 dataType:DataType;
52 quantizationScale:float = 1.0;
53 quantizationOffset:int = 0;
54}
55
56struct Connection {
57 sourceLayerIndex:uint;
58 outputSlotIndex:uint;
59}
60
61table ByteData {
62 data:[byte];
63}
64
65table ShortData {
66 data:[short];
67}
68
69table IntData {
70 data:[int];
71}
72
73table LongData {
74 data:[long];
75}
76
77union ConstTensorData { ByteData, ShortData, IntData, LongData }
78
79table ConstTensor {
80 info:TensorInfo;
81 data:ConstTensorData;
82}
83
84table InputSlot {
85 index:uint;
86 connection:Connection;
87}
88
89table OutputSlot {
90 index:uint;
91 tensorInfo:TensorInfo;
92}
93
94enum LayerType : uint {
95 Addition = 0,
96 Input = 1,
Sadik Armagan5f450272019-02-12 14:31:45 +000097 Multiplication = 2,
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +000098 Output = 3,
Saoirse Stewart3166c3e2019-02-18 15:24:53 +000099 Pooling2d = 4,
Saoirse Stewart263829c2019-02-19 15:54:14 +0000100 Reshape = 5,
Mike Kellya0766c32019-02-19 17:22:07 +0000101 Softmax = 6,
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000102 Convolution2d = 7,
Mike Kellyaf484012019-02-20 16:53:11 +0000103 DepthwiseConvolution2d = 8,
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000104 Activation = 9,
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000105 Permute = 10,
Conor Kennedy76277882019-02-26 08:29:54 +0000106 FullyConnected = 11,
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000107 Constant = 12,
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000108 SpaceToBatchNd = 13,
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000109 BatchToSpaceNd = 14,
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000110 Division = 15,
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000111 Minimum = 16,
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000112 Equal = 17,
Nina Drozd57728782019-02-27 10:53:27 +0000113 Maximum = 18,
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000114 Normalization = 19,
Sadik Armagan8b42a382019-03-01 14:24:49 +0000115 Pad = 20,
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000116 Rsqrt = 21,
ruoyan018e7fa232019-02-28 15:09:07 +0000117 Floor = 22,
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000118 BatchNormalization = 23,
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000119 Greater = 24,
Conor Kennedyda1f9752019-03-01 14:37:12 +0000120 ResizeBilinear = 25,
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000121 Subtraction = 26,
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000122 StridedSlice = 27,
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000123 Gather = 28,
Jim Flynnac25a1b2019-02-28 10:40:49 +0000124 Mean = 29,
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000125 Merger = 30,
Jim Flynn18ce3382019-03-08 11:08:30 +0000126 L2Normalization = 31,
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000127 Splitter = 32,
Jim Flynn11af3752019-03-19 17:22:29 +0000128 DetectionPostProcess = 33,
Derek Lamberti87acb272019-03-27 16:51:31 +0000129 Lstm = 34,
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000130 Quantize = 35,
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100131 Dequantize = 36,
Sadik Armaganeff363d2019-04-05 15:25:46 +0100132 Merge = 37,
Jim Flynne242f2d2019-05-22 14:24:13 +0100133 Switch = 38,
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100134 Concat = 39,
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100135 SpaceToDepth = 40,
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100136 Prelu = 41,
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100137 TransposeConvolution2d = 42,
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100138 Resize = 43,
Jan Eilers5b01a892019-07-23 09:47:43 +0100139 Stack = 44,
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100140 QuantizedLstm = 45,
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100141 Abs = 46,
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100142 ArgMinMax = 47,
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100143 Slice = 48,
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100144 DepthToSpace = 49,
Sadik Armagan26257852019-10-14 13:00:47 +0100145 InstanceNormalization = 50,
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100146 LogSoftmax = 51,
147 Comparison = 52
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000148}
149
150// Base layer table to be used as part of other layers
151table LayerBase {
152 index:uint;
153 layerName:string;
154 layerType:LayerType;
155 inputSlots:[InputSlot];
156 outputSlots:[OutputSlot];
157}
158
159table BindableLayerBase {
160 base:LayerBase;
161 layerBindingId:int;
162}
163
164// Table for each layer defined below
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100165
166table AbsLayer {
167 base:LayerBase;
168}
169
Mike Kellyaf484012019-02-20 16:53:11 +0000170table ActivationLayer {
171 base:LayerBase;
172 descriptor:ActivationDescriptor;
173}
174
175table ActivationDescriptor {
Tee Jung86bc3d82019-10-01 11:25:56 +0900176 activationFunction:ActivationFunction = Sigmoid;
Mike Kellyaf484012019-02-20 16:53:11 +0000177 a:float;
178 b:float;
179}
180
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000181table AdditionLayer {
182 base:LayerBase;
183}
184
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100185table ArgMinMaxLayer {
186 base:LayerBase;
187 descriptor:ArgMinMaxDescriptor;
188}
189
190table ArgMinMaxDescriptor{
Tee Jung86bc3d82019-10-01 11:25:56 +0900191 argMinMaxFunction:ArgMinMaxFunction;
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100192 axis:int;
193}
194
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100195enum ComparisonOperation : byte {
196 Equal = 0,
197 Greater = 1,
198 GreaterOrEqual = 2,
199 Less = 3,
200 LessOrEqual = 4,
201 NotEqual = 5
202}
203
204table ComparisonDescriptor {
205 operation:ComparisonOperation;
206}
207
208table ComparisonLayer {
209 base:LayerBase;
210 descriptor:ComparisonDescriptor;
211}
212
Conor Kennedy76277882019-02-26 08:29:54 +0000213table ConstantLayer {
214 base:LayerBase;
215 input:ConstTensor;
216}
217
Mike Kellya0766c32019-02-19 17:22:07 +0000218table Convolution2dLayer {
219 base:LayerBase;
220 descriptor:Convolution2dDescriptor;
221 weights:ConstTensor;
222 biases:ConstTensor;
223}
224
225table Convolution2dDescriptor {
226 padLeft:uint;
227 padRight:uint;
228 padTop:uint;
229 padBottom:uint;
230 strideX:uint;
231 strideY:uint;
Matthew Benthamacad04e2019-05-13 10:02:45 +0100232 dilationX:uint = 1;
233 dilationY:uint = 1;
Mike Kellya0766c32019-02-19 17:22:07 +0000234 biasEnabled:bool = false;
235 dataLayout:DataLayout = NCHW;
236}
237
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100238table DepthToSpaceLayer {
239 base:LayerBase;
240 descriptor:DepthToSpaceDescriptor;
241}
242
243table DepthToSpaceDescriptor {
244 blockSize:uint;
245 dataLayout:DataLayout;
246}
247
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000248table DivisionLayer {
249 base:LayerBase;
250}
251
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100252/// @deprecated Use ComparisonLayer instead
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000253table EqualLayer {
254 base:LayerBase;
255}
256
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000257table FloorLayer{
258 base:LayerBase;
259}
260
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000261table FullyConnectedLayer {
262 base:LayerBase;
263 descriptor:FullyConnectedDescriptor;
264 weights:ConstTensor;
265 biases:ConstTensor;
266}
267
268table FullyConnectedDescriptor {
269 biasEnabled:bool = false;
270 transposeWeightsMatrix:bool = false;
271}
272
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000273table GatherLayer {
274 base:LayerBase;
275}
276
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100277/// @deprecated Use ComparisonLayer instead
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000278table GreaterLayer {
279 base:LayerBase;
280}
281
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000282table InputLayer {
283 base:BindableLayerBase;
284}
285
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100286table InstanceNormalizationLayer {
287 base:LayerBase;
288 descriptor:InstanceNormalizationDescriptor;
289}
290
291table InstanceNormalizationDescriptor {
292 gamma:float;
293 beta:float;
294 eps:float;
295 dataLayout:DataLayout;
296}
297
Sadik Armagan26257852019-10-14 13:00:47 +0100298table LogSoftmaxLayer {
299 base:LayerBase;
300 descriptor:LogSoftmaxDescriptor;
301}
302
303table LogSoftmaxDescriptor {
304 beta:float = 1;
305 axis:int = -1;
306}
307
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000308table L2NormalizationLayer {
309 base:LayerBase;
310 descriptor:L2NormalizationDescriptor;
311}
312
313table L2NormalizationDescriptor {
314 dataLayout:DataLayout = NCHW;
Ferran Balaguer0dcffec2019-06-18 16:25:06 +0100315 eps:float = 1e-12;
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000316}
317
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000318table MinimumLayer {
319 base:LayerBase;
320}
321
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000322table MaximumLayer {
323 base:LayerBase;
324}
325
Sadik Armagan5f450272019-02-12 14:31:45 +0000326table MultiplicationLayer {
327 base:LayerBase;
328}
329
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000330table Pooling2dLayer {
331 base:LayerBase;
332 descriptor:Pooling2dDescriptor;
333}
334
335enum PoolingAlgorithm : byte {
336 Max = 0,
337 Average = 1,
338 L2 = 2
339}
340
341enum OutputShapeRounding : byte {
342 Floor = 0,
343 Ceiling = 1
344}
345
346enum PaddingMethod : byte {
347 IgnoreValue = 0,
348 Exclude = 1
349}
350
351table Pooling2dDescriptor {
352 poolType:PoolingAlgorithm;
353 padLeft:uint;
354 padRight:uint;
355 padTop:uint;
356 padBottom:uint;
357 poolWidth:uint;
358 poolHeight:uint;
359 strideX:uint;
360 strideY:uint;
361 outputShapeRounding:OutputShapeRounding;
362 paddingMethod:PaddingMethod;
363 dataLayout:DataLayout;
364}
365
Derek Lamberti87acb272019-03-27 16:51:31 +0000366table QuantizeLayer {
367 base:LayerBase;
368}
369
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000370table SoftmaxLayer {
371 base:LayerBase;
372 descriptor:SoftmaxDescriptor;
373}
374
375table SoftmaxDescriptor {
376 beta:float;
377}
378
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000379table DepthwiseConvolution2dLayer {
380 base:LayerBase;
381 descriptor:DepthwiseConvolution2dDescriptor;
382 weights:ConstTensor;
383 biases:ConstTensor;
384}
385
386table DepthwiseConvolution2dDescriptor {
387 padLeft:uint;
388 padRight:uint;
389 padTop:uint;
390 padBottom:uint;
391 strideX:uint;
392 strideY:uint;
Matthew Benthamacad04e2019-05-13 10:02:45 +0100393 dilationX:uint = 1;
394 dilationY:uint = 1;
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000395 biasEnabled:bool = false;
396 dataLayout:DataLayout = NCHW;
397}
398
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000399table OutputLayer {
400 base:BindableLayerBase;
401}
402
Saoirse Stewart263829c2019-02-19 15:54:14 +0000403table ReshapeLayer {
404 base:LayerBase;
405 descriptor:ReshapeDescriptor;
406}
407
408table ReshapeDescriptor {
409 targetShape:[uint];
410}
411
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000412table PermuteLayer {
413 base:LayerBase;
414 descriptor:PermuteDescriptor;
415}
416
417table PermuteDescriptor {
418 dimMappings:[uint];
419}
420
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000421table SpaceToBatchNdLayer {
422 base:LayerBase;
423 descriptor:SpaceToBatchNdDescriptor;
424}
425
426table SpaceToBatchNdDescriptor {
427 blockShape:[uint];
428 padList:[uint];
429 dataLayout:DataLayout;
430}
431
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100432table SpaceToDepthLayer {
433 base:LayerBase;
434 descriptor:SpaceToDepthDescriptor;
435}
436
437table SpaceToDepthDescriptor {
438 blockSize:uint;
439 dataLayout:DataLayout;
440}
441
Conor Kennedyda1f9752019-03-01 14:37:12 +0000442table SubtractionLayer {
443 base:LayerBase;
444}
445
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000446table BatchToSpaceNdLayer {
447 base:LayerBase;
448 descriptor:BatchToSpaceNdDescriptor;
449}
450
451table BatchToSpaceNdDescriptor {
452 blockShape:[uint];
453 crops:[uint];
454 dataLayout:DataLayout;
455}
456
Nina Drozd57728782019-02-27 10:53:27 +0000457enum NormalizationAlgorithmChannel : byte {
458 Across = 0,
459 Within = 1
460}
461
462enum NormalizationAlgorithmMethod : byte {
463 LocalBrightness = 0,
464 LocalContrast = 1
465}
466
467table NormalizationLayer {
468 base:LayerBase;
469 descriptor:NormalizationDescriptor;
470}
471
472table NormalizationDescriptor {
473 normChannelType:NormalizationAlgorithmChannel = Across;
474 normMethodType:NormalizationAlgorithmMethod = LocalBrightness;
475 normSize:uint;
476 alpha:float;
477 beta:float;
478 k:float;
479 dataLayout:DataLayout = NCHW;
480}
481
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000482table MeanLayer {
483 base:LayerBase;
484 descriptor:MeanDescriptor;
485}
486
487table MeanDescriptor {
488 axis:[uint];
489 keepDims:bool = false;
490}
491
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000492table PadLayer {
493 base:LayerBase;
494 descriptor:PadDescriptor;
495}
496
497table PadDescriptor {
498 padList:[uint];
David Monahan34757812019-06-19 11:47:21 +0100499 padValue:float = 0;
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000500}
501
Sadik Armagan8b42a382019-03-01 14:24:49 +0000502table RsqrtLayer {
503 base:LayerBase;
504}
505
ruoyan018e7fa232019-02-28 15:09:07 +0000506table BatchNormalizationLayer {
507 base:LayerBase;
508 descriptor:BatchNormalizationDescriptor;
509 mean:ConstTensor;
510 variance:ConstTensor;
511 beta:ConstTensor;
512 gamma:ConstTensor;
513}
514
515table BatchNormalizationDescriptor {
516 eps:float;
517 dataLayout:DataLayout;
518}
519
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100520/// @deprecated Use ResizeLayer instead
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000521table ResizeBilinearLayer {
522 base:LayerBase;
523 descriptor:ResizeBilinearDescriptor;
524}
525
526table ResizeBilinearDescriptor {
527 targetWidth:uint;
528 targetHeight:uint;
529 dataLayout:DataLayout;
530}
531
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100532table SliceLayer {
533 base:LayerBase;
534 descriptor:SliceDescriptor;
535}
536
537table SliceDescriptor {
538 begin:[uint];
539 size:[uint];
540}
541
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000542table StridedSliceLayer {
543 base:LayerBase;
544 descriptor:StridedSliceDescriptor;
545}
546
547table StridedSliceDescriptor {
548 begin:[int];
549 end:[int];
550 stride:[int];
551 beginMask:int;
552 endMask:int;
553 shrinkAxisMask:int;
554 ellipsisMask:int;
555 newAxisMask:int;
556 dataLayout:DataLayout;
557}
558
Jim Flynne242f2d2019-05-22 14:24:13 +0100559table ConcatLayer {
560 base:LayerBase;
561 descriptor:OriginsDescriptor;
562}
563
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100564/// @deprecated Use ConcatLayer instead
Jim Flynnac25a1b2019-02-28 10:40:49 +0000565table MergerLayer {
566 base:LayerBase;
567 descriptor:OriginsDescriptor;
568}
569
570table UintVector {
571 data:[uint];
572}
573
574table OriginsDescriptor {
575 concatAxis:uint;
576 numViews:uint;
577 numDimensions:uint;
578 viewOrigins:[UintVector];
579}
580
Jim Flynn18ce3382019-03-08 11:08:30 +0000581table ViewsDescriptor {
582 origins:OriginsDescriptor;
583 viewSizes:[UintVector];
584}
585
586table SplitterLayer {
587 base:LayerBase;
588 descriptor:ViewsDescriptor;
589}
590
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000591table DetectionPostProcessLayer {
592 base:LayerBase;
593 descriptor:DetectionPostProcessDescriptor;
594 anchors:ConstTensor;
595}
596
597table DetectionPostProcessDescriptor {
598 maxDetections:uint;
599 maxClassesPerDetection:uint;
600 detectionsPerClass:uint;
601 nmsScoreThreshold:float;
602 nmsIouThreshold:float;
603 numClasses:uint;
604 useRegularNms:bool;
605 scaleX:float;
606 scaleY:float;
607 scaleW:float;
608 scaleH:float;
609}
610
Jim Flynn11af3752019-03-19 17:22:29 +0000611table LstmInputParams {
612 inputToForgetWeights:ConstTensor;
613 inputToCellWeights:ConstTensor;
614 inputToOutputWeights:ConstTensor;
615 recurrentToForgetWeights:ConstTensor;
616 recurrentToCellWeights:ConstTensor;
617 recurrentToOutputWeights:ConstTensor;
618 forgetGateBias:ConstTensor;
619 cellBias:ConstTensor;
620 outputGateBias:ConstTensor;
621
622 inputToInputWeights:ConstTensor;
623 recurrentToInputWeights:ConstTensor;
624 cellToInputWeights:ConstTensor;
625 inputGateBias:ConstTensor;
626
627 projectionWeights:ConstTensor;
628 projectionBias:ConstTensor;
629
630 cellToForgetWeights:ConstTensor;
631 cellToOutputWeights:ConstTensor;
Jan Eilersf8c62972019-07-17 11:07:49 +0100632
633 inputLayerNormWeights:ConstTensor;
634 forgetLayerNormWeights:ConstTensor;
635 cellLayerNormWeights:ConstTensor;
636 outputLayerNormWeights:ConstTensor;
Jim Flynn11af3752019-03-19 17:22:29 +0000637}
638
Jan Eilers5b01a892019-07-23 09:47:43 +0100639table QuantizedLstmInputParams {
640 inputToInputWeights:ConstTensor;
641 inputToForgetWeights:ConstTensor;
642 inputToCellWeights:ConstTensor;
643 inputToOutputWeights:ConstTensor;
644
645 recurrentToInputWeights:ConstTensor;
646 recurrentToForgetWeights:ConstTensor;
647 recurrentToCellWeights:ConstTensor;
648 recurrentToOutputWeights:ConstTensor;
649
650 inputGateBias:ConstTensor;
651 forgetGateBias:ConstTensor;
652 cellBias:ConstTensor;
653 outputGateBias:ConstTensor;
654}
655
Jim Flynn11af3752019-03-19 17:22:29 +0000656table LstmDescriptor {
657 activationFunc:uint;
658 clippingThresCell:float;
659 clippingThresProj:float;
660 cifgEnabled:bool = true;
661 peepholeEnabled:bool = false;
662 projectionEnabled:bool = false;
Jan Eilersf8c62972019-07-17 11:07:49 +0100663 layerNormEnabled:bool = false;
Jim Flynn11af3752019-03-19 17:22:29 +0000664}
665
666table LstmLayer {
667 base:LayerBase;
668 descriptor:LstmDescriptor;
669 inputParams:LstmInputParams;
670}
671
Jan Eilers5b01a892019-07-23 09:47:43 +0100672table QuantizedLstmLayer {
673 base:LayerBase;
674 inputParams:QuantizedLstmInputParams;
675}
676
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000677table DequantizeLayer {
678 base:LayerBase;
679}
680
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100681table MergeLayer {
682 base:LayerBase;
683}
684
Sadik Armaganeff363d2019-04-05 15:25:46 +0100685table SwitchLayer {
686 base:LayerBase;
687}
688
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100689table PreluLayer {
690 base:LayerBase;
691}
692
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100693table TransposeConvolution2dLayer {
694 base:LayerBase;
695 descriptor:TransposeConvolution2dDescriptor;
696 weights:ConstTensor;
697 biases:ConstTensor;
698}
699
700table TransposeConvolution2dDescriptor {
701 padLeft:uint;
702 padRight:uint;
703 padTop:uint;
704 padBottom:uint;
705 strideX:uint;
706 strideY:uint;
707 biasEnabled:bool = false;
708 dataLayout:DataLayout = NCHW;
709}
710
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100711table ResizeLayer {
712 base:LayerBase;
713 descriptor:ResizeDescriptor;
714}
715
716table ResizeDescriptor {
717 targetHeight:uint;
718 targetWidth:uint;
719 method:ResizeMethod = NearestNeighbor;
720 dataLayout:DataLayout;
721}
722
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100723table StackLayer {
724 base:LayerBase;
725 descriptor:StackDescriptor;
726}
727
728table StackDescriptor {
729 axis:uint;
730 numInputs:uint;
731 inputShape:[uint];
732}
733
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000734union Layer {
Mike Kellyaf484012019-02-20 16:53:11 +0000735 ActivationLayer,
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000736 AdditionLayer,
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000737 BatchToSpaceNdLayer,
ruoyan018e7fa232019-02-28 15:09:07 +0000738 BatchNormalizationLayer,
Conor Kennedy76277882019-02-26 08:29:54 +0000739 ConstantLayer,
Mike Kellya0766c32019-02-19 17:22:07 +0000740 Convolution2dLayer,
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000741 DepthwiseConvolution2dLayer,
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000742 FullyConnectedLayer,
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000743 InputLayer,
Sadik Armagan5f450272019-02-12 14:31:45 +0000744 MultiplicationLayer,
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000745 OutputLayer,
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000746 PermuteLayer,
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000747 Pooling2dLayer,
Saoirse Stewart263829c2019-02-19 15:54:14 +0000748 ReshapeLayer,
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000749 SoftmaxLayer,
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000750 SpaceToBatchNdLayer,
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000751 DivisionLayer,
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000752 MinimumLayer,
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000753 EqualLayer,
Nina Drozd57728782019-02-27 10:53:27 +0000754 MaximumLayer,
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000755 NormalizationLayer,
Sadik Armagan8b42a382019-03-01 14:24:49 +0000756 PadLayer,
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000757 RsqrtLayer,
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000758 FloorLayer,
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000759 GreaterLayer,
Conor Kennedyda1f9752019-03-01 14:37:12 +0000760 ResizeBilinearLayer,
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000761 SubtractionLayer,
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000762 StridedSliceLayer,
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000763 GatherLayer,
Jim Flynnac25a1b2019-02-28 10:40:49 +0000764 MeanLayer,
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000765 MergerLayer,
Jim Flynn18ce3382019-03-08 11:08:30 +0000766 L2NormalizationLayer,
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000767 SplitterLayer,
Jim Flynn11af3752019-03-19 17:22:29 +0000768 DetectionPostProcessLayer,
Derek Lamberti87acb272019-03-27 16:51:31 +0000769 LstmLayer,
Jan Eilers5b01a892019-07-23 09:47:43 +0100770 QuantizedLstmLayer,
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000771 QuantizeLayer,
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100772 DequantizeLayer,
Sadik Armaganeff363d2019-04-05 15:25:46 +0100773 MergeLayer,
Jim Flynne242f2d2019-05-22 14:24:13 +0100774 SwitchLayer,
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100775 ConcatLayer,
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100776 SpaceToDepthLayer,
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100777 PreluLayer,
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100778 TransposeConvolution2dLayer,
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100779 ResizeLayer,
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100780 StackLayer,
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100781 AbsLayer,
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100782 ArgMinMaxLayer,
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100783 SliceLayer,
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100784 DepthToSpaceLayer,
Sadik Armagan26257852019-10-14 13:00:47 +0100785 InstanceNormalizationLayer,
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100786 LogSoftmaxLayer,
787 ComparisonLayer
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000788}
789
Saoirse Stewart49dbe0e2019-02-05 17:27:06 +0000790table AnyLayer {
791 layer:Layer;
792}
793
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000794// Root type for serialized data is the graph of the network
795table SerializedGraph {
Saoirse Stewart49dbe0e2019-02-05 17:27:06 +0000796 layers:[AnyLayer];
Mike Kelly8c1701a2019-02-11 17:01:27 +0000797 inputIds:[uint];
798 outputIds:[uint];
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000799}
800
801root_type SerializedGraph;