blob: ca3db5d5421e0e74a84d7fdfbfc6c52ef950326b [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,
41 QAsymmS8 = 8
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +000042}
43
Saoirse Stewart3166c3e2019-02-18 15:24:53 +000044enum DataLayout : byte {
45 NHWC = 0,
46 NCHW = 1
47}
48
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +010049enum ResizeMethod: byte {
50 NearestNeighbor = 0,
51 Bilinear = 1,
52}
53
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +000054table TensorInfo {
55 dimensions:[uint];
56 dataType:DataType;
57 quantizationScale:float = 1.0;
58 quantizationOffset:int = 0;
59}
60
61struct Connection {
62 sourceLayerIndex:uint;
63 outputSlotIndex:uint;
64}
65
66table ByteData {
67 data:[byte];
68}
69
70table ShortData {
71 data:[short];
72}
73
74table IntData {
75 data:[int];
76}
77
78table LongData {
79 data:[long];
80}
81
82union ConstTensorData { ByteData, ShortData, IntData, LongData }
83
84table ConstTensor {
85 info:TensorInfo;
86 data:ConstTensorData;
87}
88
89table InputSlot {
90 index:uint;
91 connection:Connection;
92}
93
94table OutputSlot {
95 index:uint;
96 tensorInfo:TensorInfo;
97}
98
99enum LayerType : uint {
100 Addition = 0,
101 Input = 1,
Sadik Armagan5f450272019-02-12 14:31:45 +0000102 Multiplication = 2,
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000103 Output = 3,
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000104 Pooling2d = 4,
Saoirse Stewart263829c2019-02-19 15:54:14 +0000105 Reshape = 5,
Mike Kellya0766c32019-02-19 17:22:07 +0000106 Softmax = 6,
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000107 Convolution2d = 7,
Mike Kellyaf484012019-02-20 16:53:11 +0000108 DepthwiseConvolution2d = 8,
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000109 Activation = 9,
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000110 Permute = 10,
Conor Kennedy76277882019-02-26 08:29:54 +0000111 FullyConnected = 11,
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000112 Constant = 12,
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000113 SpaceToBatchNd = 13,
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000114 BatchToSpaceNd = 14,
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000115 Division = 15,
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000116 Minimum = 16,
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000117 Equal = 17,
Nina Drozd57728782019-02-27 10:53:27 +0000118 Maximum = 18,
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000119 Normalization = 19,
Sadik Armagan8b42a382019-03-01 14:24:49 +0000120 Pad = 20,
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000121 Rsqrt = 21,
ruoyan018e7fa232019-02-28 15:09:07 +0000122 Floor = 22,
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000123 BatchNormalization = 23,
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000124 Greater = 24,
Conor Kennedyda1f9752019-03-01 14:37:12 +0000125 ResizeBilinear = 25,
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000126 Subtraction = 26,
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000127 StridedSlice = 27,
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000128 Gather = 28,
Jim Flynnac25a1b2019-02-28 10:40:49 +0000129 Mean = 29,
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000130 Merger = 30,
Jim Flynn18ce3382019-03-08 11:08:30 +0000131 L2Normalization = 31,
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000132 Splitter = 32,
Jim Flynn11af3752019-03-19 17:22:29 +0000133 DetectionPostProcess = 33,
Derek Lamberti87acb272019-03-27 16:51:31 +0000134 Lstm = 34,
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000135 Quantize = 35,
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100136 Dequantize = 36,
Sadik Armaganeff363d2019-04-05 15:25:46 +0100137 Merge = 37,
Jim Flynne242f2d2019-05-22 14:24:13 +0100138 Switch = 38,
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100139 Concat = 39,
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100140 SpaceToDepth = 40,
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100141 Prelu = 41,
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100142 TransposeConvolution2d = 42,
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100143 Resize = 43,
Jan Eilers5b01a892019-07-23 09:47:43 +0100144 Stack = 44,
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100145 QuantizedLstm = 45,
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100146 Abs = 46,
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100147 ArgMinMax = 47,
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100148 Slice = 48,
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100149 DepthToSpace = 49,
Sadik Armagan26257852019-10-14 13:00:47 +0100150 InstanceNormalization = 50,
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100151 LogSoftmax = 51,
Aron Virginas-Tar85121a22019-10-23 10:41:35 +0100152 Comparison = 52,
josh minor4a3c6102020-01-06 16:40:46 -0600153 StandIn = 53,
Mike Kellyc9ea45a2020-02-28 18:11:58 +0000154 ElementwiseUnary = 54,
155 Transpose = 55
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000156}
157
158// Base layer table to be used as part of other layers
159table LayerBase {
160 index:uint;
161 layerName:string;
162 layerType:LayerType;
163 inputSlots:[InputSlot];
164 outputSlots:[OutputSlot];
165}
166
167table BindableLayerBase {
168 base:LayerBase;
169 layerBindingId:int;
170}
171
172// Table for each layer defined below
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100173
josh minor4a3c6102020-01-06 16:40:46 -0600174/// @deprecated Use ElementwiseUnaryLayer instead
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100175table AbsLayer {
176 base:LayerBase;
177}
178
Mike Kellyaf484012019-02-20 16:53:11 +0000179table ActivationLayer {
180 base:LayerBase;
181 descriptor:ActivationDescriptor;
182}
183
184table ActivationDescriptor {
Tee Jung86bc3d82019-10-01 11:25:56 +0900185 activationFunction:ActivationFunction = Sigmoid;
Mike Kellyaf484012019-02-20 16:53:11 +0000186 a:float;
187 b:float;
188}
189
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000190table AdditionLayer {
191 base:LayerBase;
192}
193
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100194table ArgMinMaxLayer {
195 base:LayerBase;
196 descriptor:ArgMinMaxDescriptor;
197}
198
199table ArgMinMaxDescriptor{
Tee Jung86bc3d82019-10-01 11:25:56 +0900200 argMinMaxFunction:ArgMinMaxFunction;
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100201 axis:int;
202}
203
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100204enum ComparisonOperation : byte {
205 Equal = 0,
206 Greater = 1,
207 GreaterOrEqual = 2,
208 Less = 3,
209 LessOrEqual = 4,
210 NotEqual = 5
211}
212
213table ComparisonDescriptor {
214 operation:ComparisonOperation;
215}
216
217table ComparisonLayer {
218 base:LayerBase;
219 descriptor:ComparisonDescriptor;
220}
221
Conor Kennedy76277882019-02-26 08:29:54 +0000222table ConstantLayer {
223 base:LayerBase;
224 input:ConstTensor;
225}
226
Mike Kellya0766c32019-02-19 17:22:07 +0000227table Convolution2dLayer {
228 base:LayerBase;
229 descriptor:Convolution2dDescriptor;
230 weights:ConstTensor;
231 biases:ConstTensor;
232}
233
234table Convolution2dDescriptor {
235 padLeft:uint;
236 padRight:uint;
237 padTop:uint;
238 padBottom:uint;
239 strideX:uint;
240 strideY:uint;
Matthew Benthamacad04e2019-05-13 10:02:45 +0100241 dilationX:uint = 1;
242 dilationY:uint = 1;
Mike Kellya0766c32019-02-19 17:22:07 +0000243 biasEnabled:bool = false;
244 dataLayout:DataLayout = NCHW;
245}
246
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100247table DepthToSpaceLayer {
248 base:LayerBase;
249 descriptor:DepthToSpaceDescriptor;
250}
251
252table DepthToSpaceDescriptor {
253 blockSize:uint;
254 dataLayout:DataLayout;
255}
256
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000257table DivisionLayer {
258 base:LayerBase;
259}
260
josh minor4a3c6102020-01-06 16:40:46 -0600261enum UnaryOperation : byte {
262 Abs = 0,
263 Rsqrt = 1,
264 Sqrt = 2,
265 Exp = 3,
266 Neg = 4
267}
268
269table ElementwiseUnaryDescriptor {
270 operation:UnaryOperation;
271}
272
273table ElementwiseUnaryLayer {
274 base:LayerBase;
275 descriptor:ElementwiseUnaryDescriptor;
276}
277
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100278/// @deprecated Use ComparisonLayer instead
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000279table EqualLayer {
280 base:LayerBase;
281}
282
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000283table FloorLayer{
284 base:LayerBase;
285}
286
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000287table FullyConnectedLayer {
288 base:LayerBase;
289 descriptor:FullyConnectedDescriptor;
290 weights:ConstTensor;
291 biases:ConstTensor;
292}
293
294table FullyConnectedDescriptor {
295 biasEnabled:bool = false;
296 transposeWeightsMatrix:bool = false;
297}
298
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000299table GatherLayer {
300 base:LayerBase;
301}
302
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100303/// @deprecated Use ComparisonLayer instead
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000304table GreaterLayer {
305 base:LayerBase;
306}
307
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000308table InputLayer {
309 base:BindableLayerBase;
310}
311
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100312table InstanceNormalizationLayer {
313 base:LayerBase;
314 descriptor:InstanceNormalizationDescriptor;
315}
316
317table InstanceNormalizationDescriptor {
318 gamma:float;
319 beta:float;
320 eps:float;
321 dataLayout:DataLayout;
322}
323
Sadik Armagan26257852019-10-14 13:00:47 +0100324table LogSoftmaxLayer {
325 base:LayerBase;
326 descriptor:LogSoftmaxDescriptor;
327}
328
329table LogSoftmaxDescriptor {
330 beta:float = 1;
331 axis:int = -1;
332}
333
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000334table L2NormalizationLayer {
335 base:LayerBase;
336 descriptor:L2NormalizationDescriptor;
337}
338
339table L2NormalizationDescriptor {
340 dataLayout:DataLayout = NCHW;
Ferran Balaguer0dcffec2019-06-18 16:25:06 +0100341 eps:float = 1e-12;
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000342}
343
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000344table MinimumLayer {
345 base:LayerBase;
346}
347
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000348table MaximumLayer {
349 base:LayerBase;
350}
351
Sadik Armagan5f450272019-02-12 14:31:45 +0000352table MultiplicationLayer {
353 base:LayerBase;
354}
355
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000356table Pooling2dLayer {
357 base:LayerBase;
358 descriptor:Pooling2dDescriptor;
359}
360
361enum PoolingAlgorithm : byte {
362 Max = 0,
363 Average = 1,
364 L2 = 2
365}
366
367enum OutputShapeRounding : byte {
368 Floor = 0,
369 Ceiling = 1
370}
371
372enum PaddingMethod : byte {
373 IgnoreValue = 0,
374 Exclude = 1
375}
376
377table Pooling2dDescriptor {
378 poolType:PoolingAlgorithm;
379 padLeft:uint;
380 padRight:uint;
381 padTop:uint;
382 padBottom:uint;
383 poolWidth:uint;
384 poolHeight:uint;
385 strideX:uint;
386 strideY:uint;
387 outputShapeRounding:OutputShapeRounding;
388 paddingMethod:PaddingMethod;
389 dataLayout:DataLayout;
390}
391
Derek Lamberti87acb272019-03-27 16:51:31 +0000392table QuantizeLayer {
393 base:LayerBase;
394}
395
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000396table SoftmaxLayer {
397 base:LayerBase;
398 descriptor:SoftmaxDescriptor;
399}
400
401table SoftmaxDescriptor {
402 beta:float;
403}
404
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000405table DepthwiseConvolution2dLayer {
406 base:LayerBase;
407 descriptor:DepthwiseConvolution2dDescriptor;
408 weights:ConstTensor;
409 biases:ConstTensor;
410}
411
412table DepthwiseConvolution2dDescriptor {
413 padLeft:uint;
414 padRight:uint;
415 padTop:uint;
416 padBottom:uint;
417 strideX:uint;
418 strideY:uint;
Matthew Benthamacad04e2019-05-13 10:02:45 +0100419 dilationX:uint = 1;
420 dilationY:uint = 1;
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000421 biasEnabled:bool = false;
422 dataLayout:DataLayout = NCHW;
423}
424
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000425table OutputLayer {
426 base:BindableLayerBase;
427}
428
Saoirse Stewart263829c2019-02-19 15:54:14 +0000429table ReshapeLayer {
430 base:LayerBase;
431 descriptor:ReshapeDescriptor;
432}
433
434table ReshapeDescriptor {
435 targetShape:[uint];
436}
437
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000438table PermuteLayer {
439 base:LayerBase;
440 descriptor:PermuteDescriptor;
441}
442
443table PermuteDescriptor {
444 dimMappings:[uint];
445}
446
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000447table SpaceToBatchNdLayer {
448 base:LayerBase;
449 descriptor:SpaceToBatchNdDescriptor;
450}
451
452table SpaceToBatchNdDescriptor {
453 blockShape:[uint];
454 padList:[uint];
455 dataLayout:DataLayout;
456}
457
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100458table SpaceToDepthLayer {
459 base:LayerBase;
460 descriptor:SpaceToDepthDescriptor;
461}
462
463table SpaceToDepthDescriptor {
464 blockSize:uint;
465 dataLayout:DataLayout;
466}
467
Conor Kennedyda1f9752019-03-01 14:37:12 +0000468table SubtractionLayer {
469 base:LayerBase;
470}
471
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000472table BatchToSpaceNdLayer {
473 base:LayerBase;
474 descriptor:BatchToSpaceNdDescriptor;
475}
476
477table BatchToSpaceNdDescriptor {
478 blockShape:[uint];
479 crops:[uint];
480 dataLayout:DataLayout;
481}
482
Nina Drozd57728782019-02-27 10:53:27 +0000483enum NormalizationAlgorithmChannel : byte {
484 Across = 0,
485 Within = 1
486}
487
488enum NormalizationAlgorithmMethod : byte {
489 LocalBrightness = 0,
490 LocalContrast = 1
491}
492
493table NormalizationLayer {
494 base:LayerBase;
495 descriptor:NormalizationDescriptor;
496}
497
498table NormalizationDescriptor {
499 normChannelType:NormalizationAlgorithmChannel = Across;
500 normMethodType:NormalizationAlgorithmMethod = LocalBrightness;
501 normSize:uint;
502 alpha:float;
503 beta:float;
504 k:float;
505 dataLayout:DataLayout = NCHW;
506}
507
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000508table MeanLayer {
509 base:LayerBase;
510 descriptor:MeanDescriptor;
511}
512
513table MeanDescriptor {
514 axis:[uint];
515 keepDims:bool = false;
516}
517
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000518table PadLayer {
519 base:LayerBase;
520 descriptor:PadDescriptor;
521}
522
523table PadDescriptor {
524 padList:[uint];
David Monahan34757812019-06-19 11:47:21 +0100525 padValue:float = 0;
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000526}
527
josh minor4a3c6102020-01-06 16:40:46 -0600528/// @deprecated Use ElementwiseUnaryLayer instead
Sadik Armagan8b42a382019-03-01 14:24:49 +0000529table RsqrtLayer {
530 base:LayerBase;
531}
532
ruoyan018e7fa232019-02-28 15:09:07 +0000533table BatchNormalizationLayer {
534 base:LayerBase;
535 descriptor:BatchNormalizationDescriptor;
536 mean:ConstTensor;
537 variance:ConstTensor;
538 beta:ConstTensor;
539 gamma:ConstTensor;
540}
541
542table BatchNormalizationDescriptor {
543 eps:float;
544 dataLayout:DataLayout;
545}
546
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100547/// @deprecated Use ResizeLayer instead
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000548table ResizeBilinearLayer {
549 base:LayerBase;
550 descriptor:ResizeBilinearDescriptor;
551}
552
553table ResizeBilinearDescriptor {
554 targetWidth:uint;
555 targetHeight:uint;
556 dataLayout:DataLayout;
557}
558
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100559table SliceLayer {
560 base:LayerBase;
561 descriptor:SliceDescriptor;
562}
563
564table SliceDescriptor {
565 begin:[uint];
566 size:[uint];
567}
568
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000569table StridedSliceLayer {
570 base:LayerBase;
571 descriptor:StridedSliceDescriptor;
572}
573
574table StridedSliceDescriptor {
575 begin:[int];
576 end:[int];
577 stride:[int];
578 beginMask:int;
579 endMask:int;
580 shrinkAxisMask:int;
581 ellipsisMask:int;
582 newAxisMask:int;
583 dataLayout:DataLayout;
584}
585
Jim Flynne242f2d2019-05-22 14:24:13 +0100586table ConcatLayer {
587 base:LayerBase;
588 descriptor:OriginsDescriptor;
589}
590
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100591/// @deprecated Use ConcatLayer instead
Jim Flynnac25a1b2019-02-28 10:40:49 +0000592table MergerLayer {
593 base:LayerBase;
594 descriptor:OriginsDescriptor;
595}
596
597table UintVector {
598 data:[uint];
599}
600
601table OriginsDescriptor {
602 concatAxis:uint;
603 numViews:uint;
604 numDimensions:uint;
605 viewOrigins:[UintVector];
606}
607
Jim Flynn18ce3382019-03-08 11:08:30 +0000608table ViewsDescriptor {
609 origins:OriginsDescriptor;
610 viewSizes:[UintVector];
611}
612
613table SplitterLayer {
614 base:LayerBase;
615 descriptor:ViewsDescriptor;
616}
617
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000618table DetectionPostProcessLayer {
619 base:LayerBase;
620 descriptor:DetectionPostProcessDescriptor;
621 anchors:ConstTensor;
622}
623
624table DetectionPostProcessDescriptor {
625 maxDetections:uint;
626 maxClassesPerDetection:uint;
627 detectionsPerClass:uint;
628 nmsScoreThreshold:float;
629 nmsIouThreshold:float;
630 numClasses:uint;
631 useRegularNms:bool;
632 scaleX:float;
633 scaleY:float;
634 scaleW:float;
635 scaleH:float;
636}
637
Jim Flynn11af3752019-03-19 17:22:29 +0000638table LstmInputParams {
639 inputToForgetWeights:ConstTensor;
640 inputToCellWeights:ConstTensor;
641 inputToOutputWeights:ConstTensor;
642 recurrentToForgetWeights:ConstTensor;
643 recurrentToCellWeights:ConstTensor;
644 recurrentToOutputWeights:ConstTensor;
645 forgetGateBias:ConstTensor;
646 cellBias:ConstTensor;
647 outputGateBias:ConstTensor;
648
649 inputToInputWeights:ConstTensor;
650 recurrentToInputWeights:ConstTensor;
651 cellToInputWeights:ConstTensor;
652 inputGateBias:ConstTensor;
653
654 projectionWeights:ConstTensor;
655 projectionBias:ConstTensor;
656
657 cellToForgetWeights:ConstTensor;
658 cellToOutputWeights:ConstTensor;
Jan Eilersf8c62972019-07-17 11:07:49 +0100659
660 inputLayerNormWeights:ConstTensor;
661 forgetLayerNormWeights:ConstTensor;
662 cellLayerNormWeights:ConstTensor;
663 outputLayerNormWeights:ConstTensor;
Jim Flynn11af3752019-03-19 17:22:29 +0000664}
665
Jan Eilers5b01a892019-07-23 09:47:43 +0100666table QuantizedLstmInputParams {
667 inputToInputWeights:ConstTensor;
668 inputToForgetWeights:ConstTensor;
669 inputToCellWeights:ConstTensor;
670 inputToOutputWeights:ConstTensor;
671
672 recurrentToInputWeights:ConstTensor;
673 recurrentToForgetWeights:ConstTensor;
674 recurrentToCellWeights:ConstTensor;
675 recurrentToOutputWeights:ConstTensor;
676
677 inputGateBias:ConstTensor;
678 forgetGateBias:ConstTensor;
679 cellBias:ConstTensor;
680 outputGateBias:ConstTensor;
681}
682
Jim Flynn11af3752019-03-19 17:22:29 +0000683table LstmDescriptor {
684 activationFunc:uint;
685 clippingThresCell:float;
686 clippingThresProj:float;
687 cifgEnabled:bool = true;
688 peepholeEnabled:bool = false;
689 projectionEnabled:bool = false;
Jan Eilersf8c62972019-07-17 11:07:49 +0100690 layerNormEnabled:bool = false;
Jim Flynn11af3752019-03-19 17:22:29 +0000691}
692
693table LstmLayer {
694 base:LayerBase;
695 descriptor:LstmDescriptor;
696 inputParams:LstmInputParams;
697}
698
Jan Eilers5b01a892019-07-23 09:47:43 +0100699table QuantizedLstmLayer {
700 base:LayerBase;
701 inputParams:QuantizedLstmInputParams;
702}
703
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000704table DequantizeLayer {
705 base:LayerBase;
706}
707
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100708table MergeLayer {
709 base:LayerBase;
710}
711
Sadik Armaganeff363d2019-04-05 15:25:46 +0100712table SwitchLayer {
713 base:LayerBase;
714}
715
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100716table PreluLayer {
717 base:LayerBase;
718}
719
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100720table TransposeConvolution2dLayer {
721 base:LayerBase;
722 descriptor:TransposeConvolution2dDescriptor;
723 weights:ConstTensor;
724 biases:ConstTensor;
725}
726
727table TransposeConvolution2dDescriptor {
728 padLeft:uint;
729 padRight:uint;
730 padTop:uint;
731 padBottom:uint;
732 strideX:uint;
733 strideY:uint;
734 biasEnabled:bool = false;
735 dataLayout:DataLayout = NCHW;
736}
737
Mike Kellyc9ea45a2020-02-28 18:11:58 +0000738table TransposeLayer {
739 base:LayerBase;
740 descriptor:TransposeDescriptor;
741}
742
743table TransposeDescriptor {
744 dimMappings:[uint];
745}
746
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100747table ResizeLayer {
748 base:LayerBase;
749 descriptor:ResizeDescriptor;
750}
751
752table ResizeDescriptor {
753 targetHeight:uint;
754 targetWidth:uint;
755 method:ResizeMethod = NearestNeighbor;
756 dataLayout:DataLayout;
757}
758
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100759table StackLayer {
760 base:LayerBase;
761 descriptor:StackDescriptor;
762}
763
764table StackDescriptor {
765 axis:uint;
766 numInputs:uint;
767 inputShape:[uint];
768}
769
Aron Virginas-Tar85121a22019-10-23 10:41:35 +0100770table StandInDescriptor {
771 numInputs:uint;
772 numOutputs:uint;
773}
774
775table StandInLayer {
776 base:LayerBase;
777 descriptor:StandInDescriptor;
778}
779
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000780union Layer {
Mike Kellyaf484012019-02-20 16:53:11 +0000781 ActivationLayer,
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000782 AdditionLayer,
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000783 BatchToSpaceNdLayer,
ruoyan018e7fa232019-02-28 15:09:07 +0000784 BatchNormalizationLayer,
Conor Kennedy76277882019-02-26 08:29:54 +0000785 ConstantLayer,
Mike Kellya0766c32019-02-19 17:22:07 +0000786 Convolution2dLayer,
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000787 DepthwiseConvolution2dLayer,
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000788 FullyConnectedLayer,
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000789 InputLayer,
Sadik Armagan5f450272019-02-12 14:31:45 +0000790 MultiplicationLayer,
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000791 OutputLayer,
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000792 PermuteLayer,
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000793 Pooling2dLayer,
Saoirse Stewart263829c2019-02-19 15:54:14 +0000794 ReshapeLayer,
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000795 SoftmaxLayer,
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000796 SpaceToBatchNdLayer,
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000797 DivisionLayer,
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000798 MinimumLayer,
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000799 EqualLayer,
Nina Drozd57728782019-02-27 10:53:27 +0000800 MaximumLayer,
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000801 NormalizationLayer,
Sadik Armagan8b42a382019-03-01 14:24:49 +0000802 PadLayer,
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000803 RsqrtLayer,
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000804 FloorLayer,
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000805 GreaterLayer,
Conor Kennedyda1f9752019-03-01 14:37:12 +0000806 ResizeBilinearLayer,
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000807 SubtractionLayer,
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000808 StridedSliceLayer,
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000809 GatherLayer,
Jim Flynnac25a1b2019-02-28 10:40:49 +0000810 MeanLayer,
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000811 MergerLayer,
Jim Flynn18ce3382019-03-08 11:08:30 +0000812 L2NormalizationLayer,
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000813 SplitterLayer,
Jim Flynn11af3752019-03-19 17:22:29 +0000814 DetectionPostProcessLayer,
Derek Lamberti87acb272019-03-27 16:51:31 +0000815 LstmLayer,
Jan Eilers5b01a892019-07-23 09:47:43 +0100816 QuantizedLstmLayer,
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000817 QuantizeLayer,
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100818 DequantizeLayer,
Sadik Armaganeff363d2019-04-05 15:25:46 +0100819 MergeLayer,
Jim Flynne242f2d2019-05-22 14:24:13 +0100820 SwitchLayer,
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100821 ConcatLayer,
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100822 SpaceToDepthLayer,
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100823 PreluLayer,
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100824 TransposeConvolution2dLayer,
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100825 ResizeLayer,
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100826 StackLayer,
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100827 AbsLayer,
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100828 ArgMinMaxLayer,
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100829 SliceLayer,
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100830 DepthToSpaceLayer,
Sadik Armagan26257852019-10-14 13:00:47 +0100831 InstanceNormalizationLayer,
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100832 LogSoftmaxLayer,
Aron Virginas-Tar85121a22019-10-23 10:41:35 +0100833 ComparisonLayer,
josh minor4a3c6102020-01-06 16:40:46 -0600834 StandInLayer,
Mike Kellyc9ea45a2020-02-28 18:11:58 +0000835 ElementwiseUnaryLayer,
836 TransposeLayer
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000837}
838
Saoirse Stewart49dbe0e2019-02-05 17:27:06 +0000839table AnyLayer {
840 layer:Layer;
841}
842
Tee Jungaa920c52019-11-05 10:48:25 +0000843table FeatureCompatibilityVersions {
844 bindingIdsScheme:uint = 0;
845}
846
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000847// Root type for serialized data is the graph of the network
848table SerializedGraph {
Saoirse Stewart49dbe0e2019-02-05 17:27:06 +0000849 layers:[AnyLayer];
Tee Jungaa920c52019-11-05 10:48:25 +0000850 inputIds:[int];
851 outputIds:[int];
852 featureVersions:FeatureCompatibilityVersions;
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000853}
854
855root_type SerializedGraph;