blob: 88d66f76f5f879a2ddcb46b30fffae561f32942e [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,
42 QSymmS8 = 9
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +000043}
44
Saoirse Stewart3166c3e2019-02-18 15:24:53 +000045enum DataLayout : byte {
46 NHWC = 0,
47 NCHW = 1
48}
49
Sadik Armagan0c3ea5b2021-02-03 09:29:30 +000050enum ReduceOperation: byte {
51 Sum = 0,
52 Max = 1,
53 Mean = 2,
54 Min = 3
55}
56
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +010057enum ResizeMethod: byte {
58 NearestNeighbor = 0,
59 Bilinear = 1,
60}
61
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +000062table TensorInfo {
63 dimensions:[uint];
64 dataType:DataType;
Sadik Armagan1a84fe32020-03-27 15:56:57 +000065 quantizationScale:float = 1.0; // @deprecated Use quantizationScales instead
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +000066 quantizationOffset:int = 0;
Sadik Armagan1a84fe32020-03-27 15:56:57 +000067 quantizationScales:[float];
68 quantizationDim:uint;
Finn Williams2605b232020-06-10 15:53:46 +010069 dimensionality:uint = 1;
Colm Donelan800b2812021-02-12 12:43:35 +000070 dimensionSpecificity:[bool];
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +000071}
72
73struct Connection {
74 sourceLayerIndex:uint;
75 outputSlotIndex:uint;
76}
77
78table ByteData {
79 data:[byte];
80}
81
82table ShortData {
83 data:[short];
84}
85
86table IntData {
87 data:[int];
88}
89
90table LongData {
91 data:[long];
92}
93
94union ConstTensorData { ByteData, ShortData, IntData, LongData }
95
96table ConstTensor {
97 info:TensorInfo;
98 data:ConstTensorData;
99}
100
101table InputSlot {
102 index:uint;
103 connection:Connection;
104}
105
106table OutputSlot {
107 index:uint;
108 tensorInfo:TensorInfo;
109}
110
111enum LayerType : uint {
112 Addition = 0,
113 Input = 1,
Sadik Armagan5f450272019-02-12 14:31:45 +0000114 Multiplication = 2,
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000115 Output = 3,
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000116 Pooling2d = 4,
Saoirse Stewart263829c2019-02-19 15:54:14 +0000117 Reshape = 5,
Mike Kellya0766c32019-02-19 17:22:07 +0000118 Softmax = 6,
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000119 Convolution2d = 7,
Mike Kellyaf484012019-02-20 16:53:11 +0000120 DepthwiseConvolution2d = 8,
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000121 Activation = 9,
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000122 Permute = 10,
Conor Kennedy76277882019-02-26 08:29:54 +0000123 FullyConnected = 11,
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000124 Constant = 12,
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000125 SpaceToBatchNd = 13,
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000126 BatchToSpaceNd = 14,
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000127 Division = 15,
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000128 Minimum = 16,
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000129 Equal = 17,
Nina Drozd57728782019-02-27 10:53:27 +0000130 Maximum = 18,
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000131 Normalization = 19,
Sadik Armagan8b42a382019-03-01 14:24:49 +0000132 Pad = 20,
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000133 Rsqrt = 21,
ruoyan018e7fa232019-02-28 15:09:07 +0000134 Floor = 22,
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000135 BatchNormalization = 23,
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000136 Greater = 24,
Conor Kennedyda1f9752019-03-01 14:37:12 +0000137 ResizeBilinear = 25,
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000138 Subtraction = 26,
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000139 StridedSlice = 27,
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000140 Gather = 28,
Jim Flynnac25a1b2019-02-28 10:40:49 +0000141 Mean = 29,
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000142 Merger = 30,
Jim Flynn18ce3382019-03-08 11:08:30 +0000143 L2Normalization = 31,
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000144 Splitter = 32,
Jim Flynn11af3752019-03-19 17:22:29 +0000145 DetectionPostProcess = 33,
Derek Lamberti87acb272019-03-27 16:51:31 +0000146 Lstm = 34,
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000147 Quantize = 35,
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100148 Dequantize = 36,
Sadik Armaganeff363d2019-04-05 15:25:46 +0100149 Merge = 37,
Jim Flynne242f2d2019-05-22 14:24:13 +0100150 Switch = 38,
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100151 Concat = 39,
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100152 SpaceToDepth = 40,
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100153 Prelu = 41,
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100154 TransposeConvolution2d = 42,
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100155 Resize = 43,
Jan Eilers5b01a892019-07-23 09:47:43 +0100156 Stack = 44,
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100157 QuantizedLstm = 45,
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100158 Abs = 46,
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100159 ArgMinMax = 47,
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100160 Slice = 48,
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100161 DepthToSpace = 49,
Sadik Armagan26257852019-10-14 13:00:47 +0100162 InstanceNormalization = 50,
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100163 LogSoftmax = 51,
Aron Virginas-Tar85121a22019-10-23 10:41:35 +0100164 Comparison = 52,
josh minor4a3c6102020-01-06 16:40:46 -0600165 StandIn = 53,
Mike Kellyc9ea45a2020-02-28 18:11:58 +0000166 ElementwiseUnary = 54,
James Conroy8d333182020-05-13 10:27:58 +0100167 Transpose = 55,
Keith Davis300ad562020-06-04 16:34:23 +0100168 QLstm = 56,
Finn Williams2605b232020-06-10 15:53:46 +0100169 Fill = 57,
James Conroyaba90cd2020-11-06 16:28:18 +0000170 Rank = 58,
Sadik Armagan0c3ea5b2021-02-03 09:29:30 +0000171 LogicalBinary = 59,
172 Reduce = 60
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000173}
174
175// Base layer table to be used as part of other layers
176table LayerBase {
177 index:uint;
178 layerName:string;
179 layerType:LayerType;
180 inputSlots:[InputSlot];
181 outputSlots:[OutputSlot];
182}
183
184table BindableLayerBase {
185 base:LayerBase;
186 layerBindingId:int;
187}
188
189// Table for each layer defined below
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100190
josh minor4a3c6102020-01-06 16:40:46 -0600191/// @deprecated Use ElementwiseUnaryLayer instead
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100192table AbsLayer {
193 base:LayerBase;
194}
195
Mike Kellyaf484012019-02-20 16:53:11 +0000196table ActivationLayer {
197 base:LayerBase;
198 descriptor:ActivationDescriptor;
199}
200
201table ActivationDescriptor {
Tee Jung86bc3d82019-10-01 11:25:56 +0900202 activationFunction:ActivationFunction = Sigmoid;
Mike Kellyaf484012019-02-20 16:53:11 +0000203 a:float;
204 b:float;
205}
206
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000207table AdditionLayer {
208 base:LayerBase;
209}
210
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100211table ArgMinMaxLayer {
212 base:LayerBase;
213 descriptor:ArgMinMaxDescriptor;
214}
215
216table ArgMinMaxDescriptor{
Tee Jung86bc3d82019-10-01 11:25:56 +0900217 argMinMaxFunction:ArgMinMaxFunction;
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100218 axis:int;
219}
220
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100221enum ComparisonOperation : byte {
222 Equal = 0,
223 Greater = 1,
224 GreaterOrEqual = 2,
225 Less = 3,
226 LessOrEqual = 4,
227 NotEqual = 5
228}
229
230table ComparisonDescriptor {
231 operation:ComparisonOperation;
232}
233
234table ComparisonLayer {
235 base:LayerBase;
236 descriptor:ComparisonDescriptor;
237}
238
Conor Kennedy76277882019-02-26 08:29:54 +0000239table ConstantLayer {
240 base:LayerBase;
241 input:ConstTensor;
242}
243
Mike Kellya0766c32019-02-19 17:22:07 +0000244table Convolution2dLayer {
245 base:LayerBase;
246 descriptor:Convolution2dDescriptor;
247 weights:ConstTensor;
248 biases:ConstTensor;
249}
250
251table Convolution2dDescriptor {
252 padLeft:uint;
253 padRight:uint;
254 padTop:uint;
255 padBottom:uint;
256 strideX:uint;
257 strideY:uint;
Matthew Benthamacad04e2019-05-13 10:02:45 +0100258 dilationX:uint = 1;
259 dilationY:uint = 1;
Mike Kellya0766c32019-02-19 17:22:07 +0000260 biasEnabled:bool = false;
261 dataLayout:DataLayout = NCHW;
262}
263
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100264table DepthToSpaceLayer {
265 base:LayerBase;
266 descriptor:DepthToSpaceDescriptor;
267}
268
269table DepthToSpaceDescriptor {
270 blockSize:uint;
271 dataLayout:DataLayout;
272}
273
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000274table DivisionLayer {
275 base:LayerBase;
276}
277
josh minor4a3c6102020-01-06 16:40:46 -0600278enum UnaryOperation : byte {
279 Abs = 0,
280 Rsqrt = 1,
281 Sqrt = 2,
282 Exp = 3,
James Conroyaba90cd2020-11-06 16:28:18 +0000283 Neg = 4,
284 LogicalNot = 5
josh minor4a3c6102020-01-06 16:40:46 -0600285}
286
287table ElementwiseUnaryDescriptor {
288 operation:UnaryOperation;
289}
290
291table ElementwiseUnaryLayer {
292 base:LayerBase;
293 descriptor:ElementwiseUnaryDescriptor;
294}
295
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100296/// @deprecated Use ComparisonLayer instead
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000297table EqualLayer {
298 base:LayerBase;
299}
300
Keith Davis300ad562020-06-04 16:34:23 +0100301table FillLayer {
302 base:LayerBase;
303 descriptor:FillDescriptor;
304}
305
306table FillDescriptor {
307 value:float;
308}
309
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000310table FloorLayer{
311 base:LayerBase;
312}
313
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000314table FullyConnectedLayer {
315 base:LayerBase;
316 descriptor:FullyConnectedDescriptor;
317 weights:ConstTensor;
318 biases:ConstTensor;
319}
320
321table FullyConnectedDescriptor {
322 biasEnabled:bool = false;
323 transposeWeightsMatrix:bool = false;
Sadik Armaganf0a6dec2021-03-25 07:46:55 +0000324 constantWeights:bool = true;
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000325}
326
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000327table GatherLayer {
328 base:LayerBase;
Teresa Charlin52664732020-06-29 16:27:03 +0100329 descriptor:GatherDescriptor;
330}
331
332table GatherDescriptor {
333 axis:int = 0;
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000334}
335
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100336/// @deprecated Use ComparisonLayer instead
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000337table GreaterLayer {
338 base:LayerBase;
339}
340
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000341table InputLayer {
342 base:BindableLayerBase;
343}
344
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100345table InstanceNormalizationLayer {
346 base:LayerBase;
347 descriptor:InstanceNormalizationDescriptor;
348}
349
350table InstanceNormalizationDescriptor {
351 gamma:float;
352 beta:float;
353 eps:float;
354 dataLayout:DataLayout;
355}
356
Sadik Armagan26257852019-10-14 13:00:47 +0100357table LogSoftmaxLayer {
358 base:LayerBase;
359 descriptor:LogSoftmaxDescriptor;
360}
361
362table LogSoftmaxDescriptor {
363 beta:float = 1;
364 axis:int = -1;
365}
366
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000367table L2NormalizationLayer {
368 base:LayerBase;
369 descriptor:L2NormalizationDescriptor;
370}
371
372table L2NormalizationDescriptor {
373 dataLayout:DataLayout = NCHW;
Ferran Balaguer0dcffec2019-06-18 16:25:06 +0100374 eps:float = 1e-12;
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000375}
376
James Conroyaba90cd2020-11-06 16:28:18 +0000377enum LogicalBinaryOperation : byte {
378 LogicalAnd = 0,
379 LogicalOr = 1
380}
381
382table LogicalBinaryDescriptor {
383 operation:LogicalBinaryOperation;
384}
385
386table LogicalBinaryLayer {
387 base:LayerBase;
388 descriptor:LogicalBinaryDescriptor;
389}
390
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000391table MinimumLayer {
392 base:LayerBase;
393}
394
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000395table MaximumLayer {
396 base:LayerBase;
397}
398
Sadik Armagan5f450272019-02-12 14:31:45 +0000399table MultiplicationLayer {
400 base:LayerBase;
401}
402
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000403table Pooling2dLayer {
404 base:LayerBase;
405 descriptor:Pooling2dDescriptor;
406}
407
408enum PoolingAlgorithm : byte {
409 Max = 0,
410 Average = 1,
411 L2 = 2
412}
413
414enum OutputShapeRounding : byte {
415 Floor = 0,
416 Ceiling = 1
417}
418
419enum PaddingMethod : byte {
420 IgnoreValue = 0,
421 Exclude = 1
422}
423
424table Pooling2dDescriptor {
425 poolType:PoolingAlgorithm;
426 padLeft:uint;
427 padRight:uint;
428 padTop:uint;
429 padBottom:uint;
430 poolWidth:uint;
431 poolHeight:uint;
432 strideX:uint;
433 strideY:uint;
434 outputShapeRounding:OutputShapeRounding;
435 paddingMethod:PaddingMethod;
436 dataLayout:DataLayout;
437}
438
Derek Lamberti87acb272019-03-27 16:51:31 +0000439table QuantizeLayer {
440 base:LayerBase;
441}
442
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000443table SoftmaxLayer {
444 base:LayerBase;
445 descriptor:SoftmaxDescriptor;
446}
447
448table SoftmaxDescriptor {
449 beta:float;
450}
451
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000452table DepthwiseConvolution2dLayer {
453 base:LayerBase;
454 descriptor:DepthwiseConvolution2dDescriptor;
455 weights:ConstTensor;
456 biases:ConstTensor;
457}
458
459table DepthwiseConvolution2dDescriptor {
460 padLeft:uint;
461 padRight:uint;
462 padTop:uint;
463 padBottom:uint;
464 strideX:uint;
465 strideY:uint;
Matthew Benthamacad04e2019-05-13 10:02:45 +0100466 dilationX:uint = 1;
467 dilationY:uint = 1;
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000468 biasEnabled:bool = false;
469 dataLayout:DataLayout = NCHW;
470}
471
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000472table OutputLayer {
473 base:BindableLayerBase;
474}
475
Saoirse Stewart263829c2019-02-19 15:54:14 +0000476table ReshapeLayer {
477 base:LayerBase;
478 descriptor:ReshapeDescriptor;
479}
480
481table ReshapeDescriptor {
482 targetShape:[uint];
483}
484
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000485table PermuteLayer {
486 base:LayerBase;
487 descriptor:PermuteDescriptor;
488}
489
490table PermuteDescriptor {
491 dimMappings:[uint];
492}
493
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000494table SpaceToBatchNdLayer {
495 base:LayerBase;
496 descriptor:SpaceToBatchNdDescriptor;
497}
498
499table SpaceToBatchNdDescriptor {
500 blockShape:[uint];
501 padList:[uint];
502 dataLayout:DataLayout;
503}
504
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100505table SpaceToDepthLayer {
506 base:LayerBase;
507 descriptor:SpaceToDepthDescriptor;
508}
509
510table SpaceToDepthDescriptor {
511 blockSize:uint;
512 dataLayout:DataLayout;
513}
514
Conor Kennedyda1f9752019-03-01 14:37:12 +0000515table SubtractionLayer {
516 base:LayerBase;
517}
518
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000519table BatchToSpaceNdLayer {
520 base:LayerBase;
521 descriptor:BatchToSpaceNdDescriptor;
522}
523
524table BatchToSpaceNdDescriptor {
525 blockShape:[uint];
526 crops:[uint];
527 dataLayout:DataLayout;
528}
529
Nina Drozd57728782019-02-27 10:53:27 +0000530enum NormalizationAlgorithmChannel : byte {
531 Across = 0,
532 Within = 1
533}
534
535enum NormalizationAlgorithmMethod : byte {
536 LocalBrightness = 0,
537 LocalContrast = 1
538}
539
540table NormalizationLayer {
541 base:LayerBase;
542 descriptor:NormalizationDescriptor;
543}
544
545table NormalizationDescriptor {
546 normChannelType:NormalizationAlgorithmChannel = Across;
547 normMethodType:NormalizationAlgorithmMethod = LocalBrightness;
548 normSize:uint;
549 alpha:float;
550 beta:float;
551 k:float;
552 dataLayout:DataLayout = NCHW;
553}
554
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000555table MeanLayer {
556 base:LayerBase;
557 descriptor:MeanDescriptor;
558}
559
560table MeanDescriptor {
561 axis:[uint];
562 keepDims:bool = false;
563}
564
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000565table PadLayer {
566 base:LayerBase;
567 descriptor:PadDescriptor;
568}
569
570table PadDescriptor {
571 padList:[uint];
David Monahan34757812019-06-19 11:47:21 +0100572 padValue:float = 0;
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000573}
574
josh minor4a3c6102020-01-06 16:40:46 -0600575/// @deprecated Use ElementwiseUnaryLayer instead
Sadik Armagan8b42a382019-03-01 14:24:49 +0000576table RsqrtLayer {
577 base:LayerBase;
578}
579
ruoyan018e7fa232019-02-28 15:09:07 +0000580table BatchNormalizationLayer {
581 base:LayerBase;
582 descriptor:BatchNormalizationDescriptor;
583 mean:ConstTensor;
584 variance:ConstTensor;
585 beta:ConstTensor;
586 gamma:ConstTensor;
587}
588
589table BatchNormalizationDescriptor {
590 eps:float;
591 dataLayout:DataLayout;
592}
593
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100594/// @deprecated Use ResizeLayer instead
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000595table ResizeBilinearLayer {
596 base:LayerBase;
597 descriptor:ResizeBilinearDescriptor;
598}
599
600table ResizeBilinearDescriptor {
601 targetWidth:uint;
602 targetHeight:uint;
603 dataLayout:DataLayout;
David Monahan4a0c9b92020-05-30 09:48:39 +0100604 alignCorners:bool;
605 halfPixelCenters:bool;
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000606}
607
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100608table SliceLayer {
609 base:LayerBase;
610 descriptor:SliceDescriptor;
611}
612
613table SliceDescriptor {
614 begin:[uint];
615 size:[uint];
616}
617
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000618table StridedSliceLayer {
619 base:LayerBase;
620 descriptor:StridedSliceDescriptor;
621}
622
623table StridedSliceDescriptor {
624 begin:[int];
625 end:[int];
626 stride:[int];
627 beginMask:int;
628 endMask:int;
629 shrinkAxisMask:int;
630 ellipsisMask:int;
631 newAxisMask:int;
632 dataLayout:DataLayout;
633}
634
Jim Flynne242f2d2019-05-22 14:24:13 +0100635table ConcatLayer {
636 base:LayerBase;
637 descriptor:OriginsDescriptor;
638}
639
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100640/// @deprecated Use ConcatLayer instead
Jim Flynnac25a1b2019-02-28 10:40:49 +0000641table MergerLayer {
642 base:LayerBase;
643 descriptor:OriginsDescriptor;
644}
645
646table UintVector {
647 data:[uint];
648}
649
650table OriginsDescriptor {
651 concatAxis:uint;
652 numViews:uint;
653 numDimensions:uint;
654 viewOrigins:[UintVector];
655}
656
Jim Flynn18ce3382019-03-08 11:08:30 +0000657table ViewsDescriptor {
658 origins:OriginsDescriptor;
659 viewSizes:[UintVector];
660}
661
662table SplitterLayer {
663 base:LayerBase;
664 descriptor:ViewsDescriptor;
665}
666
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000667table DetectionPostProcessLayer {
668 base:LayerBase;
669 descriptor:DetectionPostProcessDescriptor;
670 anchors:ConstTensor;
671}
672
673table DetectionPostProcessDescriptor {
674 maxDetections:uint;
675 maxClassesPerDetection:uint;
676 detectionsPerClass:uint;
677 nmsScoreThreshold:float;
678 nmsIouThreshold:float;
679 numClasses:uint;
680 useRegularNms:bool;
681 scaleX:float;
682 scaleY:float;
683 scaleW:float;
684 scaleH:float;
685}
686
Jim Flynn11af3752019-03-19 17:22:29 +0000687table LstmInputParams {
688 inputToForgetWeights:ConstTensor;
689 inputToCellWeights:ConstTensor;
690 inputToOutputWeights:ConstTensor;
691 recurrentToForgetWeights:ConstTensor;
692 recurrentToCellWeights:ConstTensor;
693 recurrentToOutputWeights:ConstTensor;
694 forgetGateBias:ConstTensor;
695 cellBias:ConstTensor;
696 outputGateBias:ConstTensor;
697
698 inputToInputWeights:ConstTensor;
699 recurrentToInputWeights:ConstTensor;
700 cellToInputWeights:ConstTensor;
701 inputGateBias:ConstTensor;
702
703 projectionWeights:ConstTensor;
704 projectionBias:ConstTensor;
705
706 cellToForgetWeights:ConstTensor;
707 cellToOutputWeights:ConstTensor;
Jan Eilersf8c62972019-07-17 11:07:49 +0100708
709 inputLayerNormWeights:ConstTensor;
710 forgetLayerNormWeights:ConstTensor;
711 cellLayerNormWeights:ConstTensor;
712 outputLayerNormWeights:ConstTensor;
Jim Flynn11af3752019-03-19 17:22:29 +0000713}
714
James Conroy8d333182020-05-13 10:27:58 +0100715table LstmDescriptor {
716 activationFunc:uint;
717 clippingThresCell:float;
718 clippingThresProj:float;
719 cifgEnabled:bool = true;
720 peepholeEnabled:bool = false;
721 projectionEnabled:bool = false;
722 layerNormEnabled:bool = false;
723}
724
725table LstmLayer {
726 base:LayerBase;
727 descriptor:LstmDescriptor;
728 inputParams:LstmInputParams;
729}
730
731table QLstmInputParams {
732 // Mandatory
733 inputToForgetWeights:ConstTensor;
734 inputToCellWeights:ConstTensor;
735 inputToOutputWeights:ConstTensor;
736
737 recurrentToForgetWeights:ConstTensor;
738 recurrentToCellWeights:ConstTensor;
739 recurrentToOutputWeights:ConstTensor;
740
741 forgetGateBias:ConstTensor;
742 cellBias:ConstTensor;
743 outputGateBias:ConstTensor;
744
745 // CIFG
746 inputToInputWeights:ConstTensor;
747 recurrentToInputWeights:ConstTensor;
748 inputGateBias:ConstTensor;
749
750 // Projection
751 projectionWeights:ConstTensor;
752 projectionBias:ConstTensor;
753
754 // Peephole
755 cellToInputWeights:ConstTensor;
756 cellToForgetWeights:ConstTensor;
757 cellToOutputWeights:ConstTensor;
758
759 // Layer norm
760 inputLayerNormWeights:ConstTensor;
761 forgetLayerNormWeights:ConstTensor;
762 cellLayerNormWeights:ConstTensor;
763 outputLayerNormWeights:ConstTensor;
764}
765
766table QLstmDescriptor {
767 cifgEnabled:bool = true;
768 peepholeEnabled:bool = false;
769 projectionEnabled:bool = false;
770 layerNormEnabled:bool = false;
771
772 cellClip:float;
773 projectionClip:float;
774
775 inputIntermediateScale:float;
776 forgetIntermediateScale:float;
777 cellIntermediateScale:float;
778 outputIntermediateScale:float;
779
780 hiddenStateZeroPoint:int;
781 hiddenStateScale:float;
782}
783
784table QLstmLayer {
785 base:LayerBase;
786 descriptor:QLstmDescriptor;
787 inputParams:QLstmInputParams;
788}
789
Jan Eilers5b01a892019-07-23 09:47:43 +0100790table QuantizedLstmInputParams {
791 inputToInputWeights:ConstTensor;
792 inputToForgetWeights:ConstTensor;
793 inputToCellWeights:ConstTensor;
794 inputToOutputWeights:ConstTensor;
795
796 recurrentToInputWeights:ConstTensor;
797 recurrentToForgetWeights:ConstTensor;
798 recurrentToCellWeights:ConstTensor;
799 recurrentToOutputWeights:ConstTensor;
800
801 inputGateBias:ConstTensor;
802 forgetGateBias:ConstTensor;
803 cellBias:ConstTensor;
804 outputGateBias:ConstTensor;
805}
806
Jan Eilers5b01a892019-07-23 09:47:43 +0100807table QuantizedLstmLayer {
808 base:LayerBase;
809 inputParams:QuantizedLstmInputParams;
810}
811
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000812table DequantizeLayer {
813 base:LayerBase;
814}
815
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100816table MergeLayer {
817 base:LayerBase;
818}
819
Sadik Armaganeff363d2019-04-05 15:25:46 +0100820table SwitchLayer {
821 base:LayerBase;
822}
823
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100824table PreluLayer {
825 base:LayerBase;
826}
827
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100828table TransposeConvolution2dLayer {
829 base:LayerBase;
830 descriptor:TransposeConvolution2dDescriptor;
831 weights:ConstTensor;
832 biases:ConstTensor;
833}
834
835table TransposeConvolution2dDescriptor {
836 padLeft:uint;
837 padRight:uint;
838 padTop:uint;
839 padBottom:uint;
840 strideX:uint;
841 strideY:uint;
842 biasEnabled:bool = false;
843 dataLayout:DataLayout = NCHW;
844}
845
Mike Kellyc9ea45a2020-02-28 18:11:58 +0000846table TransposeLayer {
847 base:LayerBase;
848 descriptor:TransposeDescriptor;
849}
850
851table TransposeDescriptor {
852 dimMappings:[uint];
853}
854
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100855table ResizeLayer {
856 base:LayerBase;
857 descriptor:ResizeDescriptor;
858}
859
860table ResizeDescriptor {
861 targetHeight:uint;
862 targetWidth:uint;
863 method:ResizeMethod = NearestNeighbor;
864 dataLayout:DataLayout;
David Monahan4a0c9b92020-05-30 09:48:39 +0100865 alignCorners:bool;
866 halfPixelCenters:bool;
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100867}
868
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100869table StackLayer {
870 base:LayerBase;
871 descriptor:StackDescriptor;
872}
873
874table StackDescriptor {
875 axis:uint;
876 numInputs:uint;
877 inputShape:[uint];
878}
879
Aron Virginas-Tar85121a22019-10-23 10:41:35 +0100880table StandInDescriptor {
881 numInputs:uint;
882 numOutputs:uint;
883}
884
885table StandInLayer {
886 base:LayerBase;
887 descriptor:StandInDescriptor;
888}
889
Finn Williams2605b232020-06-10 15:53:46 +0100890table RankLayer {
891 base:LayerBase;
892}
893
Sadik Armagan0c3ea5b2021-02-03 09:29:30 +0000894table ReduceLayer {
895 base:LayerBase;
896 descriptor:ReduceDescriptor;
897}
898
899table ReduceDescriptor {
Sadik Armagan0c3ea5b2021-02-03 09:29:30 +0000900 keepDims:bool = false;
901 axis:[uint];
902 reduceOperation:ReduceOperation = Sum;
903}
904
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000905union Layer {
Mike Kellyaf484012019-02-20 16:53:11 +0000906 ActivationLayer,
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000907 AdditionLayer,
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000908 BatchToSpaceNdLayer,
ruoyan018e7fa232019-02-28 15:09:07 +0000909 BatchNormalizationLayer,
Conor Kennedy76277882019-02-26 08:29:54 +0000910 ConstantLayer,
Mike Kellya0766c32019-02-19 17:22:07 +0000911 Convolution2dLayer,
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000912 DepthwiseConvolution2dLayer,
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000913 FullyConnectedLayer,
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000914 InputLayer,
Sadik Armagan5f450272019-02-12 14:31:45 +0000915 MultiplicationLayer,
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000916 OutputLayer,
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000917 PermuteLayer,
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000918 Pooling2dLayer,
Saoirse Stewart263829c2019-02-19 15:54:14 +0000919 ReshapeLayer,
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000920 SoftmaxLayer,
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000921 SpaceToBatchNdLayer,
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000922 DivisionLayer,
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000923 MinimumLayer,
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000924 EqualLayer,
Nina Drozd57728782019-02-27 10:53:27 +0000925 MaximumLayer,
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000926 NormalizationLayer,
Sadik Armagan8b42a382019-03-01 14:24:49 +0000927 PadLayer,
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000928 RsqrtLayer,
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000929 FloorLayer,
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000930 GreaterLayer,
Conor Kennedyda1f9752019-03-01 14:37:12 +0000931 ResizeBilinearLayer,
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000932 SubtractionLayer,
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000933 StridedSliceLayer,
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000934 GatherLayer,
Jim Flynnac25a1b2019-02-28 10:40:49 +0000935 MeanLayer,
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000936 MergerLayer,
Jim Flynn18ce3382019-03-08 11:08:30 +0000937 L2NormalizationLayer,
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000938 SplitterLayer,
Jim Flynn11af3752019-03-19 17:22:29 +0000939 DetectionPostProcessLayer,
Derek Lamberti87acb272019-03-27 16:51:31 +0000940 LstmLayer,
Jan Eilers5b01a892019-07-23 09:47:43 +0100941 QuantizedLstmLayer,
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000942 QuantizeLayer,
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100943 DequantizeLayer,
Sadik Armaganeff363d2019-04-05 15:25:46 +0100944 MergeLayer,
Jim Flynne242f2d2019-05-22 14:24:13 +0100945 SwitchLayer,
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100946 ConcatLayer,
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100947 SpaceToDepthLayer,
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100948 PreluLayer,
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100949 TransposeConvolution2dLayer,
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100950 ResizeLayer,
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100951 StackLayer,
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100952 AbsLayer,
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100953 ArgMinMaxLayer,
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100954 SliceLayer,
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100955 DepthToSpaceLayer,
Sadik Armagan26257852019-10-14 13:00:47 +0100956 InstanceNormalizationLayer,
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100957 LogSoftmaxLayer,
Aron Virginas-Tar85121a22019-10-23 10:41:35 +0100958 ComparisonLayer,
josh minor4a3c6102020-01-06 16:40:46 -0600959 StandInLayer,
Mike Kellyc9ea45a2020-02-28 18:11:58 +0000960 ElementwiseUnaryLayer,
James Conroy8d333182020-05-13 10:27:58 +0100961 TransposeLayer,
Keith Davis300ad562020-06-04 16:34:23 +0100962 QLstmLayer,
Finn Williams2605b232020-06-10 15:53:46 +0100963 FillLayer,
James Conroyaba90cd2020-11-06 16:28:18 +0000964 RankLayer,
Sadik Armagan0c3ea5b2021-02-03 09:29:30 +0000965 LogicalBinaryLayer,
966 ReduceLayer
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000967}
968
Saoirse Stewart49dbe0e2019-02-05 17:27:06 +0000969table AnyLayer {
970 layer:Layer;
971}
972
Tee Jungaa920c52019-11-05 10:48:25 +0000973table FeatureCompatibilityVersions {
974 bindingIdsScheme:uint = 0;
975}
976
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000977// Root type for serialized data is the graph of the network
978table SerializedGraph {
Saoirse Stewart49dbe0e2019-02-05 17:27:06 +0000979 layers:[AnyLayer];
Tee Jungaa920c52019-11-05 10:48:25 +0000980 inputIds:[int];
981 outputIds:[int];
982 featureVersions:FeatureCompatibilityVersions;
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000983}
984
Sadik Armagan0c3ea5b2021-02-03 09:29:30 +0000985root_type SerializedGraph;