blob: 0f8a8160930d370c64e6b765e0ed69cebff73174 [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,
josh minor4a3c6102020-01-06 16:40:46 -0600150 StandIn = 53,
151 ElementwiseUnary = 54
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000152}
153
154// Base layer table to be used as part of other layers
155table LayerBase {
156 index:uint;
157 layerName:string;
158 layerType:LayerType;
159 inputSlots:[InputSlot];
160 outputSlots:[OutputSlot];
161}
162
163table BindableLayerBase {
164 base:LayerBase;
165 layerBindingId:int;
166}
167
168// Table for each layer defined below
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100169
josh minor4a3c6102020-01-06 16:40:46 -0600170/// @deprecated Use ElementwiseUnaryLayer instead
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100171table AbsLayer {
172 base:LayerBase;
173}
174
Mike Kellyaf484012019-02-20 16:53:11 +0000175table ActivationLayer {
176 base:LayerBase;
177 descriptor:ActivationDescriptor;
178}
179
180table ActivationDescriptor {
Tee Jung86bc3d82019-10-01 11:25:56 +0900181 activationFunction:ActivationFunction = Sigmoid;
Mike Kellyaf484012019-02-20 16:53:11 +0000182 a:float;
183 b:float;
184}
185
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000186table AdditionLayer {
187 base:LayerBase;
188}
189
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100190table ArgMinMaxLayer {
191 base:LayerBase;
192 descriptor:ArgMinMaxDescriptor;
193}
194
195table ArgMinMaxDescriptor{
Tee Jung86bc3d82019-10-01 11:25:56 +0900196 argMinMaxFunction:ArgMinMaxFunction;
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100197 axis:int;
198}
199
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100200enum ComparisonOperation : byte {
201 Equal = 0,
202 Greater = 1,
203 GreaterOrEqual = 2,
204 Less = 3,
205 LessOrEqual = 4,
206 NotEqual = 5
207}
208
209table ComparisonDescriptor {
210 operation:ComparisonOperation;
211}
212
213table ComparisonLayer {
214 base:LayerBase;
215 descriptor:ComparisonDescriptor;
216}
217
Conor Kennedy76277882019-02-26 08:29:54 +0000218table ConstantLayer {
219 base:LayerBase;
220 input:ConstTensor;
221}
222
Mike Kellya0766c32019-02-19 17:22:07 +0000223table Convolution2dLayer {
224 base:LayerBase;
225 descriptor:Convolution2dDescriptor;
226 weights:ConstTensor;
227 biases:ConstTensor;
228}
229
230table Convolution2dDescriptor {
231 padLeft:uint;
232 padRight:uint;
233 padTop:uint;
234 padBottom:uint;
235 strideX:uint;
236 strideY:uint;
Matthew Benthamacad04e2019-05-13 10:02:45 +0100237 dilationX:uint = 1;
238 dilationY:uint = 1;
Mike Kellya0766c32019-02-19 17:22:07 +0000239 biasEnabled:bool = false;
240 dataLayout:DataLayout = NCHW;
241}
242
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100243table DepthToSpaceLayer {
244 base:LayerBase;
245 descriptor:DepthToSpaceDescriptor;
246}
247
248table DepthToSpaceDescriptor {
249 blockSize:uint;
250 dataLayout:DataLayout;
251}
252
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000253table DivisionLayer {
254 base:LayerBase;
255}
256
josh minor4a3c6102020-01-06 16:40:46 -0600257enum UnaryOperation : byte {
258 Abs = 0,
259 Rsqrt = 1,
260 Sqrt = 2,
261 Exp = 3,
262 Neg = 4
263}
264
265table ElementwiseUnaryDescriptor {
266 operation:UnaryOperation;
267}
268
269table ElementwiseUnaryLayer {
270 base:LayerBase;
271 descriptor:ElementwiseUnaryDescriptor;
272}
273
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100274/// @deprecated Use ComparisonLayer instead
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000275table EqualLayer {
276 base:LayerBase;
277}
278
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000279table FloorLayer{
280 base:LayerBase;
281}
282
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000283table FullyConnectedLayer {
284 base:LayerBase;
285 descriptor:FullyConnectedDescriptor;
286 weights:ConstTensor;
287 biases:ConstTensor;
288}
289
290table FullyConnectedDescriptor {
291 biasEnabled:bool = false;
292 transposeWeightsMatrix:bool = false;
293}
294
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000295table GatherLayer {
296 base:LayerBase;
297}
298
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100299/// @deprecated Use ComparisonLayer instead
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000300table GreaterLayer {
301 base:LayerBase;
302}
303
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000304table InputLayer {
305 base:BindableLayerBase;
306}
307
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100308table InstanceNormalizationLayer {
309 base:LayerBase;
310 descriptor:InstanceNormalizationDescriptor;
311}
312
313table InstanceNormalizationDescriptor {
314 gamma:float;
315 beta:float;
316 eps:float;
317 dataLayout:DataLayout;
318}
319
Sadik Armagan26257852019-10-14 13:00:47 +0100320table LogSoftmaxLayer {
321 base:LayerBase;
322 descriptor:LogSoftmaxDescriptor;
323}
324
325table LogSoftmaxDescriptor {
326 beta:float = 1;
327 axis:int = -1;
328}
329
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000330table L2NormalizationLayer {
331 base:LayerBase;
332 descriptor:L2NormalizationDescriptor;
333}
334
335table L2NormalizationDescriptor {
336 dataLayout:DataLayout = NCHW;
Ferran Balaguer0dcffec2019-06-18 16:25:06 +0100337 eps:float = 1e-12;
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000338}
339
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000340table MinimumLayer {
341 base:LayerBase;
342}
343
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000344table MaximumLayer {
345 base:LayerBase;
346}
347
Sadik Armagan5f450272019-02-12 14:31:45 +0000348table MultiplicationLayer {
349 base:LayerBase;
350}
351
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000352table Pooling2dLayer {
353 base:LayerBase;
354 descriptor:Pooling2dDescriptor;
355}
356
357enum PoolingAlgorithm : byte {
358 Max = 0,
359 Average = 1,
360 L2 = 2
361}
362
363enum OutputShapeRounding : byte {
364 Floor = 0,
365 Ceiling = 1
366}
367
368enum PaddingMethod : byte {
369 IgnoreValue = 0,
370 Exclude = 1
371}
372
373table Pooling2dDescriptor {
374 poolType:PoolingAlgorithm;
375 padLeft:uint;
376 padRight:uint;
377 padTop:uint;
378 padBottom:uint;
379 poolWidth:uint;
380 poolHeight:uint;
381 strideX:uint;
382 strideY:uint;
383 outputShapeRounding:OutputShapeRounding;
384 paddingMethod:PaddingMethod;
385 dataLayout:DataLayout;
386}
387
Derek Lamberti87acb272019-03-27 16:51:31 +0000388table QuantizeLayer {
389 base:LayerBase;
390}
391
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000392table SoftmaxLayer {
393 base:LayerBase;
394 descriptor:SoftmaxDescriptor;
395}
396
397table SoftmaxDescriptor {
398 beta:float;
399}
400
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000401table DepthwiseConvolution2dLayer {
402 base:LayerBase;
403 descriptor:DepthwiseConvolution2dDescriptor;
404 weights:ConstTensor;
405 biases:ConstTensor;
406}
407
408table DepthwiseConvolution2dDescriptor {
409 padLeft:uint;
410 padRight:uint;
411 padTop:uint;
412 padBottom:uint;
413 strideX:uint;
414 strideY:uint;
Matthew Benthamacad04e2019-05-13 10:02:45 +0100415 dilationX:uint = 1;
416 dilationY:uint = 1;
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000417 biasEnabled:bool = false;
418 dataLayout:DataLayout = NCHW;
419}
420
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000421table OutputLayer {
422 base:BindableLayerBase;
423}
424
Saoirse Stewart263829c2019-02-19 15:54:14 +0000425table ReshapeLayer {
426 base:LayerBase;
427 descriptor:ReshapeDescriptor;
428}
429
430table ReshapeDescriptor {
431 targetShape:[uint];
432}
433
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000434table PermuteLayer {
435 base:LayerBase;
436 descriptor:PermuteDescriptor;
437}
438
439table PermuteDescriptor {
440 dimMappings:[uint];
441}
442
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000443table SpaceToBatchNdLayer {
444 base:LayerBase;
445 descriptor:SpaceToBatchNdDescriptor;
446}
447
448table SpaceToBatchNdDescriptor {
449 blockShape:[uint];
450 padList:[uint];
451 dataLayout:DataLayout;
452}
453
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100454table SpaceToDepthLayer {
455 base:LayerBase;
456 descriptor:SpaceToDepthDescriptor;
457}
458
459table SpaceToDepthDescriptor {
460 blockSize:uint;
461 dataLayout:DataLayout;
462}
463
Conor Kennedyda1f9752019-03-01 14:37:12 +0000464table SubtractionLayer {
465 base:LayerBase;
466}
467
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000468table BatchToSpaceNdLayer {
469 base:LayerBase;
470 descriptor:BatchToSpaceNdDescriptor;
471}
472
473table BatchToSpaceNdDescriptor {
474 blockShape:[uint];
475 crops:[uint];
476 dataLayout:DataLayout;
477}
478
Nina Drozd57728782019-02-27 10:53:27 +0000479enum NormalizationAlgorithmChannel : byte {
480 Across = 0,
481 Within = 1
482}
483
484enum NormalizationAlgorithmMethod : byte {
485 LocalBrightness = 0,
486 LocalContrast = 1
487}
488
489table NormalizationLayer {
490 base:LayerBase;
491 descriptor:NormalizationDescriptor;
492}
493
494table NormalizationDescriptor {
495 normChannelType:NormalizationAlgorithmChannel = Across;
496 normMethodType:NormalizationAlgorithmMethod = LocalBrightness;
497 normSize:uint;
498 alpha:float;
499 beta:float;
500 k:float;
501 dataLayout:DataLayout = NCHW;
502}
503
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000504table MeanLayer {
505 base:LayerBase;
506 descriptor:MeanDescriptor;
507}
508
509table MeanDescriptor {
510 axis:[uint];
511 keepDims:bool = false;
512}
513
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000514table PadLayer {
515 base:LayerBase;
516 descriptor:PadDescriptor;
517}
518
519table PadDescriptor {
520 padList:[uint];
David Monahan34757812019-06-19 11:47:21 +0100521 padValue:float = 0;
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000522}
523
josh minor4a3c6102020-01-06 16:40:46 -0600524/// @deprecated Use ElementwiseUnaryLayer instead
Sadik Armagan8b42a382019-03-01 14:24:49 +0000525table RsqrtLayer {
526 base:LayerBase;
527}
528
ruoyan018e7fa232019-02-28 15:09:07 +0000529table BatchNormalizationLayer {
530 base:LayerBase;
531 descriptor:BatchNormalizationDescriptor;
532 mean:ConstTensor;
533 variance:ConstTensor;
534 beta:ConstTensor;
535 gamma:ConstTensor;
536}
537
538table BatchNormalizationDescriptor {
539 eps:float;
540 dataLayout:DataLayout;
541}
542
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100543/// @deprecated Use ResizeLayer instead
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000544table ResizeBilinearLayer {
545 base:LayerBase;
546 descriptor:ResizeBilinearDescriptor;
547}
548
549table ResizeBilinearDescriptor {
550 targetWidth:uint;
551 targetHeight:uint;
552 dataLayout:DataLayout;
553}
554
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100555table SliceLayer {
556 base:LayerBase;
557 descriptor:SliceDescriptor;
558}
559
560table SliceDescriptor {
561 begin:[uint];
562 size:[uint];
563}
564
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000565table StridedSliceLayer {
566 base:LayerBase;
567 descriptor:StridedSliceDescriptor;
568}
569
570table StridedSliceDescriptor {
571 begin:[int];
572 end:[int];
573 stride:[int];
574 beginMask:int;
575 endMask:int;
576 shrinkAxisMask:int;
577 ellipsisMask:int;
578 newAxisMask:int;
579 dataLayout:DataLayout;
580}
581
Jim Flynne242f2d2019-05-22 14:24:13 +0100582table ConcatLayer {
583 base:LayerBase;
584 descriptor:OriginsDescriptor;
585}
586
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100587/// @deprecated Use ConcatLayer instead
Jim Flynnac25a1b2019-02-28 10:40:49 +0000588table MergerLayer {
589 base:LayerBase;
590 descriptor:OriginsDescriptor;
591}
592
593table UintVector {
594 data:[uint];
595}
596
597table OriginsDescriptor {
598 concatAxis:uint;
599 numViews:uint;
600 numDimensions:uint;
601 viewOrigins:[UintVector];
602}
603
Jim Flynn18ce3382019-03-08 11:08:30 +0000604table ViewsDescriptor {
605 origins:OriginsDescriptor;
606 viewSizes:[UintVector];
607}
608
609table SplitterLayer {
610 base:LayerBase;
611 descriptor:ViewsDescriptor;
612}
613
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000614table DetectionPostProcessLayer {
615 base:LayerBase;
616 descriptor:DetectionPostProcessDescriptor;
617 anchors:ConstTensor;
618}
619
620table DetectionPostProcessDescriptor {
621 maxDetections:uint;
622 maxClassesPerDetection:uint;
623 detectionsPerClass:uint;
624 nmsScoreThreshold:float;
625 nmsIouThreshold:float;
626 numClasses:uint;
627 useRegularNms:bool;
628 scaleX:float;
629 scaleY:float;
630 scaleW:float;
631 scaleH:float;
632}
633
Jim Flynn11af3752019-03-19 17:22:29 +0000634table LstmInputParams {
635 inputToForgetWeights:ConstTensor;
636 inputToCellWeights:ConstTensor;
637 inputToOutputWeights:ConstTensor;
638 recurrentToForgetWeights:ConstTensor;
639 recurrentToCellWeights:ConstTensor;
640 recurrentToOutputWeights:ConstTensor;
641 forgetGateBias:ConstTensor;
642 cellBias:ConstTensor;
643 outputGateBias:ConstTensor;
644
645 inputToInputWeights:ConstTensor;
646 recurrentToInputWeights:ConstTensor;
647 cellToInputWeights:ConstTensor;
648 inputGateBias:ConstTensor;
649
650 projectionWeights:ConstTensor;
651 projectionBias:ConstTensor;
652
653 cellToForgetWeights:ConstTensor;
654 cellToOutputWeights:ConstTensor;
Jan Eilersf8c62972019-07-17 11:07:49 +0100655
656 inputLayerNormWeights:ConstTensor;
657 forgetLayerNormWeights:ConstTensor;
658 cellLayerNormWeights:ConstTensor;
659 outputLayerNormWeights:ConstTensor;
Jim Flynn11af3752019-03-19 17:22:29 +0000660}
661
Jan Eilers5b01a892019-07-23 09:47:43 +0100662table QuantizedLstmInputParams {
663 inputToInputWeights:ConstTensor;
664 inputToForgetWeights:ConstTensor;
665 inputToCellWeights:ConstTensor;
666 inputToOutputWeights:ConstTensor;
667
668 recurrentToInputWeights:ConstTensor;
669 recurrentToForgetWeights:ConstTensor;
670 recurrentToCellWeights:ConstTensor;
671 recurrentToOutputWeights:ConstTensor;
672
673 inputGateBias:ConstTensor;
674 forgetGateBias:ConstTensor;
675 cellBias:ConstTensor;
676 outputGateBias:ConstTensor;
677}
678
Jim Flynn11af3752019-03-19 17:22:29 +0000679table LstmDescriptor {
680 activationFunc:uint;
681 clippingThresCell:float;
682 clippingThresProj:float;
683 cifgEnabled:bool = true;
684 peepholeEnabled:bool = false;
685 projectionEnabled:bool = false;
Jan Eilersf8c62972019-07-17 11:07:49 +0100686 layerNormEnabled:bool = false;
Jim Flynn11af3752019-03-19 17:22:29 +0000687}
688
689table LstmLayer {
690 base:LayerBase;
691 descriptor:LstmDescriptor;
692 inputParams:LstmInputParams;
693}
694
Jan Eilers5b01a892019-07-23 09:47:43 +0100695table QuantizedLstmLayer {
696 base:LayerBase;
697 inputParams:QuantizedLstmInputParams;
698}
699
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000700table DequantizeLayer {
701 base:LayerBase;
702}
703
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100704table MergeLayer {
705 base:LayerBase;
706}
707
Sadik Armaganeff363d2019-04-05 15:25:46 +0100708table SwitchLayer {
709 base:LayerBase;
710}
711
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100712table PreluLayer {
713 base:LayerBase;
714}
715
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100716table TransposeConvolution2dLayer {
717 base:LayerBase;
718 descriptor:TransposeConvolution2dDescriptor;
719 weights:ConstTensor;
720 biases:ConstTensor;
721}
722
723table TransposeConvolution2dDescriptor {
724 padLeft:uint;
725 padRight:uint;
726 padTop:uint;
727 padBottom:uint;
728 strideX:uint;
729 strideY:uint;
730 biasEnabled:bool = false;
731 dataLayout:DataLayout = NCHW;
732}
733
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100734table ResizeLayer {
735 base:LayerBase;
736 descriptor:ResizeDescriptor;
737}
738
739table ResizeDescriptor {
740 targetHeight:uint;
741 targetWidth:uint;
742 method:ResizeMethod = NearestNeighbor;
743 dataLayout:DataLayout;
744}
745
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100746table StackLayer {
747 base:LayerBase;
748 descriptor:StackDescriptor;
749}
750
751table StackDescriptor {
752 axis:uint;
753 numInputs:uint;
754 inputShape:[uint];
755}
756
Aron Virginas-Tar85121a22019-10-23 10:41:35 +0100757table StandInDescriptor {
758 numInputs:uint;
759 numOutputs:uint;
760}
761
762table StandInLayer {
763 base:LayerBase;
764 descriptor:StandInDescriptor;
765}
766
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000767union Layer {
Mike Kellyaf484012019-02-20 16:53:11 +0000768 ActivationLayer,
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000769 AdditionLayer,
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000770 BatchToSpaceNdLayer,
ruoyan018e7fa232019-02-28 15:09:07 +0000771 BatchNormalizationLayer,
Conor Kennedy76277882019-02-26 08:29:54 +0000772 ConstantLayer,
Mike Kellya0766c32019-02-19 17:22:07 +0000773 Convolution2dLayer,
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000774 DepthwiseConvolution2dLayer,
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000775 FullyConnectedLayer,
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000776 InputLayer,
Sadik Armagan5f450272019-02-12 14:31:45 +0000777 MultiplicationLayer,
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000778 OutputLayer,
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000779 PermuteLayer,
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000780 Pooling2dLayer,
Saoirse Stewart263829c2019-02-19 15:54:14 +0000781 ReshapeLayer,
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000782 SoftmaxLayer,
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000783 SpaceToBatchNdLayer,
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000784 DivisionLayer,
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000785 MinimumLayer,
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000786 EqualLayer,
Nina Drozd57728782019-02-27 10:53:27 +0000787 MaximumLayer,
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000788 NormalizationLayer,
Sadik Armagan8b42a382019-03-01 14:24:49 +0000789 PadLayer,
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000790 RsqrtLayer,
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000791 FloorLayer,
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000792 GreaterLayer,
Conor Kennedyda1f9752019-03-01 14:37:12 +0000793 ResizeBilinearLayer,
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000794 SubtractionLayer,
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000795 StridedSliceLayer,
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000796 GatherLayer,
Jim Flynnac25a1b2019-02-28 10:40:49 +0000797 MeanLayer,
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000798 MergerLayer,
Jim Flynn18ce3382019-03-08 11:08:30 +0000799 L2NormalizationLayer,
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000800 SplitterLayer,
Jim Flynn11af3752019-03-19 17:22:29 +0000801 DetectionPostProcessLayer,
Derek Lamberti87acb272019-03-27 16:51:31 +0000802 LstmLayer,
Jan Eilers5b01a892019-07-23 09:47:43 +0100803 QuantizedLstmLayer,
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000804 QuantizeLayer,
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100805 DequantizeLayer,
Sadik Armaganeff363d2019-04-05 15:25:46 +0100806 MergeLayer,
Jim Flynne242f2d2019-05-22 14:24:13 +0100807 SwitchLayer,
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100808 ConcatLayer,
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100809 SpaceToDepthLayer,
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100810 PreluLayer,
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100811 TransposeConvolution2dLayer,
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100812 ResizeLayer,
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100813 StackLayer,
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100814 AbsLayer,
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100815 ArgMinMaxLayer,
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100816 SliceLayer,
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100817 DepthToSpaceLayer,
Sadik Armagan26257852019-10-14 13:00:47 +0100818 InstanceNormalizationLayer,
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100819 LogSoftmaxLayer,
Aron Virginas-Tar85121a22019-10-23 10:41:35 +0100820 ComparisonLayer,
josh minor4a3c6102020-01-06 16:40:46 -0600821 StandInLayer,
822 ElementwiseUnaryLayer
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000823}
824
Saoirse Stewart49dbe0e2019-02-05 17:27:06 +0000825table AnyLayer {
826 layer:Layer;
827}
828
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000829// Root type for serialized data is the graph of the network
830table SerializedGraph {
Saoirse Stewart49dbe0e2019-02-05 17:27:06 +0000831 layers:[AnyLayer];
Mike Kelly8c1701a2019-02-11 17:01:27 +0000832 inputIds:[uint];
833 outputIds:[uint];
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000834}
835
836root_type SerializedGraph;