blob: 1c9a1de792c8bb67c579fd4807630b2e43912e2a [file] [log] [blame]
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +00001//
Teresa Charlin52664732020-06-29 16:27:03 +01002// Copyright © 2017 Arm Ltd and Contributors. All rights reserved.
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +00003// 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,
Sadik Armagan1a84fe32020-03-27 15:56:57 +000041 QAsymmS8 = 8,
Mike Kelly1f140f72021-04-06 12:25:55 +010042 QSymmS8 = 9,
43 Signed64 = 10
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +000044}
45
Saoirse Stewart3166c3e2019-02-18 15:24:53 +000046enum DataLayout : byte {
47 NHWC = 0,
48 NCHW = 1
49}
50
Sadik Armagan0c3ea5b2021-02-03 09:29:30 +000051enum ReduceOperation: byte {
52 Sum = 0,
53 Max = 1,
54 Mean = 2,
55 Min = 3
56}
57
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +010058enum ResizeMethod: byte {
59 NearestNeighbor = 0,
60 Bilinear = 1,
61}
62
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +000063table TensorInfo {
64 dimensions:[uint];
65 dataType:DataType;
Sadik Armagan1a84fe32020-03-27 15:56:57 +000066 quantizationScale:float = 1.0; // @deprecated Use quantizationScales instead
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +000067 quantizationOffset:int = 0;
Sadik Armagan1a84fe32020-03-27 15:56:57 +000068 quantizationScales:[float];
69 quantizationDim:uint;
Finn Williams2605b232020-06-10 15:53:46 +010070 dimensionality:uint = 1;
Colm Donelan800b2812021-02-12 12:43:35 +000071 dimensionSpecificity:[bool];
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +000072}
73
74struct Connection {
75 sourceLayerIndex:uint;
76 outputSlotIndex:uint;
77}
78
79table ByteData {
80 data:[byte];
81}
82
83table ShortData {
84 data:[short];
85}
86
87table IntData {
88 data:[int];
89}
90
91table LongData {
92 data:[long];
93}
94
95union ConstTensorData { ByteData, ShortData, IntData, LongData }
96
97table ConstTensor {
98 info:TensorInfo;
99 data:ConstTensorData;
100}
101
102table InputSlot {
103 index:uint;
104 connection:Connection;
105}
106
107table OutputSlot {
108 index:uint;
109 tensorInfo:TensorInfo;
110}
111
112enum LayerType : uint {
113 Addition = 0,
114 Input = 1,
Sadik Armagan5f450272019-02-12 14:31:45 +0000115 Multiplication = 2,
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000116 Output = 3,
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000117 Pooling2d = 4,
Saoirse Stewart263829c2019-02-19 15:54:14 +0000118 Reshape = 5,
Mike Kellya0766c32019-02-19 17:22:07 +0000119 Softmax = 6,
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000120 Convolution2d = 7,
Mike Kellyaf484012019-02-20 16:53:11 +0000121 DepthwiseConvolution2d = 8,
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000122 Activation = 9,
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000123 Permute = 10,
Conor Kennedy76277882019-02-26 08:29:54 +0000124 FullyConnected = 11,
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000125 Constant = 12,
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000126 SpaceToBatchNd = 13,
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000127 BatchToSpaceNd = 14,
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000128 Division = 15,
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000129 Minimum = 16,
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000130 Equal = 17,
Nina Drozd57728782019-02-27 10:53:27 +0000131 Maximum = 18,
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000132 Normalization = 19,
Sadik Armagan8b42a382019-03-01 14:24:49 +0000133 Pad = 20,
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000134 Rsqrt = 21,
ruoyan018e7fa232019-02-28 15:09:07 +0000135 Floor = 22,
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000136 BatchNormalization = 23,
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000137 Greater = 24,
Conor Kennedyda1f9752019-03-01 14:37:12 +0000138 ResizeBilinear = 25,
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000139 Subtraction = 26,
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000140 StridedSlice = 27,
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000141 Gather = 28,
Jim Flynnac25a1b2019-02-28 10:40:49 +0000142 Mean = 29,
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000143 Merger = 30,
Jim Flynn18ce3382019-03-08 11:08:30 +0000144 L2Normalization = 31,
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000145 Splitter = 32,
Jim Flynn11af3752019-03-19 17:22:29 +0000146 DetectionPostProcess = 33,
Derek Lamberti87acb272019-03-27 16:51:31 +0000147 Lstm = 34,
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000148 Quantize = 35,
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100149 Dequantize = 36,
Sadik Armaganeff363d2019-04-05 15:25:46 +0100150 Merge = 37,
Jim Flynne242f2d2019-05-22 14:24:13 +0100151 Switch = 38,
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100152 Concat = 39,
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100153 SpaceToDepth = 40,
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100154 Prelu = 41,
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100155 TransposeConvolution2d = 42,
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100156 Resize = 43,
Jan Eilers5b01a892019-07-23 09:47:43 +0100157 Stack = 44,
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100158 QuantizedLstm = 45,
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100159 Abs = 46,
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100160 ArgMinMax = 47,
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100161 Slice = 48,
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100162 DepthToSpace = 49,
Sadik Armagan26257852019-10-14 13:00:47 +0100163 InstanceNormalization = 50,
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100164 LogSoftmax = 51,
Aron Virginas-Tar85121a22019-10-23 10:41:35 +0100165 Comparison = 52,
josh minor4a3c6102020-01-06 16:40:46 -0600166 StandIn = 53,
Mike Kellyc9ea45a2020-02-28 18:11:58 +0000167 ElementwiseUnary = 54,
James Conroy8d333182020-05-13 10:27:58 +0100168 Transpose = 55,
Keith Davis300ad562020-06-04 16:34:23 +0100169 QLstm = 56,
Finn Williams2605b232020-06-10 15:53:46 +0100170 Fill = 57,
James Conroyaba90cd2020-11-06 16:28:18 +0000171 Rank = 58,
Sadik Armagan0c3ea5b2021-02-03 09:29:30 +0000172 LogicalBinary = 59,
mathad01b392e982021-04-07 12:07:30 +0100173 Reduce = 60,
174 Cast = 61
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000175}
176
177// Base layer table to be used as part of other layers
178table LayerBase {
179 index:uint;
180 layerName:string;
181 layerType:LayerType;
182 inputSlots:[InputSlot];
183 outputSlots:[OutputSlot];
184}
185
186table BindableLayerBase {
187 base:LayerBase;
188 layerBindingId:int;
189}
190
191// Table for each layer defined below
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100192
josh minor4a3c6102020-01-06 16:40:46 -0600193/// @deprecated Use ElementwiseUnaryLayer instead
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100194table AbsLayer {
195 base:LayerBase;
196}
197
Mike Kellyaf484012019-02-20 16:53:11 +0000198table ActivationLayer {
199 base:LayerBase;
200 descriptor:ActivationDescriptor;
201}
202
203table ActivationDescriptor {
Tee Jung86bc3d82019-10-01 11:25:56 +0900204 activationFunction:ActivationFunction = Sigmoid;
Mike Kellyaf484012019-02-20 16:53:11 +0000205 a:float;
206 b:float;
207}
208
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000209table AdditionLayer {
210 base:LayerBase;
211}
212
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100213table ArgMinMaxLayer {
214 base:LayerBase;
215 descriptor:ArgMinMaxDescriptor;
216}
217
218table ArgMinMaxDescriptor{
Tee Jung86bc3d82019-10-01 11:25:56 +0900219 argMinMaxFunction:ArgMinMaxFunction;
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100220 axis:int;
221}
222
mathad01b392e982021-04-07 12:07:30 +0100223table CastLayer {
224 base:LayerBase;
225}
226
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100227enum ComparisonOperation : byte {
228 Equal = 0,
229 Greater = 1,
230 GreaterOrEqual = 2,
231 Less = 3,
232 LessOrEqual = 4,
233 NotEqual = 5
234}
235
236table ComparisonDescriptor {
237 operation:ComparisonOperation;
238}
239
240table ComparisonLayer {
241 base:LayerBase;
242 descriptor:ComparisonDescriptor;
243}
244
Conor Kennedy76277882019-02-26 08:29:54 +0000245table ConstantLayer {
246 base:LayerBase;
247 input:ConstTensor;
248}
249
Mike Kellya0766c32019-02-19 17:22:07 +0000250table Convolution2dLayer {
251 base:LayerBase;
252 descriptor:Convolution2dDescriptor;
253 weights:ConstTensor;
254 biases:ConstTensor;
255}
256
257table Convolution2dDescriptor {
258 padLeft:uint;
259 padRight:uint;
260 padTop:uint;
261 padBottom:uint;
262 strideX:uint;
263 strideY:uint;
Matthew Benthamacad04e2019-05-13 10:02:45 +0100264 dilationX:uint = 1;
265 dilationY:uint = 1;
Mike Kellya0766c32019-02-19 17:22:07 +0000266 biasEnabled:bool = false;
267 dataLayout:DataLayout = NCHW;
268}
269
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100270table DepthToSpaceLayer {
271 base:LayerBase;
272 descriptor:DepthToSpaceDescriptor;
273}
274
275table DepthToSpaceDescriptor {
276 blockSize:uint;
277 dataLayout:DataLayout;
278}
279
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000280table DivisionLayer {
281 base:LayerBase;
282}
283
josh minor4a3c6102020-01-06 16:40:46 -0600284enum UnaryOperation : byte {
285 Abs = 0,
286 Rsqrt = 1,
287 Sqrt = 2,
288 Exp = 3,
James Conroyaba90cd2020-11-06 16:28:18 +0000289 Neg = 4,
290 LogicalNot = 5
josh minor4a3c6102020-01-06 16:40:46 -0600291}
292
293table ElementwiseUnaryDescriptor {
294 operation:UnaryOperation;
295}
296
297table ElementwiseUnaryLayer {
298 base:LayerBase;
299 descriptor:ElementwiseUnaryDescriptor;
300}
301
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100302/// @deprecated Use ComparisonLayer instead
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000303table EqualLayer {
304 base:LayerBase;
305}
306
Keith Davis300ad562020-06-04 16:34:23 +0100307table FillLayer {
308 base:LayerBase;
309 descriptor:FillDescriptor;
310}
311
312table FillDescriptor {
313 value:float;
314}
315
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000316table FloorLayer{
317 base:LayerBase;
318}
319
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000320table FullyConnectedLayer {
321 base:LayerBase;
322 descriptor:FullyConnectedDescriptor;
323 weights:ConstTensor;
324 biases:ConstTensor;
325}
326
327table FullyConnectedDescriptor {
328 biasEnabled:bool = false;
329 transposeWeightsMatrix:bool = false;
Sadik Armaganf0a6dec2021-03-25 07:46:55 +0000330 constantWeights:bool = true;
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000331}
332
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000333table GatherLayer {
334 base:LayerBase;
Teresa Charlin52664732020-06-29 16:27:03 +0100335 descriptor:GatherDescriptor;
336}
337
338table GatherDescriptor {
339 axis:int = 0;
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000340}
341
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100342/// @deprecated Use ComparisonLayer instead
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000343table GreaterLayer {
344 base:LayerBase;
345}
346
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000347table InputLayer {
348 base:BindableLayerBase;
349}
350
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100351table InstanceNormalizationLayer {
352 base:LayerBase;
353 descriptor:InstanceNormalizationDescriptor;
354}
355
356table InstanceNormalizationDescriptor {
357 gamma:float;
358 beta:float;
359 eps:float;
360 dataLayout:DataLayout;
361}
362
Sadik Armagan26257852019-10-14 13:00:47 +0100363table LogSoftmaxLayer {
364 base:LayerBase;
365 descriptor:LogSoftmaxDescriptor;
366}
367
368table LogSoftmaxDescriptor {
369 beta:float = 1;
370 axis:int = -1;
371}
372
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000373table L2NormalizationLayer {
374 base:LayerBase;
375 descriptor:L2NormalizationDescriptor;
376}
377
378table L2NormalizationDescriptor {
379 dataLayout:DataLayout = NCHW;
Ferran Balaguer0dcffec2019-06-18 16:25:06 +0100380 eps:float = 1e-12;
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000381}
382
James Conroyaba90cd2020-11-06 16:28:18 +0000383enum LogicalBinaryOperation : byte {
384 LogicalAnd = 0,
385 LogicalOr = 1
386}
387
388table LogicalBinaryDescriptor {
389 operation:LogicalBinaryOperation;
390}
391
392table LogicalBinaryLayer {
393 base:LayerBase;
394 descriptor:LogicalBinaryDescriptor;
395}
396
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000397table MinimumLayer {
398 base:LayerBase;
399}
400
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000401table MaximumLayer {
402 base:LayerBase;
403}
404
Sadik Armagan5f450272019-02-12 14:31:45 +0000405table MultiplicationLayer {
406 base:LayerBase;
407}
408
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000409table Pooling2dLayer {
410 base:LayerBase;
411 descriptor:Pooling2dDescriptor;
412}
413
414enum PoolingAlgorithm : byte {
415 Max = 0,
416 Average = 1,
417 L2 = 2
418}
419
420enum OutputShapeRounding : byte {
421 Floor = 0,
422 Ceiling = 1
423}
424
425enum PaddingMethod : byte {
426 IgnoreValue = 0,
427 Exclude = 1
428}
429
430table Pooling2dDescriptor {
431 poolType:PoolingAlgorithm;
432 padLeft:uint;
433 padRight:uint;
434 padTop:uint;
435 padBottom:uint;
436 poolWidth:uint;
437 poolHeight:uint;
438 strideX:uint;
439 strideY:uint;
440 outputShapeRounding:OutputShapeRounding;
441 paddingMethod:PaddingMethod;
442 dataLayout:DataLayout;
443}
444
Derek Lamberti87acb272019-03-27 16:51:31 +0000445table QuantizeLayer {
446 base:LayerBase;
447}
448
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000449table SoftmaxLayer {
450 base:LayerBase;
451 descriptor:SoftmaxDescriptor;
452}
453
454table SoftmaxDescriptor {
455 beta:float;
456}
457
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000458table DepthwiseConvolution2dLayer {
459 base:LayerBase;
460 descriptor:DepthwiseConvolution2dDescriptor;
461 weights:ConstTensor;
462 biases:ConstTensor;
463}
464
465table DepthwiseConvolution2dDescriptor {
466 padLeft:uint;
467 padRight:uint;
468 padTop:uint;
469 padBottom:uint;
470 strideX:uint;
471 strideY:uint;
Matthew Benthamacad04e2019-05-13 10:02:45 +0100472 dilationX:uint = 1;
473 dilationY:uint = 1;
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000474 biasEnabled:bool = false;
475 dataLayout:DataLayout = NCHW;
476}
477
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000478table OutputLayer {
479 base:BindableLayerBase;
480}
481
Saoirse Stewart263829c2019-02-19 15:54:14 +0000482table ReshapeLayer {
483 base:LayerBase;
484 descriptor:ReshapeDescriptor;
485}
486
487table ReshapeDescriptor {
488 targetShape:[uint];
489}
490
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000491table PermuteLayer {
492 base:LayerBase;
493 descriptor:PermuteDescriptor;
494}
495
496table PermuteDescriptor {
497 dimMappings:[uint];
498}
499
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000500table SpaceToBatchNdLayer {
501 base:LayerBase;
502 descriptor:SpaceToBatchNdDescriptor;
503}
504
505table SpaceToBatchNdDescriptor {
506 blockShape:[uint];
507 padList:[uint];
508 dataLayout:DataLayout;
509}
510
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100511table SpaceToDepthLayer {
512 base:LayerBase;
513 descriptor:SpaceToDepthDescriptor;
514}
515
516table SpaceToDepthDescriptor {
517 blockSize:uint;
518 dataLayout:DataLayout;
519}
520
Conor Kennedyda1f9752019-03-01 14:37:12 +0000521table SubtractionLayer {
522 base:LayerBase;
523}
524
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000525table BatchToSpaceNdLayer {
526 base:LayerBase;
527 descriptor:BatchToSpaceNdDescriptor;
528}
529
530table BatchToSpaceNdDescriptor {
531 blockShape:[uint];
532 crops:[uint];
533 dataLayout:DataLayout;
534}
535
Nina Drozd57728782019-02-27 10:53:27 +0000536enum NormalizationAlgorithmChannel : byte {
537 Across = 0,
538 Within = 1
539}
540
541enum NormalizationAlgorithmMethod : byte {
542 LocalBrightness = 0,
543 LocalContrast = 1
544}
545
546table NormalizationLayer {
547 base:LayerBase;
548 descriptor:NormalizationDescriptor;
549}
550
551table NormalizationDescriptor {
552 normChannelType:NormalizationAlgorithmChannel = Across;
553 normMethodType:NormalizationAlgorithmMethod = LocalBrightness;
554 normSize:uint;
555 alpha:float;
556 beta:float;
557 k:float;
558 dataLayout:DataLayout = NCHW;
559}
560
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000561table MeanLayer {
562 base:LayerBase;
563 descriptor:MeanDescriptor;
564}
565
566table MeanDescriptor {
567 axis:[uint];
568 keepDims:bool = false;
569}
570
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000571table PadLayer {
572 base:LayerBase;
573 descriptor:PadDescriptor;
574}
575
576table PadDescriptor {
577 padList:[uint];
David Monahan34757812019-06-19 11:47:21 +0100578 padValue:float = 0;
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000579}
580
josh minor4a3c6102020-01-06 16:40:46 -0600581/// @deprecated Use ElementwiseUnaryLayer instead
Sadik Armagan8b42a382019-03-01 14:24:49 +0000582table RsqrtLayer {
583 base:LayerBase;
584}
585
ruoyan018e7fa232019-02-28 15:09:07 +0000586table BatchNormalizationLayer {
587 base:LayerBase;
588 descriptor:BatchNormalizationDescriptor;
589 mean:ConstTensor;
590 variance:ConstTensor;
591 beta:ConstTensor;
592 gamma:ConstTensor;
593}
594
595table BatchNormalizationDescriptor {
596 eps:float;
597 dataLayout:DataLayout;
598}
599
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100600/// @deprecated Use ResizeLayer instead
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000601table ResizeBilinearLayer {
602 base:LayerBase;
603 descriptor:ResizeBilinearDescriptor;
604}
605
606table ResizeBilinearDescriptor {
607 targetWidth:uint;
608 targetHeight:uint;
609 dataLayout:DataLayout;
David Monahan4a0c9b92020-05-30 09:48:39 +0100610 alignCorners:bool;
611 halfPixelCenters:bool;
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000612}
613
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100614table SliceLayer {
615 base:LayerBase;
616 descriptor:SliceDescriptor;
617}
618
619table SliceDescriptor {
620 begin:[uint];
621 size:[uint];
622}
623
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000624table StridedSliceLayer {
625 base:LayerBase;
626 descriptor:StridedSliceDescriptor;
627}
628
629table StridedSliceDescriptor {
630 begin:[int];
631 end:[int];
632 stride:[int];
633 beginMask:int;
634 endMask:int;
635 shrinkAxisMask:int;
636 ellipsisMask:int;
637 newAxisMask:int;
638 dataLayout:DataLayout;
639}
640
Jim Flynne242f2d2019-05-22 14:24:13 +0100641table ConcatLayer {
642 base:LayerBase;
643 descriptor:OriginsDescriptor;
644}
645
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100646/// @deprecated Use ConcatLayer instead
Jim Flynnac25a1b2019-02-28 10:40:49 +0000647table MergerLayer {
648 base:LayerBase;
649 descriptor:OriginsDescriptor;
650}
651
652table UintVector {
653 data:[uint];
654}
655
656table OriginsDescriptor {
657 concatAxis:uint;
658 numViews:uint;
659 numDimensions:uint;
660 viewOrigins:[UintVector];
661}
662
Jim Flynn18ce3382019-03-08 11:08:30 +0000663table ViewsDescriptor {
664 origins:OriginsDescriptor;
665 viewSizes:[UintVector];
666}
667
668table SplitterLayer {
669 base:LayerBase;
670 descriptor:ViewsDescriptor;
671}
672
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000673table DetectionPostProcessLayer {
674 base:LayerBase;
675 descriptor:DetectionPostProcessDescriptor;
676 anchors:ConstTensor;
677}
678
679table DetectionPostProcessDescriptor {
680 maxDetections:uint;
681 maxClassesPerDetection:uint;
682 detectionsPerClass:uint;
683 nmsScoreThreshold:float;
684 nmsIouThreshold:float;
685 numClasses:uint;
686 useRegularNms:bool;
687 scaleX:float;
688 scaleY:float;
689 scaleW:float;
690 scaleH:float;
691}
692
Jim Flynn11af3752019-03-19 17:22:29 +0000693table LstmInputParams {
694 inputToForgetWeights:ConstTensor;
695 inputToCellWeights:ConstTensor;
696 inputToOutputWeights:ConstTensor;
697 recurrentToForgetWeights:ConstTensor;
698 recurrentToCellWeights:ConstTensor;
699 recurrentToOutputWeights:ConstTensor;
700 forgetGateBias:ConstTensor;
701 cellBias:ConstTensor;
702 outputGateBias:ConstTensor;
703
704 inputToInputWeights:ConstTensor;
705 recurrentToInputWeights:ConstTensor;
706 cellToInputWeights:ConstTensor;
707 inputGateBias:ConstTensor;
708
709 projectionWeights:ConstTensor;
710 projectionBias:ConstTensor;
711
712 cellToForgetWeights:ConstTensor;
713 cellToOutputWeights:ConstTensor;
Jan Eilersf8c62972019-07-17 11:07:49 +0100714
715 inputLayerNormWeights:ConstTensor;
716 forgetLayerNormWeights:ConstTensor;
717 cellLayerNormWeights:ConstTensor;
718 outputLayerNormWeights:ConstTensor;
Jim Flynn11af3752019-03-19 17:22:29 +0000719}
720
James Conroy8d333182020-05-13 10:27:58 +0100721table LstmDescriptor {
722 activationFunc:uint;
723 clippingThresCell:float;
724 clippingThresProj:float;
725 cifgEnabled:bool = true;
726 peepholeEnabled:bool = false;
727 projectionEnabled:bool = false;
728 layerNormEnabled:bool = false;
729}
730
731table LstmLayer {
732 base:LayerBase;
733 descriptor:LstmDescriptor;
734 inputParams:LstmInputParams;
735}
736
737table QLstmInputParams {
738 // Mandatory
739 inputToForgetWeights:ConstTensor;
740 inputToCellWeights:ConstTensor;
741 inputToOutputWeights:ConstTensor;
742
743 recurrentToForgetWeights:ConstTensor;
744 recurrentToCellWeights:ConstTensor;
745 recurrentToOutputWeights:ConstTensor;
746
747 forgetGateBias:ConstTensor;
748 cellBias:ConstTensor;
749 outputGateBias:ConstTensor;
750
751 // CIFG
752 inputToInputWeights:ConstTensor;
753 recurrentToInputWeights:ConstTensor;
754 inputGateBias:ConstTensor;
755
756 // Projection
757 projectionWeights:ConstTensor;
758 projectionBias:ConstTensor;
759
760 // Peephole
761 cellToInputWeights:ConstTensor;
762 cellToForgetWeights:ConstTensor;
763 cellToOutputWeights:ConstTensor;
764
765 // Layer norm
766 inputLayerNormWeights:ConstTensor;
767 forgetLayerNormWeights:ConstTensor;
768 cellLayerNormWeights:ConstTensor;
769 outputLayerNormWeights:ConstTensor;
770}
771
772table QLstmDescriptor {
773 cifgEnabled:bool = true;
774 peepholeEnabled:bool = false;
775 projectionEnabled:bool = false;
776 layerNormEnabled:bool = false;
777
778 cellClip:float;
779 projectionClip:float;
780
781 inputIntermediateScale:float;
782 forgetIntermediateScale:float;
783 cellIntermediateScale:float;
784 outputIntermediateScale:float;
785
786 hiddenStateZeroPoint:int;
787 hiddenStateScale:float;
788}
789
790table QLstmLayer {
791 base:LayerBase;
792 descriptor:QLstmDescriptor;
793 inputParams:QLstmInputParams;
794}
795
Jan Eilers5b01a892019-07-23 09:47:43 +0100796table QuantizedLstmInputParams {
797 inputToInputWeights:ConstTensor;
798 inputToForgetWeights:ConstTensor;
799 inputToCellWeights:ConstTensor;
800 inputToOutputWeights:ConstTensor;
801
802 recurrentToInputWeights:ConstTensor;
803 recurrentToForgetWeights:ConstTensor;
804 recurrentToCellWeights:ConstTensor;
805 recurrentToOutputWeights:ConstTensor;
806
807 inputGateBias:ConstTensor;
808 forgetGateBias:ConstTensor;
809 cellBias:ConstTensor;
810 outputGateBias:ConstTensor;
811}
812
Jan Eilers5b01a892019-07-23 09:47:43 +0100813table QuantizedLstmLayer {
814 base:LayerBase;
815 inputParams:QuantizedLstmInputParams;
816}
817
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000818table DequantizeLayer {
819 base:LayerBase;
820}
821
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100822table MergeLayer {
823 base:LayerBase;
824}
825
Sadik Armaganeff363d2019-04-05 15:25:46 +0100826table SwitchLayer {
827 base:LayerBase;
828}
829
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100830table PreluLayer {
831 base:LayerBase;
832}
833
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100834table TransposeConvolution2dLayer {
835 base:LayerBase;
836 descriptor:TransposeConvolution2dDescriptor;
837 weights:ConstTensor;
838 biases:ConstTensor;
839}
840
841table TransposeConvolution2dDescriptor {
842 padLeft:uint;
843 padRight:uint;
844 padTop:uint;
845 padBottom:uint;
846 strideX:uint;
847 strideY:uint;
848 biasEnabled:bool = false;
849 dataLayout:DataLayout = NCHW;
850}
851
Mike Kellyc9ea45a2020-02-28 18:11:58 +0000852table TransposeLayer {
853 base:LayerBase;
854 descriptor:TransposeDescriptor;
855}
856
857table TransposeDescriptor {
858 dimMappings:[uint];
859}
860
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100861table ResizeLayer {
862 base:LayerBase;
863 descriptor:ResizeDescriptor;
864}
865
866table ResizeDescriptor {
867 targetHeight:uint;
868 targetWidth:uint;
869 method:ResizeMethod = NearestNeighbor;
870 dataLayout:DataLayout;
David Monahan4a0c9b92020-05-30 09:48:39 +0100871 alignCorners:bool;
872 halfPixelCenters:bool;
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100873}
874
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100875table StackLayer {
876 base:LayerBase;
877 descriptor:StackDescriptor;
878}
879
880table StackDescriptor {
881 axis:uint;
882 numInputs:uint;
883 inputShape:[uint];
884}
885
Aron Virginas-Tar85121a22019-10-23 10:41:35 +0100886table StandInDescriptor {
887 numInputs:uint;
888 numOutputs:uint;
889}
890
891table StandInLayer {
892 base:LayerBase;
893 descriptor:StandInDescriptor;
894}
895
Finn Williams2605b232020-06-10 15:53:46 +0100896table RankLayer {
897 base:LayerBase;
898}
899
Sadik Armagan0c3ea5b2021-02-03 09:29:30 +0000900table ReduceLayer {
901 base:LayerBase;
902 descriptor:ReduceDescriptor;
903}
904
905table ReduceDescriptor {
Sadik Armagan0c3ea5b2021-02-03 09:29:30 +0000906 keepDims:bool = false;
907 axis:[uint];
908 reduceOperation:ReduceOperation = Sum;
909}
910
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000911union Layer {
Mike Kellyaf484012019-02-20 16:53:11 +0000912 ActivationLayer,
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000913 AdditionLayer,
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000914 BatchToSpaceNdLayer,
ruoyan018e7fa232019-02-28 15:09:07 +0000915 BatchNormalizationLayer,
Conor Kennedy76277882019-02-26 08:29:54 +0000916 ConstantLayer,
Mike Kellya0766c32019-02-19 17:22:07 +0000917 Convolution2dLayer,
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000918 DepthwiseConvolution2dLayer,
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000919 FullyConnectedLayer,
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000920 InputLayer,
Sadik Armagan5f450272019-02-12 14:31:45 +0000921 MultiplicationLayer,
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000922 OutputLayer,
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000923 PermuteLayer,
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000924 Pooling2dLayer,
Saoirse Stewart263829c2019-02-19 15:54:14 +0000925 ReshapeLayer,
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000926 SoftmaxLayer,
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000927 SpaceToBatchNdLayer,
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000928 DivisionLayer,
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000929 MinimumLayer,
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000930 EqualLayer,
Nina Drozd57728782019-02-27 10:53:27 +0000931 MaximumLayer,
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000932 NormalizationLayer,
Sadik Armagan8b42a382019-03-01 14:24:49 +0000933 PadLayer,
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000934 RsqrtLayer,
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000935 FloorLayer,
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000936 GreaterLayer,
Conor Kennedyda1f9752019-03-01 14:37:12 +0000937 ResizeBilinearLayer,
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000938 SubtractionLayer,
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000939 StridedSliceLayer,
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000940 GatherLayer,
Jim Flynnac25a1b2019-02-28 10:40:49 +0000941 MeanLayer,
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000942 MergerLayer,
Jim Flynn18ce3382019-03-08 11:08:30 +0000943 L2NormalizationLayer,
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000944 SplitterLayer,
Jim Flynn11af3752019-03-19 17:22:29 +0000945 DetectionPostProcessLayer,
Derek Lamberti87acb272019-03-27 16:51:31 +0000946 LstmLayer,
Jan Eilers5b01a892019-07-23 09:47:43 +0100947 QuantizedLstmLayer,
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000948 QuantizeLayer,
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100949 DequantizeLayer,
Sadik Armaganeff363d2019-04-05 15:25:46 +0100950 MergeLayer,
Jim Flynne242f2d2019-05-22 14:24:13 +0100951 SwitchLayer,
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100952 ConcatLayer,
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100953 SpaceToDepthLayer,
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100954 PreluLayer,
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100955 TransposeConvolution2dLayer,
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100956 ResizeLayer,
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100957 StackLayer,
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100958 AbsLayer,
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100959 ArgMinMaxLayer,
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100960 SliceLayer,
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100961 DepthToSpaceLayer,
Sadik Armagan26257852019-10-14 13:00:47 +0100962 InstanceNormalizationLayer,
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100963 LogSoftmaxLayer,
Aron Virginas-Tar85121a22019-10-23 10:41:35 +0100964 ComparisonLayer,
josh minor4a3c6102020-01-06 16:40:46 -0600965 StandInLayer,
Mike Kellyc9ea45a2020-02-28 18:11:58 +0000966 ElementwiseUnaryLayer,
James Conroy8d333182020-05-13 10:27:58 +0100967 TransposeLayer,
Keith Davis300ad562020-06-04 16:34:23 +0100968 QLstmLayer,
Finn Williams2605b232020-06-10 15:53:46 +0100969 FillLayer,
James Conroyaba90cd2020-11-06 16:28:18 +0000970 RankLayer,
Sadik Armagan0c3ea5b2021-02-03 09:29:30 +0000971 LogicalBinaryLayer,
mathad01b392e982021-04-07 12:07:30 +0100972 ReduceLayer,
973 CastLayer
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000974}
975
Saoirse Stewart49dbe0e2019-02-05 17:27:06 +0000976table AnyLayer {
977 layer:Layer;
978}
979
Tee Jungaa920c52019-11-05 10:48:25 +0000980table FeatureCompatibilityVersions {
981 bindingIdsScheme:uint = 0;
Jan Eilers53ef7952021-06-02 12:01:25 +0100982 weightsLayoutScheme:uint = 0;
Tee Jungaa920c52019-11-05 10:48:25 +0000983}
984
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000985// Root type for serialized data is the graph of the network
986table SerializedGraph {
Saoirse Stewart49dbe0e2019-02-05 17:27:06 +0000987 layers:[AnyLayer];
Tee Jungaa920c52019-11-05 10:48:25 +0000988 inputIds:[int];
989 outputIds:[int];
990 featureVersions:FeatureCompatibilityVersions;
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000991}
992
Sadik Armagan0c3ea5b2021-02-03 09:29:30 +0000993root_type SerializedGraph;