blob: bad95cfc560282184c27f051af7e7ed101be4eaf [file] [log] [blame]
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +00001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
Derek Lamberti0028d1b2019-02-20 13:57:42 +00006namespace armnnSerializer;
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +00007
8file_identifier "ARMN";
9
10file_extension "armnn";
11
Mike Kellyaf484012019-02-20 16:53:11 +000012enum ActivationFunction : byte {
13 Sigmoid = 0,
14 TanH = 1,
15 Linear = 2,
16 ReLu = 3,
17 BoundedReLu = 4,
18 SoftReLu = 5,
19 LeakyReLu = 6,
20 Abs = 7,
21 Sqrt = 8,
22 Square = 9
23}
24
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +010025enum ArgMinMaxFunction : byte {
26 Min = 0,
27 Max = 1
28}
29
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +000030enum DataType : byte {
31 Float16 = 0,
32 Float32 = 1,
33 QuantisedAsymm8 = 2,
34 Signed32 = 3,
Nattapat Chaimanowongcd5ac232019-03-19 12:26:36 +000035 Boolean = 4,
36 QuantisedSymm16 = 5
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +000037}
38
Saoirse Stewart3166c3e2019-02-18 15:24:53 +000039enum DataLayout : byte {
40 NHWC = 0,
41 NCHW = 1
42}
43
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +010044enum ResizeMethod: byte {
45 NearestNeighbor = 0,
46 Bilinear = 1,
47}
48
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +000049table TensorInfo {
50 dimensions:[uint];
51 dataType:DataType;
52 quantizationScale:float = 1.0;
53 quantizationOffset:int = 0;
54}
55
56struct Connection {
57 sourceLayerIndex:uint;
58 outputSlotIndex:uint;
59}
60
61table ByteData {
62 data:[byte];
63}
64
65table ShortData {
66 data:[short];
67}
68
69table IntData {
70 data:[int];
71}
72
73table LongData {
74 data:[long];
75}
76
77union ConstTensorData { ByteData, ShortData, IntData, LongData }
78
79table ConstTensor {
80 info:TensorInfo;
81 data:ConstTensorData;
82}
83
84table InputSlot {
85 index:uint;
86 connection:Connection;
87}
88
89table OutputSlot {
90 index:uint;
91 tensorInfo:TensorInfo;
92}
93
94enum LayerType : uint {
95 Addition = 0,
96 Input = 1,
Sadik Armagan5f450272019-02-12 14:31:45 +000097 Multiplication = 2,
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +000098 Output = 3,
Saoirse Stewart3166c3e2019-02-18 15:24:53 +000099 Pooling2d = 4,
Saoirse Stewart263829c2019-02-19 15:54:14 +0000100 Reshape = 5,
Mike Kellya0766c32019-02-19 17:22:07 +0000101 Softmax = 6,
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000102 Convolution2d = 7,
Mike Kellyaf484012019-02-20 16:53:11 +0000103 DepthwiseConvolution2d = 8,
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000104 Activation = 9,
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000105 Permute = 10,
Conor Kennedy76277882019-02-26 08:29:54 +0000106 FullyConnected = 11,
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000107 Constant = 12,
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000108 SpaceToBatchNd = 13,
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000109 BatchToSpaceNd = 14,
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000110 Division = 15,
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000111 Minimum = 16,
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000112 Equal = 17,
Nina Drozd57728782019-02-27 10:53:27 +0000113 Maximum = 18,
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000114 Normalization = 19,
Sadik Armagan8b42a382019-03-01 14:24:49 +0000115 Pad = 20,
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000116 Rsqrt = 21,
ruoyan018e7fa232019-02-28 15:09:07 +0000117 Floor = 22,
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000118 BatchNormalization = 23,
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000119 Greater = 24,
Conor Kennedyda1f9752019-03-01 14:37:12 +0000120 ResizeBilinear = 25,
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000121 Subtraction = 26,
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000122 StridedSlice = 27,
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000123 Gather = 28,
Jim Flynnac25a1b2019-02-28 10:40:49 +0000124 Mean = 29,
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000125 Merger = 30,
Jim Flynn18ce3382019-03-08 11:08:30 +0000126 L2Normalization = 31,
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000127 Splitter = 32,
Jim Flynn11af3752019-03-19 17:22:29 +0000128 DetectionPostProcess = 33,
Derek Lamberti87acb272019-03-27 16:51:31 +0000129 Lstm = 34,
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000130 Quantize = 35,
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100131 Dequantize = 36,
Sadik Armaganeff363d2019-04-05 15:25:46 +0100132 Merge = 37,
Jim Flynne242f2d2019-05-22 14:24:13 +0100133 Switch = 38,
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100134 Concat = 39,
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100135 SpaceToDepth = 40,
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100136 Prelu = 41,
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100137 TransposeConvolution2d = 42,
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100138 Resize = 43,
Jan Eilers5b01a892019-07-23 09:47:43 +0100139 Stack = 44,
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100140 QuantizedLstm = 45,
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100141 Abs = 46,
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100142 ArgMinMax = 47,
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100143 Slice = 48,
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100144 DepthToSpace = 49,
Sadik Armagan26257852019-10-14 13:00:47 +0100145 InstanceNormalization = 50,
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100146 LogSoftmax = 51,
Aron Virginas-Tar85121a22019-10-23 10:41:35 +0100147 Comparison = 52,
148 StandIn = 53
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000149}
150
151// Base layer table to be used as part of other layers
152table LayerBase {
153 index:uint;
154 layerName:string;
155 layerType:LayerType;
156 inputSlots:[InputSlot];
157 outputSlots:[OutputSlot];
158}
159
160table BindableLayerBase {
161 base:LayerBase;
162 layerBindingId:int;
163}
164
165// Table for each layer defined below
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100166
167table AbsLayer {
168 base:LayerBase;
169}
170
Mike Kellyaf484012019-02-20 16:53:11 +0000171table ActivationLayer {
172 base:LayerBase;
173 descriptor:ActivationDescriptor;
174}
175
176table ActivationDescriptor {
Tee Jung86bc3d82019-10-01 11:25:56 +0900177 activationFunction:ActivationFunction = Sigmoid;
Mike Kellyaf484012019-02-20 16:53:11 +0000178 a:float;
179 b:float;
180}
181
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000182table AdditionLayer {
183 base:LayerBase;
184}
185
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100186table ArgMinMaxLayer {
187 base:LayerBase;
188 descriptor:ArgMinMaxDescriptor;
189}
190
191table ArgMinMaxDescriptor{
Tee Jung86bc3d82019-10-01 11:25:56 +0900192 argMinMaxFunction:ArgMinMaxFunction;
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100193 axis:int;
194}
195
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100196enum ComparisonOperation : byte {
197 Equal = 0,
198 Greater = 1,
199 GreaterOrEqual = 2,
200 Less = 3,
201 LessOrEqual = 4,
202 NotEqual = 5
203}
204
205table ComparisonDescriptor {
206 operation:ComparisonOperation;
207}
208
209table ComparisonLayer {
210 base:LayerBase;
211 descriptor:ComparisonDescriptor;
212}
213
Conor Kennedy76277882019-02-26 08:29:54 +0000214table ConstantLayer {
215 base:LayerBase;
216 input:ConstTensor;
217}
218
Mike Kellya0766c32019-02-19 17:22:07 +0000219table Convolution2dLayer {
220 base:LayerBase;
221 descriptor:Convolution2dDescriptor;
222 weights:ConstTensor;
223 biases:ConstTensor;
224}
225
226table Convolution2dDescriptor {
227 padLeft:uint;
228 padRight:uint;
229 padTop:uint;
230 padBottom:uint;
231 strideX:uint;
232 strideY:uint;
Matthew Benthamacad04e2019-05-13 10:02:45 +0100233 dilationX:uint = 1;
234 dilationY:uint = 1;
Mike Kellya0766c32019-02-19 17:22:07 +0000235 biasEnabled:bool = false;
236 dataLayout:DataLayout = NCHW;
237}
238
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100239table DepthToSpaceLayer {
240 base:LayerBase;
241 descriptor:DepthToSpaceDescriptor;
242}
243
244table DepthToSpaceDescriptor {
245 blockSize:uint;
246 dataLayout:DataLayout;
247}
248
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000249table DivisionLayer {
250 base:LayerBase;
251}
252
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100253/// @deprecated Use ComparisonLayer instead
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000254table EqualLayer {
255 base:LayerBase;
256}
257
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000258table FloorLayer{
259 base:LayerBase;
260}
261
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000262table FullyConnectedLayer {
263 base:LayerBase;
264 descriptor:FullyConnectedDescriptor;
265 weights:ConstTensor;
266 biases:ConstTensor;
267}
268
269table FullyConnectedDescriptor {
270 biasEnabled:bool = false;
271 transposeWeightsMatrix:bool = false;
272}
273
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000274table GatherLayer {
275 base:LayerBase;
276}
277
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100278/// @deprecated Use ComparisonLayer instead
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000279table GreaterLayer {
280 base:LayerBase;
281}
282
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000283table InputLayer {
284 base:BindableLayerBase;
285}
286
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100287table InstanceNormalizationLayer {
288 base:LayerBase;
289 descriptor:InstanceNormalizationDescriptor;
290}
291
292table InstanceNormalizationDescriptor {
293 gamma:float;
294 beta:float;
295 eps:float;
296 dataLayout:DataLayout;
297}
298
Sadik Armagan26257852019-10-14 13:00:47 +0100299table LogSoftmaxLayer {
300 base:LayerBase;
301 descriptor:LogSoftmaxDescriptor;
302}
303
304table LogSoftmaxDescriptor {
305 beta:float = 1;
306 axis:int = -1;
307}
308
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000309table L2NormalizationLayer {
310 base:LayerBase;
311 descriptor:L2NormalizationDescriptor;
312}
313
314table L2NormalizationDescriptor {
315 dataLayout:DataLayout = NCHW;
Ferran Balaguer0dcffec2019-06-18 16:25:06 +0100316 eps:float = 1e-12;
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000317}
318
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000319table MinimumLayer {
320 base:LayerBase;
321}
322
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000323table MaximumLayer {
324 base:LayerBase;
325}
326
Sadik Armagan5f450272019-02-12 14:31:45 +0000327table MultiplicationLayer {
328 base:LayerBase;
329}
330
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000331table Pooling2dLayer {
332 base:LayerBase;
333 descriptor:Pooling2dDescriptor;
334}
335
336enum PoolingAlgorithm : byte {
337 Max = 0,
338 Average = 1,
339 L2 = 2
340}
341
342enum OutputShapeRounding : byte {
343 Floor = 0,
344 Ceiling = 1
345}
346
347enum PaddingMethod : byte {
348 IgnoreValue = 0,
349 Exclude = 1
350}
351
352table Pooling2dDescriptor {
353 poolType:PoolingAlgorithm;
354 padLeft:uint;
355 padRight:uint;
356 padTop:uint;
357 padBottom:uint;
358 poolWidth:uint;
359 poolHeight:uint;
360 strideX:uint;
361 strideY:uint;
362 outputShapeRounding:OutputShapeRounding;
363 paddingMethod:PaddingMethod;
364 dataLayout:DataLayout;
365}
366
Derek Lamberti87acb272019-03-27 16:51:31 +0000367table QuantizeLayer {
368 base:LayerBase;
369}
370
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000371table SoftmaxLayer {
372 base:LayerBase;
373 descriptor:SoftmaxDescriptor;
374}
375
376table SoftmaxDescriptor {
377 beta:float;
378}
379
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000380table DepthwiseConvolution2dLayer {
381 base:LayerBase;
382 descriptor:DepthwiseConvolution2dDescriptor;
383 weights:ConstTensor;
384 biases:ConstTensor;
385}
386
387table DepthwiseConvolution2dDescriptor {
388 padLeft:uint;
389 padRight:uint;
390 padTop:uint;
391 padBottom:uint;
392 strideX:uint;
393 strideY:uint;
Matthew Benthamacad04e2019-05-13 10:02:45 +0100394 dilationX:uint = 1;
395 dilationY:uint = 1;
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000396 biasEnabled:bool = false;
397 dataLayout:DataLayout = NCHW;
398}
399
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000400table OutputLayer {
401 base:BindableLayerBase;
402}
403
Saoirse Stewart263829c2019-02-19 15:54:14 +0000404table ReshapeLayer {
405 base:LayerBase;
406 descriptor:ReshapeDescriptor;
407}
408
409table ReshapeDescriptor {
410 targetShape:[uint];
411}
412
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000413table PermuteLayer {
414 base:LayerBase;
415 descriptor:PermuteDescriptor;
416}
417
418table PermuteDescriptor {
419 dimMappings:[uint];
420}
421
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000422table SpaceToBatchNdLayer {
423 base:LayerBase;
424 descriptor:SpaceToBatchNdDescriptor;
425}
426
427table SpaceToBatchNdDescriptor {
428 blockShape:[uint];
429 padList:[uint];
430 dataLayout:DataLayout;
431}
432
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100433table SpaceToDepthLayer {
434 base:LayerBase;
435 descriptor:SpaceToDepthDescriptor;
436}
437
438table SpaceToDepthDescriptor {
439 blockSize:uint;
440 dataLayout:DataLayout;
441}
442
Conor Kennedyda1f9752019-03-01 14:37:12 +0000443table SubtractionLayer {
444 base:LayerBase;
445}
446
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000447table BatchToSpaceNdLayer {
448 base:LayerBase;
449 descriptor:BatchToSpaceNdDescriptor;
450}
451
452table BatchToSpaceNdDescriptor {
453 blockShape:[uint];
454 crops:[uint];
455 dataLayout:DataLayout;
456}
457
Nina Drozd57728782019-02-27 10:53:27 +0000458enum NormalizationAlgorithmChannel : byte {
459 Across = 0,
460 Within = 1
461}
462
463enum NormalizationAlgorithmMethod : byte {
464 LocalBrightness = 0,
465 LocalContrast = 1
466}
467
468table NormalizationLayer {
469 base:LayerBase;
470 descriptor:NormalizationDescriptor;
471}
472
473table NormalizationDescriptor {
474 normChannelType:NormalizationAlgorithmChannel = Across;
475 normMethodType:NormalizationAlgorithmMethod = LocalBrightness;
476 normSize:uint;
477 alpha:float;
478 beta:float;
479 k:float;
480 dataLayout:DataLayout = NCHW;
481}
482
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000483table MeanLayer {
484 base:LayerBase;
485 descriptor:MeanDescriptor;
486}
487
488table MeanDescriptor {
489 axis:[uint];
490 keepDims:bool = false;
491}
492
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000493table PadLayer {
494 base:LayerBase;
495 descriptor:PadDescriptor;
496}
497
498table PadDescriptor {
499 padList:[uint];
David Monahan34757812019-06-19 11:47:21 +0100500 padValue:float = 0;
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000501}
502
Sadik Armagan8b42a382019-03-01 14:24:49 +0000503table RsqrtLayer {
504 base:LayerBase;
505}
506
ruoyan018e7fa232019-02-28 15:09:07 +0000507table BatchNormalizationLayer {
508 base:LayerBase;
509 descriptor:BatchNormalizationDescriptor;
510 mean:ConstTensor;
511 variance:ConstTensor;
512 beta:ConstTensor;
513 gamma:ConstTensor;
514}
515
516table BatchNormalizationDescriptor {
517 eps:float;
518 dataLayout:DataLayout;
519}
520
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100521/// @deprecated Use ResizeLayer instead
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000522table ResizeBilinearLayer {
523 base:LayerBase;
524 descriptor:ResizeBilinearDescriptor;
525}
526
527table ResizeBilinearDescriptor {
528 targetWidth:uint;
529 targetHeight:uint;
530 dataLayout:DataLayout;
531}
532
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100533table SliceLayer {
534 base:LayerBase;
535 descriptor:SliceDescriptor;
536}
537
538table SliceDescriptor {
539 begin:[uint];
540 size:[uint];
541}
542
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000543table StridedSliceLayer {
544 base:LayerBase;
545 descriptor:StridedSliceDescriptor;
546}
547
548table StridedSliceDescriptor {
549 begin:[int];
550 end:[int];
551 stride:[int];
552 beginMask:int;
553 endMask:int;
554 shrinkAxisMask:int;
555 ellipsisMask:int;
556 newAxisMask:int;
557 dataLayout:DataLayout;
558}
559
Jim Flynne242f2d2019-05-22 14:24:13 +0100560table ConcatLayer {
561 base:LayerBase;
562 descriptor:OriginsDescriptor;
563}
564
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100565/// @deprecated Use ConcatLayer instead
Jim Flynnac25a1b2019-02-28 10:40:49 +0000566table MergerLayer {
567 base:LayerBase;
568 descriptor:OriginsDescriptor;
569}
570
571table UintVector {
572 data:[uint];
573}
574
575table OriginsDescriptor {
576 concatAxis:uint;
577 numViews:uint;
578 numDimensions:uint;
579 viewOrigins:[UintVector];
580}
581
Jim Flynn18ce3382019-03-08 11:08:30 +0000582table ViewsDescriptor {
583 origins:OriginsDescriptor;
584 viewSizes:[UintVector];
585}
586
587table SplitterLayer {
588 base:LayerBase;
589 descriptor:ViewsDescriptor;
590}
591
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000592table DetectionPostProcessLayer {
593 base:LayerBase;
594 descriptor:DetectionPostProcessDescriptor;
595 anchors:ConstTensor;
596}
597
598table DetectionPostProcessDescriptor {
599 maxDetections:uint;
600 maxClassesPerDetection:uint;
601 detectionsPerClass:uint;
602 nmsScoreThreshold:float;
603 nmsIouThreshold:float;
604 numClasses:uint;
605 useRegularNms:bool;
606 scaleX:float;
607 scaleY:float;
608 scaleW:float;
609 scaleH:float;
610}
611
Jim Flynn11af3752019-03-19 17:22:29 +0000612table LstmInputParams {
613 inputToForgetWeights:ConstTensor;
614 inputToCellWeights:ConstTensor;
615 inputToOutputWeights:ConstTensor;
616 recurrentToForgetWeights:ConstTensor;
617 recurrentToCellWeights:ConstTensor;
618 recurrentToOutputWeights:ConstTensor;
619 forgetGateBias:ConstTensor;
620 cellBias:ConstTensor;
621 outputGateBias:ConstTensor;
622
623 inputToInputWeights:ConstTensor;
624 recurrentToInputWeights:ConstTensor;
625 cellToInputWeights:ConstTensor;
626 inputGateBias:ConstTensor;
627
628 projectionWeights:ConstTensor;
629 projectionBias:ConstTensor;
630
631 cellToForgetWeights:ConstTensor;
632 cellToOutputWeights:ConstTensor;
Jan Eilersf8c62972019-07-17 11:07:49 +0100633
634 inputLayerNormWeights:ConstTensor;
635 forgetLayerNormWeights:ConstTensor;
636 cellLayerNormWeights:ConstTensor;
637 outputLayerNormWeights:ConstTensor;
Jim Flynn11af3752019-03-19 17:22:29 +0000638}
639
Jan Eilers5b01a892019-07-23 09:47:43 +0100640table QuantizedLstmInputParams {
641 inputToInputWeights:ConstTensor;
642 inputToForgetWeights:ConstTensor;
643 inputToCellWeights:ConstTensor;
644 inputToOutputWeights:ConstTensor;
645
646 recurrentToInputWeights:ConstTensor;
647 recurrentToForgetWeights:ConstTensor;
648 recurrentToCellWeights:ConstTensor;
649 recurrentToOutputWeights:ConstTensor;
650
651 inputGateBias:ConstTensor;
652 forgetGateBias:ConstTensor;
653 cellBias:ConstTensor;
654 outputGateBias:ConstTensor;
655}
656
Jim Flynn11af3752019-03-19 17:22:29 +0000657table LstmDescriptor {
658 activationFunc:uint;
659 clippingThresCell:float;
660 clippingThresProj:float;
661 cifgEnabled:bool = true;
662 peepholeEnabled:bool = false;
663 projectionEnabled:bool = false;
Jan Eilersf8c62972019-07-17 11:07:49 +0100664 layerNormEnabled:bool = false;
Jim Flynn11af3752019-03-19 17:22:29 +0000665}
666
667table LstmLayer {
668 base:LayerBase;
669 descriptor:LstmDescriptor;
670 inputParams:LstmInputParams;
671}
672
Jan Eilers5b01a892019-07-23 09:47:43 +0100673table QuantizedLstmLayer {
674 base:LayerBase;
675 inputParams:QuantizedLstmInputParams;
676}
677
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000678table DequantizeLayer {
679 base:LayerBase;
680}
681
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100682table MergeLayer {
683 base:LayerBase;
684}
685
Sadik Armaganeff363d2019-04-05 15:25:46 +0100686table SwitchLayer {
687 base:LayerBase;
688}
689
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100690table PreluLayer {
691 base:LayerBase;
692}
693
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100694table TransposeConvolution2dLayer {
695 base:LayerBase;
696 descriptor:TransposeConvolution2dDescriptor;
697 weights:ConstTensor;
698 biases:ConstTensor;
699}
700
701table TransposeConvolution2dDescriptor {
702 padLeft:uint;
703 padRight:uint;
704 padTop:uint;
705 padBottom:uint;
706 strideX:uint;
707 strideY:uint;
708 biasEnabled:bool = false;
709 dataLayout:DataLayout = NCHW;
710}
711
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100712table ResizeLayer {
713 base:LayerBase;
714 descriptor:ResizeDescriptor;
715}
716
717table ResizeDescriptor {
718 targetHeight:uint;
719 targetWidth:uint;
720 method:ResizeMethod = NearestNeighbor;
721 dataLayout:DataLayout;
722}
723
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100724table StackLayer {
725 base:LayerBase;
726 descriptor:StackDescriptor;
727}
728
729table StackDescriptor {
730 axis:uint;
731 numInputs:uint;
732 inputShape:[uint];
733}
734
Aron Virginas-Tar85121a22019-10-23 10:41:35 +0100735table StandInDescriptor {
736 numInputs:uint;
737 numOutputs:uint;
738}
739
740table StandInLayer {
741 base:LayerBase;
742 descriptor:StandInDescriptor;
743}
744
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000745union Layer {
Mike Kellyaf484012019-02-20 16:53:11 +0000746 ActivationLayer,
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000747 AdditionLayer,
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000748 BatchToSpaceNdLayer,
ruoyan018e7fa232019-02-28 15:09:07 +0000749 BatchNormalizationLayer,
Conor Kennedy76277882019-02-26 08:29:54 +0000750 ConstantLayer,
Mike Kellya0766c32019-02-19 17:22:07 +0000751 Convolution2dLayer,
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000752 DepthwiseConvolution2dLayer,
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000753 FullyConnectedLayer,
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000754 InputLayer,
Sadik Armagan5f450272019-02-12 14:31:45 +0000755 MultiplicationLayer,
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000756 OutputLayer,
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000757 PermuteLayer,
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000758 Pooling2dLayer,
Saoirse Stewart263829c2019-02-19 15:54:14 +0000759 ReshapeLayer,
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000760 SoftmaxLayer,
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000761 SpaceToBatchNdLayer,
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000762 DivisionLayer,
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000763 MinimumLayer,
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000764 EqualLayer,
Nina Drozd57728782019-02-27 10:53:27 +0000765 MaximumLayer,
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000766 NormalizationLayer,
Sadik Armagan8b42a382019-03-01 14:24:49 +0000767 PadLayer,
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000768 RsqrtLayer,
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000769 FloorLayer,
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000770 GreaterLayer,
Conor Kennedyda1f9752019-03-01 14:37:12 +0000771 ResizeBilinearLayer,
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000772 SubtractionLayer,
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000773 StridedSliceLayer,
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000774 GatherLayer,
Jim Flynnac25a1b2019-02-28 10:40:49 +0000775 MeanLayer,
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000776 MergerLayer,
Jim Flynn18ce3382019-03-08 11:08:30 +0000777 L2NormalizationLayer,
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000778 SplitterLayer,
Jim Flynn11af3752019-03-19 17:22:29 +0000779 DetectionPostProcessLayer,
Derek Lamberti87acb272019-03-27 16:51:31 +0000780 LstmLayer,
Jan Eilers5b01a892019-07-23 09:47:43 +0100781 QuantizedLstmLayer,
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000782 QuantizeLayer,
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100783 DequantizeLayer,
Sadik Armaganeff363d2019-04-05 15:25:46 +0100784 MergeLayer,
Jim Flynne242f2d2019-05-22 14:24:13 +0100785 SwitchLayer,
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100786 ConcatLayer,
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100787 SpaceToDepthLayer,
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100788 PreluLayer,
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100789 TransposeConvolution2dLayer,
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100790 ResizeLayer,
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100791 StackLayer,
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100792 AbsLayer,
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100793 ArgMinMaxLayer,
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100794 SliceLayer,
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100795 DepthToSpaceLayer,
Sadik Armagan26257852019-10-14 13:00:47 +0100796 InstanceNormalizationLayer,
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100797 LogSoftmaxLayer,
Aron Virginas-Tar85121a22019-10-23 10:41:35 +0100798 ComparisonLayer,
799 StandInLayer
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000800}
801
Saoirse Stewart49dbe0e2019-02-05 17:27:06 +0000802table AnyLayer {
803 layer:Layer;
804}
805
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000806// Root type for serialized data is the graph of the network
807table SerializedGraph {
Saoirse Stewart49dbe0e2019-02-05 17:27:06 +0000808 layers:[AnyLayer];
Mike Kelly8c1701a2019-02-11 17:01:27 +0000809 inputIds:[uint];
810 outputIds:[uint];
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000811}
812
813root_type SerializedGraph;