blob: 0697517a0fe5805fe31672b5a63ca663c63abd85 [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,
23 Elu = 10
Mike Kellyaf484012019-02-20 16:53:11 +000024}
25
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +010026enum ArgMinMaxFunction : byte {
27 Min = 0,
28 Max = 1
29}
30
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +000031enum DataType : byte {
32 Float16 = 0,
33 Float32 = 1,
Derek Lambertif90c56d2020-01-10 17:14:08 +000034 QuantisedAsymm8 = 2, // deprecated
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +000035 Signed32 = 3,
Nattapat Chaimanowongcd5ac232019-03-19 12:26:36 +000036 Boolean = 4,
Derek Lambertif90c56d2020-01-10 17:14:08 +000037 QuantisedSymm16 = 5, // deprecated
38 QAsymmU8 = 6,
39 QSymmS16 = 7
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +000040}
41
Saoirse Stewart3166c3e2019-02-18 15:24:53 +000042enum DataLayout : byte {
43 NHWC = 0,
44 NCHW = 1
45}
46
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +010047enum ResizeMethod: byte {
48 NearestNeighbor = 0,
49 Bilinear = 1,
50}
51
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +000052table TensorInfo {
53 dimensions:[uint];
54 dataType:DataType;
55 quantizationScale:float = 1.0;
56 quantizationOffset:int = 0;
57}
58
59struct Connection {
60 sourceLayerIndex:uint;
61 outputSlotIndex:uint;
62}
63
64table ByteData {
65 data:[byte];
66}
67
68table ShortData {
69 data:[short];
70}
71
72table IntData {
73 data:[int];
74}
75
76table LongData {
77 data:[long];
78}
79
80union ConstTensorData { ByteData, ShortData, IntData, LongData }
81
82table ConstTensor {
83 info:TensorInfo;
84 data:ConstTensorData;
85}
86
87table InputSlot {
88 index:uint;
89 connection:Connection;
90}
91
92table OutputSlot {
93 index:uint;
94 tensorInfo:TensorInfo;
95}
96
97enum LayerType : uint {
98 Addition = 0,
99 Input = 1,
Sadik Armagan5f450272019-02-12 14:31:45 +0000100 Multiplication = 2,
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000101 Output = 3,
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000102 Pooling2d = 4,
Saoirse Stewart263829c2019-02-19 15:54:14 +0000103 Reshape = 5,
Mike Kellya0766c32019-02-19 17:22:07 +0000104 Softmax = 6,
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000105 Convolution2d = 7,
Mike Kellyaf484012019-02-20 16:53:11 +0000106 DepthwiseConvolution2d = 8,
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000107 Activation = 9,
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000108 Permute = 10,
Conor Kennedy76277882019-02-26 08:29:54 +0000109 FullyConnected = 11,
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000110 Constant = 12,
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000111 SpaceToBatchNd = 13,
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000112 BatchToSpaceNd = 14,
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000113 Division = 15,
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000114 Minimum = 16,
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000115 Equal = 17,
Nina Drozd57728782019-02-27 10:53:27 +0000116 Maximum = 18,
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000117 Normalization = 19,
Sadik Armagan8b42a382019-03-01 14:24:49 +0000118 Pad = 20,
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000119 Rsqrt = 21,
ruoyan018e7fa232019-02-28 15:09:07 +0000120 Floor = 22,
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000121 BatchNormalization = 23,
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000122 Greater = 24,
Conor Kennedyda1f9752019-03-01 14:37:12 +0000123 ResizeBilinear = 25,
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000124 Subtraction = 26,
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000125 StridedSlice = 27,
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000126 Gather = 28,
Jim Flynnac25a1b2019-02-28 10:40:49 +0000127 Mean = 29,
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000128 Merger = 30,
Jim Flynn18ce3382019-03-08 11:08:30 +0000129 L2Normalization = 31,
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000130 Splitter = 32,
Jim Flynn11af3752019-03-19 17:22:29 +0000131 DetectionPostProcess = 33,
Derek Lamberti87acb272019-03-27 16:51:31 +0000132 Lstm = 34,
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000133 Quantize = 35,
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100134 Dequantize = 36,
Sadik Armaganeff363d2019-04-05 15:25:46 +0100135 Merge = 37,
Jim Flynne242f2d2019-05-22 14:24:13 +0100136 Switch = 38,
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100137 Concat = 39,
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100138 SpaceToDepth = 40,
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100139 Prelu = 41,
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100140 TransposeConvolution2d = 42,
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100141 Resize = 43,
Jan Eilers5b01a892019-07-23 09:47:43 +0100142 Stack = 44,
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100143 QuantizedLstm = 45,
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100144 Abs = 46,
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100145 ArgMinMax = 47,
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100146 Slice = 48,
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100147 DepthToSpace = 49,
Sadik Armagan26257852019-10-14 13:00:47 +0100148 InstanceNormalization = 50,
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100149 LogSoftmax = 51,
Aron Virginas-Tar85121a22019-10-23 10:41:35 +0100150 Comparison = 52,
josh minor4a3c6102020-01-06 16:40:46 -0600151 StandIn = 53,
152 ElementwiseUnary = 54
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000153}
154
155// Base layer table to be used as part of other layers
156table LayerBase {
157 index:uint;
158 layerName:string;
159 layerType:LayerType;
160 inputSlots:[InputSlot];
161 outputSlots:[OutputSlot];
162}
163
164table BindableLayerBase {
165 base:LayerBase;
166 layerBindingId:int;
167}
168
169// Table for each layer defined below
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100170
josh minor4a3c6102020-01-06 16:40:46 -0600171/// @deprecated Use ElementwiseUnaryLayer instead
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100172table AbsLayer {
173 base:LayerBase;
174}
175
Mike Kellyaf484012019-02-20 16:53:11 +0000176table ActivationLayer {
177 base:LayerBase;
178 descriptor:ActivationDescriptor;
179}
180
181table ActivationDescriptor {
Tee Jung86bc3d82019-10-01 11:25:56 +0900182 activationFunction:ActivationFunction = Sigmoid;
Mike Kellyaf484012019-02-20 16:53:11 +0000183 a:float;
184 b:float;
185}
186
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000187table AdditionLayer {
188 base:LayerBase;
189}
190
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100191table ArgMinMaxLayer {
192 base:LayerBase;
193 descriptor:ArgMinMaxDescriptor;
194}
195
196table ArgMinMaxDescriptor{
Tee Jung86bc3d82019-10-01 11:25:56 +0900197 argMinMaxFunction:ArgMinMaxFunction;
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100198 axis:int;
199}
200
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100201enum ComparisonOperation : byte {
202 Equal = 0,
203 Greater = 1,
204 GreaterOrEqual = 2,
205 Less = 3,
206 LessOrEqual = 4,
207 NotEqual = 5
208}
209
210table ComparisonDescriptor {
211 operation:ComparisonOperation;
212}
213
214table ComparisonLayer {
215 base:LayerBase;
216 descriptor:ComparisonDescriptor;
217}
218
Conor Kennedy76277882019-02-26 08:29:54 +0000219table ConstantLayer {
220 base:LayerBase;
221 input:ConstTensor;
222}
223
Mike Kellya0766c32019-02-19 17:22:07 +0000224table Convolution2dLayer {
225 base:LayerBase;
226 descriptor:Convolution2dDescriptor;
227 weights:ConstTensor;
228 biases:ConstTensor;
229}
230
231table Convolution2dDescriptor {
232 padLeft:uint;
233 padRight:uint;
234 padTop:uint;
235 padBottom:uint;
236 strideX:uint;
237 strideY:uint;
Matthew Benthamacad04e2019-05-13 10:02:45 +0100238 dilationX:uint = 1;
239 dilationY:uint = 1;
Mike Kellya0766c32019-02-19 17:22:07 +0000240 biasEnabled:bool = false;
241 dataLayout:DataLayout = NCHW;
242}
243
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100244table DepthToSpaceLayer {
245 base:LayerBase;
246 descriptor:DepthToSpaceDescriptor;
247}
248
249table DepthToSpaceDescriptor {
250 blockSize:uint;
251 dataLayout:DataLayout;
252}
253
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000254table DivisionLayer {
255 base:LayerBase;
256}
257
josh minor4a3c6102020-01-06 16:40:46 -0600258enum UnaryOperation : byte {
259 Abs = 0,
260 Rsqrt = 1,
261 Sqrt = 2,
262 Exp = 3,
263 Neg = 4
264}
265
266table ElementwiseUnaryDescriptor {
267 operation:UnaryOperation;
268}
269
270table ElementwiseUnaryLayer {
271 base:LayerBase;
272 descriptor:ElementwiseUnaryDescriptor;
273}
274
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100275/// @deprecated Use ComparisonLayer instead
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000276table EqualLayer {
277 base:LayerBase;
278}
279
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000280table FloorLayer{
281 base:LayerBase;
282}
283
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000284table FullyConnectedLayer {
285 base:LayerBase;
286 descriptor:FullyConnectedDescriptor;
287 weights:ConstTensor;
288 biases:ConstTensor;
289}
290
291table FullyConnectedDescriptor {
292 biasEnabled:bool = false;
293 transposeWeightsMatrix:bool = false;
294}
295
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000296table GatherLayer {
297 base:LayerBase;
298}
299
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100300/// @deprecated Use ComparisonLayer instead
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000301table GreaterLayer {
302 base:LayerBase;
303}
304
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000305table InputLayer {
306 base:BindableLayerBase;
307}
308
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100309table InstanceNormalizationLayer {
310 base:LayerBase;
311 descriptor:InstanceNormalizationDescriptor;
312}
313
314table InstanceNormalizationDescriptor {
315 gamma:float;
316 beta:float;
317 eps:float;
318 dataLayout:DataLayout;
319}
320
Sadik Armagan26257852019-10-14 13:00:47 +0100321table LogSoftmaxLayer {
322 base:LayerBase;
323 descriptor:LogSoftmaxDescriptor;
324}
325
326table LogSoftmaxDescriptor {
327 beta:float = 1;
328 axis:int = -1;
329}
330
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000331table L2NormalizationLayer {
332 base:LayerBase;
333 descriptor:L2NormalizationDescriptor;
334}
335
336table L2NormalizationDescriptor {
337 dataLayout:DataLayout = NCHW;
Ferran Balaguer0dcffec2019-06-18 16:25:06 +0100338 eps:float = 1e-12;
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000339}
340
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000341table MinimumLayer {
342 base:LayerBase;
343}
344
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000345table MaximumLayer {
346 base:LayerBase;
347}
348
Sadik Armagan5f450272019-02-12 14:31:45 +0000349table MultiplicationLayer {
350 base:LayerBase;
351}
352
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000353table Pooling2dLayer {
354 base:LayerBase;
355 descriptor:Pooling2dDescriptor;
356}
357
358enum PoolingAlgorithm : byte {
359 Max = 0,
360 Average = 1,
361 L2 = 2
362}
363
364enum OutputShapeRounding : byte {
365 Floor = 0,
366 Ceiling = 1
367}
368
369enum PaddingMethod : byte {
370 IgnoreValue = 0,
371 Exclude = 1
372}
373
374table Pooling2dDescriptor {
375 poolType:PoolingAlgorithm;
376 padLeft:uint;
377 padRight:uint;
378 padTop:uint;
379 padBottom:uint;
380 poolWidth:uint;
381 poolHeight:uint;
382 strideX:uint;
383 strideY:uint;
384 outputShapeRounding:OutputShapeRounding;
385 paddingMethod:PaddingMethod;
386 dataLayout:DataLayout;
387}
388
Derek Lamberti87acb272019-03-27 16:51:31 +0000389table QuantizeLayer {
390 base:LayerBase;
391}
392
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000393table SoftmaxLayer {
394 base:LayerBase;
395 descriptor:SoftmaxDescriptor;
396}
397
398table SoftmaxDescriptor {
399 beta:float;
400}
401
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000402table DepthwiseConvolution2dLayer {
403 base:LayerBase;
404 descriptor:DepthwiseConvolution2dDescriptor;
405 weights:ConstTensor;
406 biases:ConstTensor;
407}
408
409table DepthwiseConvolution2dDescriptor {
410 padLeft:uint;
411 padRight:uint;
412 padTop:uint;
413 padBottom:uint;
414 strideX:uint;
415 strideY:uint;
Matthew Benthamacad04e2019-05-13 10:02:45 +0100416 dilationX:uint = 1;
417 dilationY:uint = 1;
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000418 biasEnabled:bool = false;
419 dataLayout:DataLayout = NCHW;
420}
421
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000422table OutputLayer {
423 base:BindableLayerBase;
424}
425
Saoirse Stewart263829c2019-02-19 15:54:14 +0000426table ReshapeLayer {
427 base:LayerBase;
428 descriptor:ReshapeDescriptor;
429}
430
431table ReshapeDescriptor {
432 targetShape:[uint];
433}
434
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000435table PermuteLayer {
436 base:LayerBase;
437 descriptor:PermuteDescriptor;
438}
439
440table PermuteDescriptor {
441 dimMappings:[uint];
442}
443
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000444table SpaceToBatchNdLayer {
445 base:LayerBase;
446 descriptor:SpaceToBatchNdDescriptor;
447}
448
449table SpaceToBatchNdDescriptor {
450 blockShape:[uint];
451 padList:[uint];
452 dataLayout:DataLayout;
453}
454
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100455table SpaceToDepthLayer {
456 base:LayerBase;
457 descriptor:SpaceToDepthDescriptor;
458}
459
460table SpaceToDepthDescriptor {
461 blockSize:uint;
462 dataLayout:DataLayout;
463}
464
Conor Kennedyda1f9752019-03-01 14:37:12 +0000465table SubtractionLayer {
466 base:LayerBase;
467}
468
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000469table BatchToSpaceNdLayer {
470 base:LayerBase;
471 descriptor:BatchToSpaceNdDescriptor;
472}
473
474table BatchToSpaceNdDescriptor {
475 blockShape:[uint];
476 crops:[uint];
477 dataLayout:DataLayout;
478}
479
Nina Drozd57728782019-02-27 10:53:27 +0000480enum NormalizationAlgorithmChannel : byte {
481 Across = 0,
482 Within = 1
483}
484
485enum NormalizationAlgorithmMethod : byte {
486 LocalBrightness = 0,
487 LocalContrast = 1
488}
489
490table NormalizationLayer {
491 base:LayerBase;
492 descriptor:NormalizationDescriptor;
493}
494
495table NormalizationDescriptor {
496 normChannelType:NormalizationAlgorithmChannel = Across;
497 normMethodType:NormalizationAlgorithmMethod = LocalBrightness;
498 normSize:uint;
499 alpha:float;
500 beta:float;
501 k:float;
502 dataLayout:DataLayout = NCHW;
503}
504
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000505table MeanLayer {
506 base:LayerBase;
507 descriptor:MeanDescriptor;
508}
509
510table MeanDescriptor {
511 axis:[uint];
512 keepDims:bool = false;
513}
514
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000515table PadLayer {
516 base:LayerBase;
517 descriptor:PadDescriptor;
518}
519
520table PadDescriptor {
521 padList:[uint];
David Monahan34757812019-06-19 11:47:21 +0100522 padValue:float = 0;
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000523}
524
josh minor4a3c6102020-01-06 16:40:46 -0600525/// @deprecated Use ElementwiseUnaryLayer instead
Sadik Armagan8b42a382019-03-01 14:24:49 +0000526table RsqrtLayer {
527 base:LayerBase;
528}
529
ruoyan018e7fa232019-02-28 15:09:07 +0000530table BatchNormalizationLayer {
531 base:LayerBase;
532 descriptor:BatchNormalizationDescriptor;
533 mean:ConstTensor;
534 variance:ConstTensor;
535 beta:ConstTensor;
536 gamma:ConstTensor;
537}
538
539table BatchNormalizationDescriptor {
540 eps:float;
541 dataLayout:DataLayout;
542}
543
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100544/// @deprecated Use ResizeLayer instead
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000545table ResizeBilinearLayer {
546 base:LayerBase;
547 descriptor:ResizeBilinearDescriptor;
548}
549
550table ResizeBilinearDescriptor {
551 targetWidth:uint;
552 targetHeight:uint;
553 dataLayout:DataLayout;
554}
555
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100556table SliceLayer {
557 base:LayerBase;
558 descriptor:SliceDescriptor;
559}
560
561table SliceDescriptor {
562 begin:[uint];
563 size:[uint];
564}
565
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000566table StridedSliceLayer {
567 base:LayerBase;
568 descriptor:StridedSliceDescriptor;
569}
570
571table StridedSliceDescriptor {
572 begin:[int];
573 end:[int];
574 stride:[int];
575 beginMask:int;
576 endMask:int;
577 shrinkAxisMask:int;
578 ellipsisMask:int;
579 newAxisMask:int;
580 dataLayout:DataLayout;
581}
582
Jim Flynne242f2d2019-05-22 14:24:13 +0100583table ConcatLayer {
584 base:LayerBase;
585 descriptor:OriginsDescriptor;
586}
587
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100588/// @deprecated Use ConcatLayer instead
Jim Flynnac25a1b2019-02-28 10:40:49 +0000589table MergerLayer {
590 base:LayerBase;
591 descriptor:OriginsDescriptor;
592}
593
594table UintVector {
595 data:[uint];
596}
597
598table OriginsDescriptor {
599 concatAxis:uint;
600 numViews:uint;
601 numDimensions:uint;
602 viewOrigins:[UintVector];
603}
604
Jim Flynn18ce3382019-03-08 11:08:30 +0000605table ViewsDescriptor {
606 origins:OriginsDescriptor;
607 viewSizes:[UintVector];
608}
609
610table SplitterLayer {
611 base:LayerBase;
612 descriptor:ViewsDescriptor;
613}
614
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000615table DetectionPostProcessLayer {
616 base:LayerBase;
617 descriptor:DetectionPostProcessDescriptor;
618 anchors:ConstTensor;
619}
620
621table DetectionPostProcessDescriptor {
622 maxDetections:uint;
623 maxClassesPerDetection:uint;
624 detectionsPerClass:uint;
625 nmsScoreThreshold:float;
626 nmsIouThreshold:float;
627 numClasses:uint;
628 useRegularNms:bool;
629 scaleX:float;
630 scaleY:float;
631 scaleW:float;
632 scaleH:float;
633}
634
Jim Flynn11af3752019-03-19 17:22:29 +0000635table LstmInputParams {
636 inputToForgetWeights:ConstTensor;
637 inputToCellWeights:ConstTensor;
638 inputToOutputWeights:ConstTensor;
639 recurrentToForgetWeights:ConstTensor;
640 recurrentToCellWeights:ConstTensor;
641 recurrentToOutputWeights:ConstTensor;
642 forgetGateBias:ConstTensor;
643 cellBias:ConstTensor;
644 outputGateBias:ConstTensor;
645
646 inputToInputWeights:ConstTensor;
647 recurrentToInputWeights:ConstTensor;
648 cellToInputWeights:ConstTensor;
649 inputGateBias:ConstTensor;
650
651 projectionWeights:ConstTensor;
652 projectionBias:ConstTensor;
653
654 cellToForgetWeights:ConstTensor;
655 cellToOutputWeights:ConstTensor;
Jan Eilersf8c62972019-07-17 11:07:49 +0100656
657 inputLayerNormWeights:ConstTensor;
658 forgetLayerNormWeights:ConstTensor;
659 cellLayerNormWeights:ConstTensor;
660 outputLayerNormWeights:ConstTensor;
Jim Flynn11af3752019-03-19 17:22:29 +0000661}
662
Jan Eilers5b01a892019-07-23 09:47:43 +0100663table QuantizedLstmInputParams {
664 inputToInputWeights:ConstTensor;
665 inputToForgetWeights:ConstTensor;
666 inputToCellWeights:ConstTensor;
667 inputToOutputWeights:ConstTensor;
668
669 recurrentToInputWeights:ConstTensor;
670 recurrentToForgetWeights:ConstTensor;
671 recurrentToCellWeights:ConstTensor;
672 recurrentToOutputWeights:ConstTensor;
673
674 inputGateBias:ConstTensor;
675 forgetGateBias:ConstTensor;
676 cellBias:ConstTensor;
677 outputGateBias:ConstTensor;
678}
679
Jim Flynn11af3752019-03-19 17:22:29 +0000680table LstmDescriptor {
681 activationFunc:uint;
682 clippingThresCell:float;
683 clippingThresProj:float;
684 cifgEnabled:bool = true;
685 peepholeEnabled:bool = false;
686 projectionEnabled:bool = false;
Jan Eilersf8c62972019-07-17 11:07:49 +0100687 layerNormEnabled:bool = false;
Jim Flynn11af3752019-03-19 17:22:29 +0000688}
689
690table LstmLayer {
691 base:LayerBase;
692 descriptor:LstmDescriptor;
693 inputParams:LstmInputParams;
694}
695
Jan Eilers5b01a892019-07-23 09:47:43 +0100696table QuantizedLstmLayer {
697 base:LayerBase;
698 inputParams:QuantizedLstmInputParams;
699}
700
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000701table DequantizeLayer {
702 base:LayerBase;
703}
704
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100705table MergeLayer {
706 base:LayerBase;
707}
708
Sadik Armaganeff363d2019-04-05 15:25:46 +0100709table SwitchLayer {
710 base:LayerBase;
711}
712
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100713table PreluLayer {
714 base:LayerBase;
715}
716
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100717table TransposeConvolution2dLayer {
718 base:LayerBase;
719 descriptor:TransposeConvolution2dDescriptor;
720 weights:ConstTensor;
721 biases:ConstTensor;
722}
723
724table TransposeConvolution2dDescriptor {
725 padLeft:uint;
726 padRight:uint;
727 padTop:uint;
728 padBottom:uint;
729 strideX:uint;
730 strideY:uint;
731 biasEnabled:bool = false;
732 dataLayout:DataLayout = NCHW;
733}
734
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100735table ResizeLayer {
736 base:LayerBase;
737 descriptor:ResizeDescriptor;
738}
739
740table ResizeDescriptor {
741 targetHeight:uint;
742 targetWidth:uint;
743 method:ResizeMethod = NearestNeighbor;
744 dataLayout:DataLayout;
745}
746
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100747table StackLayer {
748 base:LayerBase;
749 descriptor:StackDescriptor;
750}
751
752table StackDescriptor {
753 axis:uint;
754 numInputs:uint;
755 inputShape:[uint];
756}
757
Aron Virginas-Tar85121a22019-10-23 10:41:35 +0100758table StandInDescriptor {
759 numInputs:uint;
760 numOutputs:uint;
761}
762
763table StandInLayer {
764 base:LayerBase;
765 descriptor:StandInDescriptor;
766}
767
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000768union Layer {
Mike Kellyaf484012019-02-20 16:53:11 +0000769 ActivationLayer,
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000770 AdditionLayer,
Nattapat Chaimanowong6b4ed982019-02-26 17:24:13 +0000771 BatchToSpaceNdLayer,
ruoyan018e7fa232019-02-28 15:09:07 +0000772 BatchNormalizationLayer,
Conor Kennedy76277882019-02-26 08:29:54 +0000773 ConstantLayer,
Mike Kellya0766c32019-02-19 17:22:07 +0000774 Convolution2dLayer,
Aron Virginas-Tarc04125f2019-02-19 16:31:08 +0000775 DepthwiseConvolution2dLayer,
Sadik Armagandbb0c0c2019-02-21 09:01:41 +0000776 FullyConnectedLayer,
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000777 InputLayer,
Sadik Armagan5f450272019-02-12 14:31:45 +0000778 MultiplicationLayer,
Aron Virginas-Tarfc413c02019-02-13 15:41:52 +0000779 OutputLayer,
Nattapat Chaimanowong30b00202019-02-20 17:31:34 +0000780 PermuteLayer,
Saoirse Stewart3166c3e2019-02-18 15:24:53 +0000781 Pooling2dLayer,
Saoirse Stewart263829c2019-02-19 15:54:14 +0000782 ReshapeLayer,
Nattapat Chaimanowong45286992019-02-26 15:53:02 +0000783 SoftmaxLayer,
Éanna Ó Catháin58885892019-02-27 16:16:39 +0000784 SpaceToBatchNdLayer,
Aron Virginas-Tar0fe32452019-02-28 13:12:47 +0000785 DivisionLayer,
Nattapat Chaimanowong235cea52019-02-28 16:27:30 +0000786 MinimumLayer,
Aron Virginas-Tar377351e2019-02-27 14:42:31 +0000787 EqualLayer,
Nina Drozd57728782019-02-27 10:53:27 +0000788 MaximumLayer,
Nattapat Chaimanowongebb0f9c2019-03-01 12:14:06 +0000789 NormalizationLayer,
Sadik Armagan8b42a382019-03-01 14:24:49 +0000790 PadLayer,
Finn Williamsdd2ba7e2019-03-01 11:51:52 +0000791 RsqrtLayer,
Conor Kennedy79ffdf52019-03-01 14:24:54 +0000792 FloorLayer,
Nattapat Chaimanowong6522cdc2019-03-01 16:14:13 +0000793 GreaterLayer,
Conor Kennedyda1f9752019-03-01 14:37:12 +0000794 ResizeBilinearLayer,
Nattapat Chaimanowongb3485212019-03-04 12:35:39 +0000795 SubtractionLayer,
Saoirse Stewarta1ed73a2019-03-04 13:40:12 +0000796 StridedSliceLayer,
Sadik Armaganac97c8c2019-03-04 17:44:21 +0000797 GatherLayer,
Jim Flynnac25a1b2019-02-28 10:40:49 +0000798 MeanLayer,
Narumol Prangnawarat495701f2019-03-07 17:31:34 +0000799 MergerLayer,
Jim Flynn18ce3382019-03-08 11:08:30 +0000800 L2NormalizationLayer,
Nattapat Chaimanowong3e14a9d2019-03-18 12:37:06 +0000801 SplitterLayer,
Jim Flynn11af3752019-03-19 17:22:29 +0000802 DetectionPostProcessLayer,
Derek Lamberti87acb272019-03-27 16:51:31 +0000803 LstmLayer,
Jan Eilers5b01a892019-07-23 09:47:43 +0100804 QuantizedLstmLayer,
Nattapat Chaimanowonge4294fd2019-03-28 09:56:53 +0000805 QuantizeLayer,
Nattapat Chaimanowong1f886302019-04-05 13:37:19 +0100806 DequantizeLayer,
Sadik Armaganeff363d2019-04-05 15:25:46 +0100807 MergeLayer,
Jim Flynne242f2d2019-05-22 14:24:13 +0100808 SwitchLayer,
Aron Virginas-Taraa067142019-06-11 16:01:44 +0100809 ConcatLayer,
Ellen Norris-Thompson51982472019-06-19 11:46:21 +0100810 SpaceToDepthLayer,
Aron Virginas-Tarcb549302019-06-21 13:53:38 +0100811 PreluLayer,
FinnWilliamsArm6fb339a2019-06-28 15:07:10 +0100812 TransposeConvolution2dLayer,
Matthew Jacksonb5433ee2019-07-11 15:54:20 +0100813 ResizeLayer,
FinnWilliamsArm4ffcc8f2019-09-05 14:34:20 +0100814 StackLayer,
Narumol Prangnawarat0cfcf232019-09-09 17:16:24 +0100815 AbsLayer,
Aron Virginas-Tar2fda80b2019-09-18 13:36:52 +0100816 ArgMinMaxLayer,
Aron Virginas-Tarda9d2d32019-09-20 10:42:02 +0100817 SliceLayer,
Aron Virginas-Tar781ced92019-10-03 11:15:39 +0100818 DepthToSpaceLayer,
Sadik Armagan26257852019-10-14 13:00:47 +0100819 InstanceNormalizationLayer,
Aron Virginas-Tare80ebd12019-10-17 16:11:54 +0100820 LogSoftmaxLayer,
Aron Virginas-Tar85121a22019-10-23 10:41:35 +0100821 ComparisonLayer,
josh minor4a3c6102020-01-06 16:40:46 -0600822 StandInLayer,
823 ElementwiseUnaryLayer
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000824}
825
Saoirse Stewart49dbe0e2019-02-05 17:27:06 +0000826table AnyLayer {
827 layer:Layer;
828}
829
Tee Jungaa920c52019-11-05 10:48:25 +0000830table FeatureCompatibilityVersions {
831 bindingIdsScheme:uint = 0;
832}
833
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000834// Root type for serialized data is the graph of the network
835table SerializedGraph {
Saoirse Stewart49dbe0e2019-02-05 17:27:06 +0000836 layers:[AnyLayer];
Tee Jungaa920c52019-11-05 10:48:25 +0000837 inputIds:[int];
838 outputIds:[int];
839 featureVersions:FeatureCompatibilityVersions;
Nattapat Chaimanowong969eea32019-01-30 13:33:11 +0000840}
841
842root_type SerializedGraph;