blob: 0d30d96452b545b5466493e8ceb436f575c87762 [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,
Derek Lambertif90c56d2020-01-10 17:14:08 +000033 QuantisedAsymm8 = 2, // deprecated
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +000034 Signed32 = 3,
Nattapat Chaimanowongcd5ac232019-03-19 12:26:36 +000035 Boolean = 4,
Derek Lambertif90c56d2020-01-10 17:14:08 +000036 QuantisedSymm16 = 5, // deprecated
37 QAsymmU8 = 6,
38 QSymmS16 = 7
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +000039}
40
Saoirse Stewart3166c3e2019-02-18 15:24:53 +000041enum DataLayout : byte {
42 NHWC = 0,
43 NCHW = 1
44}
45
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +010046enum ResizeMethod: byte {
47 NearestNeighbor = 0,
48 Bilinear = 1,
49}
50
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +000051table TensorInfo {
52 dimensions:[uint];
53 dataType:DataType;
54 quantizationScale:float = 1.0;
55 quantizationOffset:int = 0;
56}
57
58struct Connection {
59 sourceLayerIndex:uint;
60 outputSlotIndex:uint;
61}
62
63table ByteData {
64 data:[byte];
65}
66
67table ShortData {
68 data:[short];
69}
70
71table IntData {
72 data:[int];
73}
74
75table LongData {
76 data:[long];
77}
78
79union ConstTensorData { ByteData, ShortData, IntData, LongData }
80
81table ConstTensor {
82 info:TensorInfo;
83 data:ConstTensorData;
84}
85
86table InputSlot {
87 index:uint;
88 connection:Connection;
89}
90
91table OutputSlot {
92 index:uint;
93 tensorInfo:TensorInfo;
94}
95
96enum LayerType : uint {
97 Addition = 0,
98 Input = 1,
Sadik Armagan5f450272019-02-12 14:31:45 +000099 Multiplication = 2,
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000100 Output = 3,
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000101 Pooling2d = 4,
Saoirse Stewart263829c2019-02-19 15:54:14 +0000102 Reshape = 5,
Mike Kellya0766c32019-02-19 17:22:07 +0000103 Softmax = 6,
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000104 Convolution2d = 7,
Mike Kellyaf484012019-02-20 16:53:11 +0000105 DepthwiseConvolution2d = 8,
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000106 Activation = 9,
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000107 Permute = 10,
Conor Kennedy76277882019-02-26 08:29:54 +0000108 FullyConnected = 11,
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000109 Constant = 12,
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000110 SpaceToBatchNd = 13,
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000111 BatchToSpaceNd = 14,
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000112 Division = 15,
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000113 Minimum = 16,
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000114 Equal = 17,
Nina Drozd57728782019-02-27 10:53:27 +0000115 Maximum = 18,
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000116 Normalization = 19,
Sadik Armagan8b42a382019-03-01 14:24:49 +0000117 Pad = 20,
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000118 Rsqrt = 21,
ruoyan018e7fa232019-02-28 15:09:07 +0000119 Floor = 22,
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000120 BatchNormalization = 23,
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000121 Greater = 24,
Conor Kennedyda1f9752019-03-01 14:37:12 +0000122 ResizeBilinear = 25,
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000123 Subtraction = 26,
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000124 StridedSlice = 27,
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000125 Gather = 28,
Jim Flynnac25a1b2019-02-28 10:40:49 +0000126 Mean = 29,
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000127 Merger = 30,
Jim Flynn18ce3382019-03-08 11:08:30 +0000128 L2Normalization = 31,
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000129 Splitter = 32,
Jim Flynn11af3752019-03-19 17:22:29 +0000130 DetectionPostProcess = 33,
Derek Lamberti87acb272019-03-27 16:51:31 +0000131 Lstm = 34,
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000132 Quantize = 35,
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100133 Dequantize = 36,
Sadik Armaganeff363d2019-04-05 15:25:46 +0100134 Merge = 37,
Jim Flynne242f2d2019-05-22 14:24:13 +0100135 Switch = 38,
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100136 Concat = 39,
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100137 SpaceToDepth = 40,
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100138 Prelu = 41,
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100139 TransposeConvolution2d = 42,
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100140 Resize = 43,
Jan Eilers5b01a892019-07-23 09:47:43 +0100141 Stack = 44,
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100142 QuantizedLstm = 45,
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100143 Abs = 46,
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100144 ArgMinMax = 47,
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100145 Slice = 48,
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100146 DepthToSpace = 49,
Sadik Armagan26257852019-10-14 13:00:47 +0100147 InstanceNormalization = 50,
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100148 LogSoftmax = 51,
Aron Virginas-Tar85121a22019-10-23 10:41:35 +0100149 Comparison = 52,
150 StandIn = 53
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000151}
152
153// Base layer table to be used as part of other layers
154table LayerBase {
155 index:uint;
156 layerName:string;
157 layerType:LayerType;
158 inputSlots:[InputSlot];
159 outputSlots:[OutputSlot];
160}
161
162table BindableLayerBase {
163 base:LayerBase;
164 layerBindingId:int;
165}
166
167// Table for each layer defined below
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100168
169table AbsLayer {
170 base:LayerBase;
171}
172
Mike Kellyaf484012019-02-20 16:53:11 +0000173table ActivationLayer {
174 base:LayerBase;
175 descriptor:ActivationDescriptor;
176}
177
178table ActivationDescriptor {
Tee Jung86bc3d82019-10-01 11:25:56 +0900179 activationFunction:ActivationFunction = Sigmoid;
Mike Kellyaf484012019-02-20 16:53:11 +0000180 a:float;
181 b:float;
182}
183
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000184table AdditionLayer {
185 base:LayerBase;
186}
187
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100188table ArgMinMaxLayer {
189 base:LayerBase;
190 descriptor:ArgMinMaxDescriptor;
191}
192
193table ArgMinMaxDescriptor{
Tee Jung86bc3d82019-10-01 11:25:56 +0900194 argMinMaxFunction:ArgMinMaxFunction;
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100195 axis:int;
196}
197
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100198enum ComparisonOperation : byte {
199 Equal = 0,
200 Greater = 1,
201 GreaterOrEqual = 2,
202 Less = 3,
203 LessOrEqual = 4,
204 NotEqual = 5
205}
206
207table ComparisonDescriptor {
208 operation:ComparisonOperation;
209}
210
211table ComparisonLayer {
212 base:LayerBase;
213 descriptor:ComparisonDescriptor;
214}
215
Conor Kennedy76277882019-02-26 08:29:54 +0000216table ConstantLayer {
217 base:LayerBase;
218 input:ConstTensor;
219}
220
Mike Kellya0766c32019-02-19 17:22:07 +0000221table Convolution2dLayer {
222 base:LayerBase;
223 descriptor:Convolution2dDescriptor;
224 weights:ConstTensor;
225 biases:ConstTensor;
226}
227
228table Convolution2dDescriptor {
229 padLeft:uint;
230 padRight:uint;
231 padTop:uint;
232 padBottom:uint;
233 strideX:uint;
234 strideY:uint;
Matthew Benthamacad04e2019-05-13 10:02:45 +0100235 dilationX:uint = 1;
236 dilationY:uint = 1;
Mike Kellya0766c32019-02-19 17:22:07 +0000237 biasEnabled:bool = false;
238 dataLayout:DataLayout = NCHW;
239}
240
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100241table DepthToSpaceLayer {
242 base:LayerBase;
243 descriptor:DepthToSpaceDescriptor;
244}
245
246table DepthToSpaceDescriptor {
247 blockSize:uint;
248 dataLayout:DataLayout;
249}
250
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000251table DivisionLayer {
252 base:LayerBase;
253}
254
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100255/// @deprecated Use ComparisonLayer instead
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000256table EqualLayer {
257 base:LayerBase;
258}
259
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000260table FloorLayer{
261 base:LayerBase;
262}
263
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000264table FullyConnectedLayer {
265 base:LayerBase;
266 descriptor:FullyConnectedDescriptor;
267 weights:ConstTensor;
268 biases:ConstTensor;
269}
270
271table FullyConnectedDescriptor {
272 biasEnabled:bool = false;
273 transposeWeightsMatrix:bool = false;
274}
275
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000276table GatherLayer {
277 base:LayerBase;
278}
279
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100280/// @deprecated Use ComparisonLayer instead
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000281table GreaterLayer {
282 base:LayerBase;
283}
284
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000285table InputLayer {
286 base:BindableLayerBase;
287}
288
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100289table InstanceNormalizationLayer {
290 base:LayerBase;
291 descriptor:InstanceNormalizationDescriptor;
292}
293
294table InstanceNormalizationDescriptor {
295 gamma:float;
296 beta:float;
297 eps:float;
298 dataLayout:DataLayout;
299}
300
Sadik Armagan26257852019-10-14 13:00:47 +0100301table LogSoftmaxLayer {
302 base:LayerBase;
303 descriptor:LogSoftmaxDescriptor;
304}
305
306table LogSoftmaxDescriptor {
307 beta:float = 1;
308 axis:int = -1;
309}
310
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000311table L2NormalizationLayer {
312 base:LayerBase;
313 descriptor:L2NormalizationDescriptor;
314}
315
316table L2NormalizationDescriptor {
317 dataLayout:DataLayout = NCHW;
Ferran Balaguer0dcffec2019-06-18 16:25:06 +0100318 eps:float = 1e-12;
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000319}
320
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000321table MinimumLayer {
322 base:LayerBase;
323}
324
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000325table MaximumLayer {
326 base:LayerBase;
327}
328
Sadik Armagan5f450272019-02-12 14:31:45 +0000329table MultiplicationLayer {
330 base:LayerBase;
331}
332
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000333table Pooling2dLayer {
334 base:LayerBase;
335 descriptor:Pooling2dDescriptor;
336}
337
338enum PoolingAlgorithm : byte {
339 Max = 0,
340 Average = 1,
341 L2 = 2
342}
343
344enum OutputShapeRounding : byte {
345 Floor = 0,
346 Ceiling = 1
347}
348
349enum PaddingMethod : byte {
350 IgnoreValue = 0,
351 Exclude = 1
352}
353
354table Pooling2dDescriptor {
355 poolType:PoolingAlgorithm;
356 padLeft:uint;
357 padRight:uint;
358 padTop:uint;
359 padBottom:uint;
360 poolWidth:uint;
361 poolHeight:uint;
362 strideX:uint;
363 strideY:uint;
364 outputShapeRounding:OutputShapeRounding;
365 paddingMethod:PaddingMethod;
366 dataLayout:DataLayout;
367}
368
Derek Lamberti87acb272019-03-27 16:51:31 +0000369table QuantizeLayer {
370 base:LayerBase;
371}
372
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000373table SoftmaxLayer {
374 base:LayerBase;
375 descriptor:SoftmaxDescriptor;
376}
377
378table SoftmaxDescriptor {
379 beta:float;
380}
381
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000382table DepthwiseConvolution2dLayer {
383 base:LayerBase;
384 descriptor:DepthwiseConvolution2dDescriptor;
385 weights:ConstTensor;
386 biases:ConstTensor;
387}
388
389table DepthwiseConvolution2dDescriptor {
390 padLeft:uint;
391 padRight:uint;
392 padTop:uint;
393 padBottom:uint;
394 strideX:uint;
395 strideY:uint;
Matthew Benthamacad04e2019-05-13 10:02:45 +0100396 dilationX:uint = 1;
397 dilationY:uint = 1;
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000398 biasEnabled:bool = false;
399 dataLayout:DataLayout = NCHW;
400}
401
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000402table OutputLayer {
403 base:BindableLayerBase;
404}
405
Saoirse Stewart263829c2019-02-19 15:54:14 +0000406table ReshapeLayer {
407 base:LayerBase;
408 descriptor:ReshapeDescriptor;
409}
410
411table ReshapeDescriptor {
412 targetShape:[uint];
413}
414
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000415table PermuteLayer {
416 base:LayerBase;
417 descriptor:PermuteDescriptor;
418}
419
420table PermuteDescriptor {
421 dimMappings:[uint];
422}
423
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000424table SpaceToBatchNdLayer {
425 base:LayerBase;
426 descriptor:SpaceToBatchNdDescriptor;
427}
428
429table SpaceToBatchNdDescriptor {
430 blockShape:[uint];
431 padList:[uint];
432 dataLayout:DataLayout;
433}
434
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100435table SpaceToDepthLayer {
436 base:LayerBase;
437 descriptor:SpaceToDepthDescriptor;
438}
439
440table SpaceToDepthDescriptor {
441 blockSize:uint;
442 dataLayout:DataLayout;
443}
444
Conor Kennedyda1f9752019-03-01 14:37:12 +0000445table SubtractionLayer {
446 base:LayerBase;
447}
448
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000449table BatchToSpaceNdLayer {
450 base:LayerBase;
451 descriptor:BatchToSpaceNdDescriptor;
452}
453
454table BatchToSpaceNdDescriptor {
455 blockShape:[uint];
456 crops:[uint];
457 dataLayout:DataLayout;
458}
459
Nina Drozd57728782019-02-27 10:53:27 +0000460enum NormalizationAlgorithmChannel : byte {
461 Across = 0,
462 Within = 1
463}
464
465enum NormalizationAlgorithmMethod : byte {
466 LocalBrightness = 0,
467 LocalContrast = 1
468}
469
470table NormalizationLayer {
471 base:LayerBase;
472 descriptor:NormalizationDescriptor;
473}
474
475table NormalizationDescriptor {
476 normChannelType:NormalizationAlgorithmChannel = Across;
477 normMethodType:NormalizationAlgorithmMethod = LocalBrightness;
478 normSize:uint;
479 alpha:float;
480 beta:float;
481 k:float;
482 dataLayout:DataLayout = NCHW;
483}
484
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000485table MeanLayer {
486 base:LayerBase;
487 descriptor:MeanDescriptor;
488}
489
490table MeanDescriptor {
491 axis:[uint];
492 keepDims:bool = false;
493}
494
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000495table PadLayer {
496 base:LayerBase;
497 descriptor:PadDescriptor;
498}
499
500table PadDescriptor {
501 padList:[uint];
David Monahan34757812019-06-19 11:47:21 +0100502 padValue:float = 0;
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000503}
504
Sadik Armagan8b42a382019-03-01 14:24:49 +0000505table RsqrtLayer {
506 base:LayerBase;
507}
508
ruoyan018e7fa232019-02-28 15:09:07 +0000509table BatchNormalizationLayer {
510 base:LayerBase;
511 descriptor:BatchNormalizationDescriptor;
512 mean:ConstTensor;
513 variance:ConstTensor;
514 beta:ConstTensor;
515 gamma:ConstTensor;
516}
517
518table BatchNormalizationDescriptor {
519 eps:float;
520 dataLayout:DataLayout;
521}
522
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100523/// @deprecated Use ResizeLayer instead
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000524table ResizeBilinearLayer {
525 base:LayerBase;
526 descriptor:ResizeBilinearDescriptor;
527}
528
529table ResizeBilinearDescriptor {
530 targetWidth:uint;
531 targetHeight:uint;
532 dataLayout:DataLayout;
533}
534
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100535table SliceLayer {
536 base:LayerBase;
537 descriptor:SliceDescriptor;
538}
539
540table SliceDescriptor {
541 begin:[uint];
542 size:[uint];
543}
544
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000545table StridedSliceLayer {
546 base:LayerBase;
547 descriptor:StridedSliceDescriptor;
548}
549
550table StridedSliceDescriptor {
551 begin:[int];
552 end:[int];
553 stride:[int];
554 beginMask:int;
555 endMask:int;
556 shrinkAxisMask:int;
557 ellipsisMask:int;
558 newAxisMask:int;
559 dataLayout:DataLayout;
560}
561
Jim Flynne242f2d2019-05-22 14:24:13 +0100562table ConcatLayer {
563 base:LayerBase;
564 descriptor:OriginsDescriptor;
565}
566
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100567/// @deprecated Use ConcatLayer instead
Jim Flynnac25a1b2019-02-28 10:40:49 +0000568table MergerLayer {
569 base:LayerBase;
570 descriptor:OriginsDescriptor;
571}
572
573table UintVector {
574 data:[uint];
575}
576
577table OriginsDescriptor {
578 concatAxis:uint;
579 numViews:uint;
580 numDimensions:uint;
581 viewOrigins:[UintVector];
582}
583
Jim Flynn18ce3382019-03-08 11:08:30 +0000584table ViewsDescriptor {
585 origins:OriginsDescriptor;
586 viewSizes:[UintVector];
587}
588
589table SplitterLayer {
590 base:LayerBase;
591 descriptor:ViewsDescriptor;
592}
593
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000594table DetectionPostProcessLayer {
595 base:LayerBase;
596 descriptor:DetectionPostProcessDescriptor;
597 anchors:ConstTensor;
598}
599
600table DetectionPostProcessDescriptor {
601 maxDetections:uint;
602 maxClassesPerDetection:uint;
603 detectionsPerClass:uint;
604 nmsScoreThreshold:float;
605 nmsIouThreshold:float;
606 numClasses:uint;
607 useRegularNms:bool;
608 scaleX:float;
609 scaleY:float;
610 scaleW:float;
611 scaleH:float;
612}
613
Jim Flynn11af3752019-03-19 17:22:29 +0000614table LstmInputParams {
615 inputToForgetWeights:ConstTensor;
616 inputToCellWeights:ConstTensor;
617 inputToOutputWeights:ConstTensor;
618 recurrentToForgetWeights:ConstTensor;
619 recurrentToCellWeights:ConstTensor;
620 recurrentToOutputWeights:ConstTensor;
621 forgetGateBias:ConstTensor;
622 cellBias:ConstTensor;
623 outputGateBias:ConstTensor;
624
625 inputToInputWeights:ConstTensor;
626 recurrentToInputWeights:ConstTensor;
627 cellToInputWeights:ConstTensor;
628 inputGateBias:ConstTensor;
629
630 projectionWeights:ConstTensor;
631 projectionBias:ConstTensor;
632
633 cellToForgetWeights:ConstTensor;
634 cellToOutputWeights:ConstTensor;
Jan Eilersf8c62972019-07-17 11:07:49 +0100635
636 inputLayerNormWeights:ConstTensor;
637 forgetLayerNormWeights:ConstTensor;
638 cellLayerNormWeights:ConstTensor;
639 outputLayerNormWeights:ConstTensor;
Jim Flynn11af3752019-03-19 17:22:29 +0000640}
641
Jan Eilers5b01a892019-07-23 09:47:43 +0100642table QuantizedLstmInputParams {
643 inputToInputWeights:ConstTensor;
644 inputToForgetWeights:ConstTensor;
645 inputToCellWeights:ConstTensor;
646 inputToOutputWeights:ConstTensor;
647
648 recurrentToInputWeights:ConstTensor;
649 recurrentToForgetWeights:ConstTensor;
650 recurrentToCellWeights:ConstTensor;
651 recurrentToOutputWeights:ConstTensor;
652
653 inputGateBias:ConstTensor;
654 forgetGateBias:ConstTensor;
655 cellBias:ConstTensor;
656 outputGateBias:ConstTensor;
657}
658
Jim Flynn11af3752019-03-19 17:22:29 +0000659table LstmDescriptor {
660 activationFunc:uint;
661 clippingThresCell:float;
662 clippingThresProj:float;
663 cifgEnabled:bool = true;
664 peepholeEnabled:bool = false;
665 projectionEnabled:bool = false;
Jan Eilersf8c62972019-07-17 11:07:49 +0100666 layerNormEnabled:bool = false;
Jim Flynn11af3752019-03-19 17:22:29 +0000667}
668
669table LstmLayer {
670 base:LayerBase;
671 descriptor:LstmDescriptor;
672 inputParams:LstmInputParams;
673}
674
Jan Eilers5b01a892019-07-23 09:47:43 +0100675table QuantizedLstmLayer {
676 base:LayerBase;
677 inputParams:QuantizedLstmInputParams;
678}
679
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000680table DequantizeLayer {
681 base:LayerBase;
682}
683
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100684table MergeLayer {
685 base:LayerBase;
686}
687
Sadik Armaganeff363d2019-04-05 15:25:46 +0100688table SwitchLayer {
689 base:LayerBase;
690}
691
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100692table PreluLayer {
693 base:LayerBase;
694}
695
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100696table TransposeConvolution2dLayer {
697 base:LayerBase;
698 descriptor:TransposeConvolution2dDescriptor;
699 weights:ConstTensor;
700 biases:ConstTensor;
701}
702
703table TransposeConvolution2dDescriptor {
704 padLeft:uint;
705 padRight:uint;
706 padTop:uint;
707 padBottom:uint;
708 strideX:uint;
709 strideY:uint;
710 biasEnabled:bool = false;
711 dataLayout:DataLayout = NCHW;
712}
713
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100714table ResizeLayer {
715 base:LayerBase;
716 descriptor:ResizeDescriptor;
717}
718
719table ResizeDescriptor {
720 targetHeight:uint;
721 targetWidth:uint;
722 method:ResizeMethod = NearestNeighbor;
723 dataLayout:DataLayout;
724}
725
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100726table StackLayer {
727 base:LayerBase;
728 descriptor:StackDescriptor;
729}
730
731table StackDescriptor {
732 axis:uint;
733 numInputs:uint;
734 inputShape:[uint];
735}
736
Aron Virginas-Tar85121a22019-10-23 10:41:35 +0100737table StandInDescriptor {
738 numInputs:uint;
739 numOutputs:uint;
740}
741
742table StandInLayer {
743 base:LayerBase;
744 descriptor:StandInDescriptor;
745}
746
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000747union Layer {
Mike Kellyaf484012019-02-20 16:53:11 +0000748 ActivationLayer,
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000749 AdditionLayer,
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000750 BatchToSpaceNdLayer,
ruoyan018e7fa232019-02-28 15:09:07 +0000751 BatchNormalizationLayer,
Conor Kennedy76277882019-02-26 08:29:54 +0000752 ConstantLayer,
Mike Kellya0766c32019-02-19 17:22:07 +0000753 Convolution2dLayer,
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000754 DepthwiseConvolution2dLayer,
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000755 FullyConnectedLayer,
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000756 InputLayer,
Sadik Armagan5f450272019-02-12 14:31:45 +0000757 MultiplicationLayer,
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000758 OutputLayer,
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000759 PermuteLayer,
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000760 Pooling2dLayer,
Saoirse Stewart263829c2019-02-19 15:54:14 +0000761 ReshapeLayer,
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000762 SoftmaxLayer,
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000763 SpaceToBatchNdLayer,
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000764 DivisionLayer,
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000765 MinimumLayer,
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000766 EqualLayer,
Nina Drozd57728782019-02-27 10:53:27 +0000767 MaximumLayer,
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000768 NormalizationLayer,
Sadik Armagan8b42a382019-03-01 14:24:49 +0000769 PadLayer,
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000770 RsqrtLayer,
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000771 FloorLayer,
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000772 GreaterLayer,
Conor Kennedyda1f9752019-03-01 14:37:12 +0000773 ResizeBilinearLayer,
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000774 SubtractionLayer,
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000775 StridedSliceLayer,
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000776 GatherLayer,
Jim Flynnac25a1b2019-02-28 10:40:49 +0000777 MeanLayer,
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000778 MergerLayer,
Jim Flynn18ce3382019-03-08 11:08:30 +0000779 L2NormalizationLayer,
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000780 SplitterLayer,
Jim Flynn11af3752019-03-19 17:22:29 +0000781 DetectionPostProcessLayer,
Derek Lamberti87acb272019-03-27 16:51:31 +0000782 LstmLayer,
Jan Eilers5b01a892019-07-23 09:47:43 +0100783 QuantizedLstmLayer,
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000784 QuantizeLayer,
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100785 DequantizeLayer,
Sadik Armaganeff363d2019-04-05 15:25:46 +0100786 MergeLayer,
Jim Flynne242f2d2019-05-22 14:24:13 +0100787 SwitchLayer,
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100788 ConcatLayer,
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100789 SpaceToDepthLayer,
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100790 PreluLayer,
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100791 TransposeConvolution2dLayer,
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100792 ResizeLayer,
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100793 StackLayer,
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100794 AbsLayer,
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100795 ArgMinMaxLayer,
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100796 SliceLayer,
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100797 DepthToSpaceLayer,
Sadik Armagan26257852019-10-14 13:00:47 +0100798 InstanceNormalizationLayer,
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100799 LogSoftmaxLayer,
Aron Virginas-Tar85121a22019-10-23 10:41:35 +0100800 ComparisonLayer,
801 StandInLayer
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000802}
803
Saoirse Stewart49dbe0e2019-02-05 17:27:06 +0000804table AnyLayer {
805 layer:Layer;
806}
807
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000808// Root type for serialized data is the graph of the network
809table SerializedGraph {
Saoirse Stewart49dbe0e2019-02-05 17:27:06 +0000810 layers:[AnyLayer];
Mike Kelly8c1701a2019-02-11 17:01:27 +0000811 inputIds:[uint];
812 outputIds:[uint];
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000813}
814
815root_type SerializedGraph;