blob: 7588b9d11e5998e530efb92e05e19189cbfaab96 [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,
145 InstanceNormalization = 50
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000146}
147
148// Base layer table to be used as part of other layers
149table LayerBase {
150 index:uint;
151 layerName:string;
152 layerType:LayerType;
153 inputSlots:[InputSlot];
154 outputSlots:[OutputSlot];
155}
156
157table BindableLayerBase {
158 base:LayerBase;
159 layerBindingId:int;
160}
161
162// Table for each layer defined below
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100163
164table AbsLayer {
165 base:LayerBase;
166}
167
Mike Kellyaf484012019-02-20 16:53:11 +0000168table ActivationLayer {
169 base:LayerBase;
170 descriptor:ActivationDescriptor;
171}
172
173table ActivationDescriptor {
Tee Jung86bc3d82019-10-01 11:25:56 +0900174 activationFunction:ActivationFunction = Sigmoid;
Mike Kellyaf484012019-02-20 16:53:11 +0000175 a:float;
176 b:float;
177}
178
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000179table AdditionLayer {
180 base:LayerBase;
181}
182
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100183table ArgMinMaxLayer {
184 base:LayerBase;
185 descriptor:ArgMinMaxDescriptor;
186}
187
188table ArgMinMaxDescriptor{
Tee Jung86bc3d82019-10-01 11:25:56 +0900189 argMinMaxFunction:ArgMinMaxFunction;
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100190 axis:int;
191}
192
Conor Kennedy76277882019-02-26 08:29:54 +0000193table ConstantLayer {
194 base:LayerBase;
195 input:ConstTensor;
196}
197
Mike Kellya0766c32019-02-19 17:22:07 +0000198table Convolution2dLayer {
199 base:LayerBase;
200 descriptor:Convolution2dDescriptor;
201 weights:ConstTensor;
202 biases:ConstTensor;
203}
204
205table Convolution2dDescriptor {
206 padLeft:uint;
207 padRight:uint;
208 padTop:uint;
209 padBottom:uint;
210 strideX:uint;
211 strideY:uint;
Matthew Benthamacad04e2019-05-13 10:02:45 +0100212 dilationX:uint = 1;
213 dilationY:uint = 1;
Mike Kellya0766c32019-02-19 17:22:07 +0000214 biasEnabled:bool = false;
215 dataLayout:DataLayout = NCHW;
216}
217
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100218table DepthToSpaceLayer {
219 base:LayerBase;
220 descriptor:DepthToSpaceDescriptor;
221}
222
223table DepthToSpaceDescriptor {
224 blockSize:uint;
225 dataLayout:DataLayout;
226}
227
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000228table DivisionLayer {
229 base:LayerBase;
230}
231
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000232table EqualLayer {
233 base:LayerBase;
234}
235
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000236table FloorLayer{
237 base:LayerBase;
238}
239
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000240table FullyConnectedLayer {
241 base:LayerBase;
242 descriptor:FullyConnectedDescriptor;
243 weights:ConstTensor;
244 biases:ConstTensor;
245}
246
247table FullyConnectedDescriptor {
248 biasEnabled:bool = false;
249 transposeWeightsMatrix:bool = false;
250}
251
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000252table GatherLayer {
253 base:LayerBase;
254}
255
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000256table GreaterLayer {
257 base:LayerBase;
258}
259
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000260table InputLayer {
261 base:BindableLayerBase;
262}
263
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100264table InstanceNormalizationLayer {
265 base:LayerBase;
266 descriptor:InstanceNormalizationDescriptor;
267}
268
269table InstanceNormalizationDescriptor {
270 gamma:float;
271 beta:float;
272 eps:float;
273 dataLayout:DataLayout;
274}
275
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000276table L2NormalizationLayer {
277 base:LayerBase;
278 descriptor:L2NormalizationDescriptor;
279}
280
281table L2NormalizationDescriptor {
282 dataLayout:DataLayout = NCHW;
Ferran Balaguer0dcffec2019-06-18 16:25:06 +0100283 eps:float = 1e-12;
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000284}
285
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000286table MinimumLayer {
287 base:LayerBase;
288}
289
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000290table MaximumLayer {
291 base:LayerBase;
292}
293
Sadik Armagan5f450272019-02-12 14:31:45 +0000294table MultiplicationLayer {
295 base:LayerBase;
296}
297
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000298table Pooling2dLayer {
299 base:LayerBase;
300 descriptor:Pooling2dDescriptor;
301}
302
303enum PoolingAlgorithm : byte {
304 Max = 0,
305 Average = 1,
306 L2 = 2
307}
308
309enum OutputShapeRounding : byte {
310 Floor = 0,
311 Ceiling = 1
312}
313
314enum PaddingMethod : byte {
315 IgnoreValue = 0,
316 Exclude = 1
317}
318
319table Pooling2dDescriptor {
320 poolType:PoolingAlgorithm;
321 padLeft:uint;
322 padRight:uint;
323 padTop:uint;
324 padBottom:uint;
325 poolWidth:uint;
326 poolHeight:uint;
327 strideX:uint;
328 strideY:uint;
329 outputShapeRounding:OutputShapeRounding;
330 paddingMethod:PaddingMethod;
331 dataLayout:DataLayout;
332}
333
Derek Lamberti87acb272019-03-27 16:51:31 +0000334table QuantizeLayer {
335 base:LayerBase;
336}
337
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000338table SoftmaxLayer {
339 base:LayerBase;
340 descriptor:SoftmaxDescriptor;
341}
342
343table SoftmaxDescriptor {
344 beta:float;
345}
346
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000347table DepthwiseConvolution2dLayer {
348 base:LayerBase;
349 descriptor:DepthwiseConvolution2dDescriptor;
350 weights:ConstTensor;
351 biases:ConstTensor;
352}
353
354table DepthwiseConvolution2dDescriptor {
355 padLeft:uint;
356 padRight:uint;
357 padTop:uint;
358 padBottom:uint;
359 strideX:uint;
360 strideY:uint;
Matthew Benthamacad04e2019-05-13 10:02:45 +0100361 dilationX:uint = 1;
362 dilationY:uint = 1;
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000363 biasEnabled:bool = false;
364 dataLayout:DataLayout = NCHW;
365}
366
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000367table OutputLayer {
368 base:BindableLayerBase;
369}
370
Saoirse Stewart263829c2019-02-19 15:54:14 +0000371table ReshapeLayer {
372 base:LayerBase;
373 descriptor:ReshapeDescriptor;
374}
375
376table ReshapeDescriptor {
377 targetShape:[uint];
378}
379
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000380table PermuteLayer {
381 base:LayerBase;
382 descriptor:PermuteDescriptor;
383}
384
385table PermuteDescriptor {
386 dimMappings:[uint];
387}
388
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000389table SpaceToBatchNdLayer {
390 base:LayerBase;
391 descriptor:SpaceToBatchNdDescriptor;
392}
393
394table SpaceToBatchNdDescriptor {
395 blockShape:[uint];
396 padList:[uint];
397 dataLayout:DataLayout;
398}
399
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100400table SpaceToDepthLayer {
401 base:LayerBase;
402 descriptor:SpaceToDepthDescriptor;
403}
404
405table SpaceToDepthDescriptor {
406 blockSize:uint;
407 dataLayout:DataLayout;
408}
409
Conor Kennedyda1f9752019-03-01 14:37:12 +0000410table SubtractionLayer {
411 base:LayerBase;
412}
413
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000414table BatchToSpaceNdLayer {
415 base:LayerBase;
416 descriptor:BatchToSpaceNdDescriptor;
417}
418
419table BatchToSpaceNdDescriptor {
420 blockShape:[uint];
421 crops:[uint];
422 dataLayout:DataLayout;
423}
424
Nina Drozd57728782019-02-27 10:53:27 +0000425enum NormalizationAlgorithmChannel : byte {
426 Across = 0,
427 Within = 1
428}
429
430enum NormalizationAlgorithmMethod : byte {
431 LocalBrightness = 0,
432 LocalContrast = 1
433}
434
435table NormalizationLayer {
436 base:LayerBase;
437 descriptor:NormalizationDescriptor;
438}
439
440table NormalizationDescriptor {
441 normChannelType:NormalizationAlgorithmChannel = Across;
442 normMethodType:NormalizationAlgorithmMethod = LocalBrightness;
443 normSize:uint;
444 alpha:float;
445 beta:float;
446 k:float;
447 dataLayout:DataLayout = NCHW;
448}
449
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000450table MeanLayer {
451 base:LayerBase;
452 descriptor:MeanDescriptor;
453}
454
455table MeanDescriptor {
456 axis:[uint];
457 keepDims:bool = false;
458}
459
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000460table PadLayer {
461 base:LayerBase;
462 descriptor:PadDescriptor;
463}
464
465table PadDescriptor {
466 padList:[uint];
David Monahan34757812019-06-19 11:47:21 +0100467 padValue:float = 0;
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000468}
469
Sadik Armagan8b42a382019-03-01 14:24:49 +0000470table RsqrtLayer {
471 base:LayerBase;
472}
473
ruoyan018e7fa232019-02-28 15:09:07 +0000474table BatchNormalizationLayer {
475 base:LayerBase;
476 descriptor:BatchNormalizationDescriptor;
477 mean:ConstTensor;
478 variance:ConstTensor;
479 beta:ConstTensor;
480 gamma:ConstTensor;
481}
482
483table BatchNormalizationDescriptor {
484 eps:float;
485 dataLayout:DataLayout;
486}
487
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000488table ResizeBilinearLayer {
489 base:LayerBase;
490 descriptor:ResizeBilinearDescriptor;
491}
492
493table ResizeBilinearDescriptor {
494 targetWidth:uint;
495 targetHeight:uint;
496 dataLayout:DataLayout;
497}
498
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100499table SliceLayer {
500 base:LayerBase;
501 descriptor:SliceDescriptor;
502}
503
504table SliceDescriptor {
505 begin:[uint];
506 size:[uint];
507}
508
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000509table StridedSliceLayer {
510 base:LayerBase;
511 descriptor:StridedSliceDescriptor;
512}
513
514table StridedSliceDescriptor {
515 begin:[int];
516 end:[int];
517 stride:[int];
518 beginMask:int;
519 endMask:int;
520 shrinkAxisMask:int;
521 ellipsisMask:int;
522 newAxisMask:int;
523 dataLayout:DataLayout;
524}
525
Jim Flynne242f2d2019-05-22 14:24:13 +0100526table ConcatLayer {
527 base:LayerBase;
528 descriptor:OriginsDescriptor;
529}
530
Jim Flynnac25a1b2019-02-28 10:40:49 +0000531table MergerLayer {
532 base:LayerBase;
533 descriptor:OriginsDescriptor;
534}
535
536table UintVector {
537 data:[uint];
538}
539
540table OriginsDescriptor {
541 concatAxis:uint;
542 numViews:uint;
543 numDimensions:uint;
544 viewOrigins:[UintVector];
545}
546
Jim Flynn18ce3382019-03-08 11:08:30 +0000547table ViewsDescriptor {
548 origins:OriginsDescriptor;
549 viewSizes:[UintVector];
550}
551
552table SplitterLayer {
553 base:LayerBase;
554 descriptor:ViewsDescriptor;
555}
556
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000557table DetectionPostProcessLayer {
558 base:LayerBase;
559 descriptor:DetectionPostProcessDescriptor;
560 anchors:ConstTensor;
561}
562
563table DetectionPostProcessDescriptor {
564 maxDetections:uint;
565 maxClassesPerDetection:uint;
566 detectionsPerClass:uint;
567 nmsScoreThreshold:float;
568 nmsIouThreshold:float;
569 numClasses:uint;
570 useRegularNms:bool;
571 scaleX:float;
572 scaleY:float;
573 scaleW:float;
574 scaleH:float;
575}
576
Jim Flynn11af3752019-03-19 17:22:29 +0000577table LstmInputParams {
578 inputToForgetWeights:ConstTensor;
579 inputToCellWeights:ConstTensor;
580 inputToOutputWeights:ConstTensor;
581 recurrentToForgetWeights:ConstTensor;
582 recurrentToCellWeights:ConstTensor;
583 recurrentToOutputWeights:ConstTensor;
584 forgetGateBias:ConstTensor;
585 cellBias:ConstTensor;
586 outputGateBias:ConstTensor;
587
588 inputToInputWeights:ConstTensor;
589 recurrentToInputWeights:ConstTensor;
590 cellToInputWeights:ConstTensor;
591 inputGateBias:ConstTensor;
592
593 projectionWeights:ConstTensor;
594 projectionBias:ConstTensor;
595
596 cellToForgetWeights:ConstTensor;
597 cellToOutputWeights:ConstTensor;
Jan Eilersf8c62972019-07-17 11:07:49 +0100598
599 inputLayerNormWeights:ConstTensor;
600 forgetLayerNormWeights:ConstTensor;
601 cellLayerNormWeights:ConstTensor;
602 outputLayerNormWeights:ConstTensor;
Jim Flynn11af3752019-03-19 17:22:29 +0000603}
604
Jan Eilers5b01a892019-07-23 09:47:43 +0100605table QuantizedLstmInputParams {
606 inputToInputWeights:ConstTensor;
607 inputToForgetWeights:ConstTensor;
608 inputToCellWeights:ConstTensor;
609 inputToOutputWeights:ConstTensor;
610
611 recurrentToInputWeights:ConstTensor;
612 recurrentToForgetWeights:ConstTensor;
613 recurrentToCellWeights:ConstTensor;
614 recurrentToOutputWeights:ConstTensor;
615
616 inputGateBias:ConstTensor;
617 forgetGateBias:ConstTensor;
618 cellBias:ConstTensor;
619 outputGateBias:ConstTensor;
620}
621
Jim Flynn11af3752019-03-19 17:22:29 +0000622table LstmDescriptor {
623 activationFunc:uint;
624 clippingThresCell:float;
625 clippingThresProj:float;
626 cifgEnabled:bool = true;
627 peepholeEnabled:bool = false;
628 projectionEnabled:bool = false;
Jan Eilersf8c62972019-07-17 11:07:49 +0100629 layerNormEnabled:bool = false;
Jim Flynn11af3752019-03-19 17:22:29 +0000630}
631
632table LstmLayer {
633 base:LayerBase;
634 descriptor:LstmDescriptor;
635 inputParams:LstmInputParams;
636}
637
Jan Eilers5b01a892019-07-23 09:47:43 +0100638table QuantizedLstmLayer {
639 base:LayerBase;
640 inputParams:QuantizedLstmInputParams;
641}
642
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000643table DequantizeLayer {
644 base:LayerBase;
645}
646
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100647table MergeLayer {
648 base:LayerBase;
649}
650
Sadik Armaganeff363d2019-04-05 15:25:46 +0100651table SwitchLayer {
652 base:LayerBase;
653}
654
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100655table PreluLayer {
656 base:LayerBase;
657}
658
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100659table TransposeConvolution2dLayer {
660 base:LayerBase;
661 descriptor:TransposeConvolution2dDescriptor;
662 weights:ConstTensor;
663 biases:ConstTensor;
664}
665
666table TransposeConvolution2dDescriptor {
667 padLeft:uint;
668 padRight:uint;
669 padTop:uint;
670 padBottom:uint;
671 strideX:uint;
672 strideY:uint;
673 biasEnabled:bool = false;
674 dataLayout:DataLayout = NCHW;
675}
676
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100677table ResizeLayer {
678 base:LayerBase;
679 descriptor:ResizeDescriptor;
680}
681
682table ResizeDescriptor {
683 targetHeight:uint;
684 targetWidth:uint;
685 method:ResizeMethod = NearestNeighbor;
686 dataLayout:DataLayout;
687}
688
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100689table StackLayer {
690 base:LayerBase;
691 descriptor:StackDescriptor;
692}
693
694table StackDescriptor {
695 axis:uint;
696 numInputs:uint;
697 inputShape:[uint];
698}
699
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000700union Layer {
Mike Kellyaf484012019-02-20 16:53:11 +0000701 ActivationLayer,
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000702 AdditionLayer,
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000703 BatchToSpaceNdLayer,
ruoyan018e7fa232019-02-28 15:09:07 +0000704 BatchNormalizationLayer,
Conor Kennedy76277882019-02-26 08:29:54 +0000705 ConstantLayer,
Mike Kellya0766c32019-02-19 17:22:07 +0000706 Convolution2dLayer,
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000707 DepthwiseConvolution2dLayer,
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000708 FullyConnectedLayer,
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000709 InputLayer,
Sadik Armagan5f450272019-02-12 14:31:45 +0000710 MultiplicationLayer,
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000711 OutputLayer,
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000712 PermuteLayer,
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000713 Pooling2dLayer,
Saoirse Stewart263829c2019-02-19 15:54:14 +0000714 ReshapeLayer,
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000715 SoftmaxLayer,
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000716 SpaceToBatchNdLayer,
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000717 DivisionLayer,
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000718 MinimumLayer,
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000719 EqualLayer,
Nina Drozd57728782019-02-27 10:53:27 +0000720 MaximumLayer,
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000721 NormalizationLayer,
Sadik Armagan8b42a382019-03-01 14:24:49 +0000722 PadLayer,
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000723 RsqrtLayer,
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000724 FloorLayer,
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000725 GreaterLayer,
Conor Kennedyda1f9752019-03-01 14:37:12 +0000726 ResizeBilinearLayer,
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000727 SubtractionLayer,
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000728 StridedSliceLayer,
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000729 GatherLayer,
Jim Flynnac25a1b2019-02-28 10:40:49 +0000730 MeanLayer,
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000731 MergerLayer,
Jim Flynn18ce3382019-03-08 11:08:30 +0000732 L2NormalizationLayer,
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000733 SplitterLayer,
Jim Flynn11af3752019-03-19 17:22:29 +0000734 DetectionPostProcessLayer,
Derek Lamberti87acb272019-03-27 16:51:31 +0000735 LstmLayer,
Jan Eilers5b01a892019-07-23 09:47:43 +0100736 QuantizedLstmLayer,
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000737 QuantizeLayer,
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100738 DequantizeLayer,
Sadik Armaganeff363d2019-04-05 15:25:46 +0100739 MergeLayer,
Jim Flynne242f2d2019-05-22 14:24:13 +0100740 SwitchLayer,
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100741 ConcatLayer,
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100742 SpaceToDepthLayer,
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100743 PreluLayer,
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100744 TransposeConvolution2dLayer,
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100745 ResizeLayer,
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100746 StackLayer,
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100747 AbsLayer,
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100748 ArgMinMaxLayer,
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100749 SliceLayer,
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100750 DepthToSpaceLayer,
751 InstanceNormalizationLayer
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000752}
753
Saoirse Stewart49dbe0e2019-02-05 17:27:06 +0000754table AnyLayer {
755 layer:Layer;
756}
757
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000758// Root type for serialized data is the graph of the network
759table SerializedGraph {
Saoirse Stewart49dbe0e2019-02-05 17:27:06 +0000760 layers:[AnyLayer];
Mike Kelly8c1701a2019-02-11 17:01:27 +0000761 inputIds:[uint];
762 outputIds:[uint];
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000763}
764
765root_type SerializedGraph;