blob: d7565a5b9a18735e5e231371db6cb345155f4e33 [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,
40 QSymmS16 = 7
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +000041}
42
Saoirse Stewart3166c3e2019-02-18 15:24:53 +000043enum DataLayout : byte {
44 NHWC = 0,
45 NCHW = 1
46}
47
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +010048enum ResizeMethod: byte {
49 NearestNeighbor = 0,
50 Bilinear = 1,
51}
52
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +000053table TensorInfo {
54 dimensions:[uint];
55 dataType:DataType;
56 quantizationScale:float = 1.0;
57 quantizationOffset:int = 0;
58}
59
60struct Connection {
61 sourceLayerIndex:uint;
62 outputSlotIndex:uint;
63}
64
65table ByteData {
66 data:[byte];
67}
68
69table ShortData {
70 data:[short];
71}
72
73table IntData {
74 data:[int];
75}
76
77table LongData {
78 data:[long];
79}
80
81union ConstTensorData { ByteData, ShortData, IntData, LongData }
82
83table ConstTensor {
84 info:TensorInfo;
85 data:ConstTensorData;
86}
87
88table InputSlot {
89 index:uint;
90 connection:Connection;
91}
92
93table OutputSlot {
94 index:uint;
95 tensorInfo:TensorInfo;
96}
97
98enum LayerType : uint {
99 Addition = 0,
100 Input = 1,
Sadik Armagan5f450272019-02-12 14:31:45 +0000101 Multiplication = 2,
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000102 Output = 3,
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000103 Pooling2d = 4,
Saoirse Stewart263829c2019-02-19 15:54:14 +0000104 Reshape = 5,
Mike Kellya0766c32019-02-19 17:22:07 +0000105 Softmax = 6,
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000106 Convolution2d = 7,
Mike Kellyaf484012019-02-20 16:53:11 +0000107 DepthwiseConvolution2d = 8,
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000108 Activation = 9,
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000109 Permute = 10,
Conor Kennedy76277882019-02-26 08:29:54 +0000110 FullyConnected = 11,
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000111 Constant = 12,
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000112 SpaceToBatchNd = 13,
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000113 BatchToSpaceNd = 14,
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000114 Division = 15,
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000115 Minimum = 16,
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000116 Equal = 17,
Nina Drozd57728782019-02-27 10:53:27 +0000117 Maximum = 18,
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000118 Normalization = 19,
Sadik Armagan8b42a382019-03-01 14:24:49 +0000119 Pad = 20,
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000120 Rsqrt = 21,
ruoyan018e7fa232019-02-28 15:09:07 +0000121 Floor = 22,
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000122 BatchNormalization = 23,
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000123 Greater = 24,
Conor Kennedyda1f9752019-03-01 14:37:12 +0000124 ResizeBilinear = 25,
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000125 Subtraction = 26,
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000126 StridedSlice = 27,
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000127 Gather = 28,
Jim Flynnac25a1b2019-02-28 10:40:49 +0000128 Mean = 29,
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000129 Merger = 30,
Jim Flynn18ce3382019-03-08 11:08:30 +0000130 L2Normalization = 31,
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000131 Splitter = 32,
Jim Flynn11af3752019-03-19 17:22:29 +0000132 DetectionPostProcess = 33,
Derek Lamberti87acb272019-03-27 16:51:31 +0000133 Lstm = 34,
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000134 Quantize = 35,
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100135 Dequantize = 36,
Sadik Armaganeff363d2019-04-05 15:25:46 +0100136 Merge = 37,
Jim Flynne242f2d2019-05-22 14:24:13 +0100137 Switch = 38,
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100138 Concat = 39,
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100139 SpaceToDepth = 40,
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100140 Prelu = 41,
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100141 TransposeConvolution2d = 42,
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100142 Resize = 43,
Jan Eilers5b01a892019-07-23 09:47:43 +0100143 Stack = 44,
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100144 QuantizedLstm = 45,
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100145 Abs = 46,
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100146 ArgMinMax = 47,
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100147 Slice = 48,
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100148 DepthToSpace = 49,
Sadik Armagan26257852019-10-14 13:00:47 +0100149 InstanceNormalization = 50,
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100150 LogSoftmax = 51,
Aron Virginas-Tar85121a22019-10-23 10:41:35 +0100151 Comparison = 52,
josh minor4a3c6102020-01-06 16:40:46 -0600152 StandIn = 53,
Mike Kellyc9ea45a2020-02-28 18:11:58 +0000153 ElementwiseUnary = 54,
154 Transpose = 55
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000155}
156
157// Base layer table to be used as part of other layers
158table LayerBase {
159 index:uint;
160 layerName:string;
161 layerType:LayerType;
162 inputSlots:[InputSlot];
163 outputSlots:[OutputSlot];
164}
165
166table BindableLayerBase {
167 base:LayerBase;
168 layerBindingId:int;
169}
170
171// Table for each layer defined below
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100172
josh minor4a3c6102020-01-06 16:40:46 -0600173/// @deprecated Use ElementwiseUnaryLayer instead
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100174table AbsLayer {
175 base:LayerBase;
176}
177
Mike Kellyaf484012019-02-20 16:53:11 +0000178table ActivationLayer {
179 base:LayerBase;
180 descriptor:ActivationDescriptor;
181}
182
183table ActivationDescriptor {
Tee Jung86bc3d82019-10-01 11:25:56 +0900184 activationFunction:ActivationFunction = Sigmoid;
Mike Kellyaf484012019-02-20 16:53:11 +0000185 a:float;
186 b:float;
187}
188
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000189table AdditionLayer {
190 base:LayerBase;
191}
192
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100193table ArgMinMaxLayer {
194 base:LayerBase;
195 descriptor:ArgMinMaxDescriptor;
196}
197
198table ArgMinMaxDescriptor{
Tee Jung86bc3d82019-10-01 11:25:56 +0900199 argMinMaxFunction:ArgMinMaxFunction;
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100200 axis:int;
201}
202
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100203enum ComparisonOperation : byte {
204 Equal = 0,
205 Greater = 1,
206 GreaterOrEqual = 2,
207 Less = 3,
208 LessOrEqual = 4,
209 NotEqual = 5
210}
211
212table ComparisonDescriptor {
213 operation:ComparisonOperation;
214}
215
216table ComparisonLayer {
217 base:LayerBase;
218 descriptor:ComparisonDescriptor;
219}
220
Conor Kennedy76277882019-02-26 08:29:54 +0000221table ConstantLayer {
222 base:LayerBase;
223 input:ConstTensor;
224}
225
Mike Kellya0766c32019-02-19 17:22:07 +0000226table Convolution2dLayer {
227 base:LayerBase;
228 descriptor:Convolution2dDescriptor;
229 weights:ConstTensor;
230 biases:ConstTensor;
231}
232
233table Convolution2dDescriptor {
234 padLeft:uint;
235 padRight:uint;
236 padTop:uint;
237 padBottom:uint;
238 strideX:uint;
239 strideY:uint;
Matthew Benthamacad04e2019-05-13 10:02:45 +0100240 dilationX:uint = 1;
241 dilationY:uint = 1;
Mike Kellya0766c32019-02-19 17:22:07 +0000242 biasEnabled:bool = false;
243 dataLayout:DataLayout = NCHW;
244}
245
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100246table DepthToSpaceLayer {
247 base:LayerBase;
248 descriptor:DepthToSpaceDescriptor;
249}
250
251table DepthToSpaceDescriptor {
252 blockSize:uint;
253 dataLayout:DataLayout;
254}
255
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000256table DivisionLayer {
257 base:LayerBase;
258}
259
josh minor4a3c6102020-01-06 16:40:46 -0600260enum UnaryOperation : byte {
261 Abs = 0,
262 Rsqrt = 1,
263 Sqrt = 2,
264 Exp = 3,
265 Neg = 4
266}
267
268table ElementwiseUnaryDescriptor {
269 operation:UnaryOperation;
270}
271
272table ElementwiseUnaryLayer {
273 base:LayerBase;
274 descriptor:ElementwiseUnaryDescriptor;
275}
276
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100277/// @deprecated Use ComparisonLayer instead
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000278table EqualLayer {
279 base:LayerBase;
280}
281
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000282table FloorLayer{
283 base:LayerBase;
284}
285
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000286table FullyConnectedLayer {
287 base:LayerBase;
288 descriptor:FullyConnectedDescriptor;
289 weights:ConstTensor;
290 biases:ConstTensor;
291}
292
293table FullyConnectedDescriptor {
294 biasEnabled:bool = false;
295 transposeWeightsMatrix:bool = false;
296}
297
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000298table GatherLayer {
299 base:LayerBase;
300}
301
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100302/// @deprecated Use ComparisonLayer instead
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000303table GreaterLayer {
304 base:LayerBase;
305}
306
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000307table InputLayer {
308 base:BindableLayerBase;
309}
310
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100311table InstanceNormalizationLayer {
312 base:LayerBase;
313 descriptor:InstanceNormalizationDescriptor;
314}
315
316table InstanceNormalizationDescriptor {
317 gamma:float;
318 beta:float;
319 eps:float;
320 dataLayout:DataLayout;
321}
322
Sadik Armagan26257852019-10-14 13:00:47 +0100323table LogSoftmaxLayer {
324 base:LayerBase;
325 descriptor:LogSoftmaxDescriptor;
326}
327
328table LogSoftmaxDescriptor {
329 beta:float = 1;
330 axis:int = -1;
331}
332
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000333table L2NormalizationLayer {
334 base:LayerBase;
335 descriptor:L2NormalizationDescriptor;
336}
337
338table L2NormalizationDescriptor {
339 dataLayout:DataLayout = NCHW;
Ferran Balaguer0dcffec2019-06-18 16:25:06 +0100340 eps:float = 1e-12;
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000341}
342
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000343table MinimumLayer {
344 base:LayerBase;
345}
346
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000347table MaximumLayer {
348 base:LayerBase;
349}
350
Sadik Armagan5f450272019-02-12 14:31:45 +0000351table MultiplicationLayer {
352 base:LayerBase;
353}
354
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000355table Pooling2dLayer {
356 base:LayerBase;
357 descriptor:Pooling2dDescriptor;
358}
359
360enum PoolingAlgorithm : byte {
361 Max = 0,
362 Average = 1,
363 L2 = 2
364}
365
366enum OutputShapeRounding : byte {
367 Floor = 0,
368 Ceiling = 1
369}
370
371enum PaddingMethod : byte {
372 IgnoreValue = 0,
373 Exclude = 1
374}
375
376table Pooling2dDescriptor {
377 poolType:PoolingAlgorithm;
378 padLeft:uint;
379 padRight:uint;
380 padTop:uint;
381 padBottom:uint;
382 poolWidth:uint;
383 poolHeight:uint;
384 strideX:uint;
385 strideY:uint;
386 outputShapeRounding:OutputShapeRounding;
387 paddingMethod:PaddingMethod;
388 dataLayout:DataLayout;
389}
390
Derek Lamberti87acb272019-03-27 16:51:31 +0000391table QuantizeLayer {
392 base:LayerBase;
393}
394
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000395table SoftmaxLayer {
396 base:LayerBase;
397 descriptor:SoftmaxDescriptor;
398}
399
400table SoftmaxDescriptor {
401 beta:float;
402}
403
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000404table DepthwiseConvolution2dLayer {
405 base:LayerBase;
406 descriptor:DepthwiseConvolution2dDescriptor;
407 weights:ConstTensor;
408 biases:ConstTensor;
409}
410
411table DepthwiseConvolution2dDescriptor {
412 padLeft:uint;
413 padRight:uint;
414 padTop:uint;
415 padBottom:uint;
416 strideX:uint;
417 strideY:uint;
Matthew Benthamacad04e2019-05-13 10:02:45 +0100418 dilationX:uint = 1;
419 dilationY:uint = 1;
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000420 biasEnabled:bool = false;
421 dataLayout:DataLayout = NCHW;
422}
423
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000424table OutputLayer {
425 base:BindableLayerBase;
426}
427
Saoirse Stewart263829c2019-02-19 15:54:14 +0000428table ReshapeLayer {
429 base:LayerBase;
430 descriptor:ReshapeDescriptor;
431}
432
433table ReshapeDescriptor {
434 targetShape:[uint];
435}
436
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000437table PermuteLayer {
438 base:LayerBase;
439 descriptor:PermuteDescriptor;
440}
441
442table PermuteDescriptor {
443 dimMappings:[uint];
444}
445
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000446table SpaceToBatchNdLayer {
447 base:LayerBase;
448 descriptor:SpaceToBatchNdDescriptor;
449}
450
451table SpaceToBatchNdDescriptor {
452 blockShape:[uint];
453 padList:[uint];
454 dataLayout:DataLayout;
455}
456
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100457table SpaceToDepthLayer {
458 base:LayerBase;
459 descriptor:SpaceToDepthDescriptor;
460}
461
462table SpaceToDepthDescriptor {
463 blockSize:uint;
464 dataLayout:DataLayout;
465}
466
Conor Kennedyda1f9752019-03-01 14:37:12 +0000467table SubtractionLayer {
468 base:LayerBase;
469}
470
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000471table BatchToSpaceNdLayer {
472 base:LayerBase;
473 descriptor:BatchToSpaceNdDescriptor;
474}
475
476table BatchToSpaceNdDescriptor {
477 blockShape:[uint];
478 crops:[uint];
479 dataLayout:DataLayout;
480}
481
Nina Drozd57728782019-02-27 10:53:27 +0000482enum NormalizationAlgorithmChannel : byte {
483 Across = 0,
484 Within = 1
485}
486
487enum NormalizationAlgorithmMethod : byte {
488 LocalBrightness = 0,
489 LocalContrast = 1
490}
491
492table NormalizationLayer {
493 base:LayerBase;
494 descriptor:NormalizationDescriptor;
495}
496
497table NormalizationDescriptor {
498 normChannelType:NormalizationAlgorithmChannel = Across;
499 normMethodType:NormalizationAlgorithmMethod = LocalBrightness;
500 normSize:uint;
501 alpha:float;
502 beta:float;
503 k:float;
504 dataLayout:DataLayout = NCHW;
505}
506
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000507table MeanLayer {
508 base:LayerBase;
509 descriptor:MeanDescriptor;
510}
511
512table MeanDescriptor {
513 axis:[uint];
514 keepDims:bool = false;
515}
516
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000517table PadLayer {
518 base:LayerBase;
519 descriptor:PadDescriptor;
520}
521
522table PadDescriptor {
523 padList:[uint];
David Monahan34757812019-06-19 11:47:21 +0100524 padValue:float = 0;
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000525}
526
josh minor4a3c6102020-01-06 16:40:46 -0600527/// @deprecated Use ElementwiseUnaryLayer instead
Sadik Armagan8b42a382019-03-01 14:24:49 +0000528table RsqrtLayer {
529 base:LayerBase;
530}
531
ruoyan018e7fa232019-02-28 15:09:07 +0000532table BatchNormalizationLayer {
533 base:LayerBase;
534 descriptor:BatchNormalizationDescriptor;
535 mean:ConstTensor;
536 variance:ConstTensor;
537 beta:ConstTensor;
538 gamma:ConstTensor;
539}
540
541table BatchNormalizationDescriptor {
542 eps:float;
543 dataLayout:DataLayout;
544}
545
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100546/// @deprecated Use ResizeLayer instead
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000547table ResizeBilinearLayer {
548 base:LayerBase;
549 descriptor:ResizeBilinearDescriptor;
550}
551
552table ResizeBilinearDescriptor {
553 targetWidth:uint;
554 targetHeight:uint;
555 dataLayout:DataLayout;
556}
557
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100558table SliceLayer {
559 base:LayerBase;
560 descriptor:SliceDescriptor;
561}
562
563table SliceDescriptor {
564 begin:[uint];
565 size:[uint];
566}
567
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000568table StridedSliceLayer {
569 base:LayerBase;
570 descriptor:StridedSliceDescriptor;
571}
572
573table StridedSliceDescriptor {
574 begin:[int];
575 end:[int];
576 stride:[int];
577 beginMask:int;
578 endMask:int;
579 shrinkAxisMask:int;
580 ellipsisMask:int;
581 newAxisMask:int;
582 dataLayout:DataLayout;
583}
584
Jim Flynne242f2d2019-05-22 14:24:13 +0100585table ConcatLayer {
586 base:LayerBase;
587 descriptor:OriginsDescriptor;
588}
589
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100590/// @deprecated Use ConcatLayer instead
Jim Flynnac25a1b2019-02-28 10:40:49 +0000591table MergerLayer {
592 base:LayerBase;
593 descriptor:OriginsDescriptor;
594}
595
596table UintVector {
597 data:[uint];
598}
599
600table OriginsDescriptor {
601 concatAxis:uint;
602 numViews:uint;
603 numDimensions:uint;
604 viewOrigins:[UintVector];
605}
606
Jim Flynn18ce3382019-03-08 11:08:30 +0000607table ViewsDescriptor {
608 origins:OriginsDescriptor;
609 viewSizes:[UintVector];
610}
611
612table SplitterLayer {
613 base:LayerBase;
614 descriptor:ViewsDescriptor;
615}
616
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000617table DetectionPostProcessLayer {
618 base:LayerBase;
619 descriptor:DetectionPostProcessDescriptor;
620 anchors:ConstTensor;
621}
622
623table DetectionPostProcessDescriptor {
624 maxDetections:uint;
625 maxClassesPerDetection:uint;
626 detectionsPerClass:uint;
627 nmsScoreThreshold:float;
628 nmsIouThreshold:float;
629 numClasses:uint;
630 useRegularNms:bool;
631 scaleX:float;
632 scaleY:float;
633 scaleW:float;
634 scaleH:float;
635}
636
Jim Flynn11af3752019-03-19 17:22:29 +0000637table LstmInputParams {
638 inputToForgetWeights:ConstTensor;
639 inputToCellWeights:ConstTensor;
640 inputToOutputWeights:ConstTensor;
641 recurrentToForgetWeights:ConstTensor;
642 recurrentToCellWeights:ConstTensor;
643 recurrentToOutputWeights:ConstTensor;
644 forgetGateBias:ConstTensor;
645 cellBias:ConstTensor;
646 outputGateBias:ConstTensor;
647
648 inputToInputWeights:ConstTensor;
649 recurrentToInputWeights:ConstTensor;
650 cellToInputWeights:ConstTensor;
651 inputGateBias:ConstTensor;
652
653 projectionWeights:ConstTensor;
654 projectionBias:ConstTensor;
655
656 cellToForgetWeights:ConstTensor;
657 cellToOutputWeights:ConstTensor;
Jan Eilersf8c62972019-07-17 11:07:49 +0100658
659 inputLayerNormWeights:ConstTensor;
660 forgetLayerNormWeights:ConstTensor;
661 cellLayerNormWeights:ConstTensor;
662 outputLayerNormWeights:ConstTensor;
Jim Flynn11af3752019-03-19 17:22:29 +0000663}
664
Jan Eilers5b01a892019-07-23 09:47:43 +0100665table QuantizedLstmInputParams {
666 inputToInputWeights:ConstTensor;
667 inputToForgetWeights:ConstTensor;
668 inputToCellWeights:ConstTensor;
669 inputToOutputWeights:ConstTensor;
670
671 recurrentToInputWeights:ConstTensor;
672 recurrentToForgetWeights:ConstTensor;
673 recurrentToCellWeights:ConstTensor;
674 recurrentToOutputWeights:ConstTensor;
675
676 inputGateBias:ConstTensor;
677 forgetGateBias:ConstTensor;
678 cellBias:ConstTensor;
679 outputGateBias:ConstTensor;
680}
681
Jim Flynn11af3752019-03-19 17:22:29 +0000682table LstmDescriptor {
683 activationFunc:uint;
684 clippingThresCell:float;
685 clippingThresProj:float;
686 cifgEnabled:bool = true;
687 peepholeEnabled:bool = false;
688 projectionEnabled:bool = false;
Jan Eilersf8c62972019-07-17 11:07:49 +0100689 layerNormEnabled:bool = false;
Jim Flynn11af3752019-03-19 17:22:29 +0000690}
691
692table LstmLayer {
693 base:LayerBase;
694 descriptor:LstmDescriptor;
695 inputParams:LstmInputParams;
696}
697
Jan Eilers5b01a892019-07-23 09:47:43 +0100698table QuantizedLstmLayer {
699 base:LayerBase;
700 inputParams:QuantizedLstmInputParams;
701}
702
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000703table DequantizeLayer {
704 base:LayerBase;
705}
706
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100707table MergeLayer {
708 base:LayerBase;
709}
710
Sadik Armaganeff363d2019-04-05 15:25:46 +0100711table SwitchLayer {
712 base:LayerBase;
713}
714
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100715table PreluLayer {
716 base:LayerBase;
717}
718
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100719table TransposeConvolution2dLayer {
720 base:LayerBase;
721 descriptor:TransposeConvolution2dDescriptor;
722 weights:ConstTensor;
723 biases:ConstTensor;
724}
725
726table TransposeConvolution2dDescriptor {
727 padLeft:uint;
728 padRight:uint;
729 padTop:uint;
730 padBottom:uint;
731 strideX:uint;
732 strideY:uint;
733 biasEnabled:bool = false;
734 dataLayout:DataLayout = NCHW;
735}
736
Mike Kellyc9ea45a2020-02-28 18:11:58 +0000737table TransposeLayer {
738 base:LayerBase;
739 descriptor:TransposeDescriptor;
740}
741
742table TransposeDescriptor {
743 dimMappings:[uint];
744}
745
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100746table ResizeLayer {
747 base:LayerBase;
748 descriptor:ResizeDescriptor;
749}
750
751table ResizeDescriptor {
752 targetHeight:uint;
753 targetWidth:uint;
754 method:ResizeMethod = NearestNeighbor;
755 dataLayout:DataLayout;
756}
757
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100758table StackLayer {
759 base:LayerBase;
760 descriptor:StackDescriptor;
761}
762
763table StackDescriptor {
764 axis:uint;
765 numInputs:uint;
766 inputShape:[uint];
767}
768
Aron Virginas-Tar85121a22019-10-23 10:41:35 +0100769table StandInDescriptor {
770 numInputs:uint;
771 numOutputs:uint;
772}
773
774table StandInLayer {
775 base:LayerBase;
776 descriptor:StandInDescriptor;
777}
778
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000779union Layer {
Mike Kellyaf484012019-02-20 16:53:11 +0000780 ActivationLayer,
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000781 AdditionLayer,
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000782 BatchToSpaceNdLayer,
ruoyan018e7fa232019-02-28 15:09:07 +0000783 BatchNormalizationLayer,
Conor Kennedy76277882019-02-26 08:29:54 +0000784 ConstantLayer,
Mike Kellya0766c32019-02-19 17:22:07 +0000785 Convolution2dLayer,
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000786 DepthwiseConvolution2dLayer,
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000787 FullyConnectedLayer,
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000788 InputLayer,
Sadik Armagan5f450272019-02-12 14:31:45 +0000789 MultiplicationLayer,
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000790 OutputLayer,
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000791 PermuteLayer,
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000792 Pooling2dLayer,
Saoirse Stewart263829c2019-02-19 15:54:14 +0000793 ReshapeLayer,
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000794 SoftmaxLayer,
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000795 SpaceToBatchNdLayer,
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000796 DivisionLayer,
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000797 MinimumLayer,
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000798 EqualLayer,
Nina Drozd57728782019-02-27 10:53:27 +0000799 MaximumLayer,
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000800 NormalizationLayer,
Sadik Armagan8b42a382019-03-01 14:24:49 +0000801 PadLayer,
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000802 RsqrtLayer,
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000803 FloorLayer,
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000804 GreaterLayer,
Conor Kennedyda1f9752019-03-01 14:37:12 +0000805 ResizeBilinearLayer,
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000806 SubtractionLayer,
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000807 StridedSliceLayer,
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000808 GatherLayer,
Jim Flynnac25a1b2019-02-28 10:40:49 +0000809 MeanLayer,
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000810 MergerLayer,
Jim Flynn18ce3382019-03-08 11:08:30 +0000811 L2NormalizationLayer,
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000812 SplitterLayer,
Jim Flynn11af3752019-03-19 17:22:29 +0000813 DetectionPostProcessLayer,
Derek Lamberti87acb272019-03-27 16:51:31 +0000814 LstmLayer,
Jan Eilers5b01a892019-07-23 09:47:43 +0100815 QuantizedLstmLayer,
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000816 QuantizeLayer,
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100817 DequantizeLayer,
Sadik Armaganeff363d2019-04-05 15:25:46 +0100818 MergeLayer,
Jim Flynne242f2d2019-05-22 14:24:13 +0100819 SwitchLayer,
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100820 ConcatLayer,
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100821 SpaceToDepthLayer,
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100822 PreluLayer,
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100823 TransposeConvolution2dLayer,
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100824 ResizeLayer,
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100825 StackLayer,
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100826 AbsLayer,
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100827 ArgMinMaxLayer,
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100828 SliceLayer,
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100829 DepthToSpaceLayer,
Sadik Armagan26257852019-10-14 13:00:47 +0100830 InstanceNormalizationLayer,
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100831 LogSoftmaxLayer,
Aron Virginas-Tar85121a22019-10-23 10:41:35 +0100832 ComparisonLayer,
josh minor4a3c6102020-01-06 16:40:46 -0600833 StandInLayer,
Mike Kellyc9ea45a2020-02-28 18:11:58 +0000834 ElementwiseUnaryLayer,
835 TransposeLayer
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000836}
837
Saoirse Stewart49dbe0e2019-02-05 17:27:06 +0000838table AnyLayer {
839 layer:Layer;
840}
841
Tee Jungaa920c52019-11-05 10:48:25 +0000842table FeatureCompatibilityVersions {
843 bindingIdsScheme:uint = 0;
844}
845
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000846// Root type for serialized data is the graph of the network
847table SerializedGraph {
Saoirse Stewart49dbe0e2019-02-05 17:27:06 +0000848 layers:[AnyLayer];
Tee Jungaa920c52019-11-05 10:48:25 +0000849 inputIds:[int];
850 outputIds:[int];
851 featureVersions:FeatureCompatibilityVersions;
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000852}
853
854root_type SerializedGraph;