Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
Derek Lamberti | 0028d1b | 2019-02-20 13:57:42 +0000 | [diff] [blame] | 6 | namespace armnnSerializer; |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 7 | |
| 8 | file_identifier "ARMN"; |
| 9 | |
| 10 | file_extension "armnn"; |
| 11 | |
Mike Kelly | af48401 | 2019-02-20 16:53:11 +0000 | [diff] [blame] | 12 | enum ActivationFunction : byte { |
| 13 | Sigmoid = 0, |
| 14 | TanH = 1, |
| 15 | Linear = 2, |
| 16 | ReLu = 3, |
| 17 | BoundedReLu = 4, |
| 18 | SoftReLu = 5, |
| 19 | LeakyReLu = 6, |
| 20 | Abs = 7, |
| 21 | Sqrt = 8, |
| 22 | Square = 9 |
| 23 | } |
| 24 | |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 25 | enum DataType : byte { |
| 26 | Float16 = 0, |
| 27 | Float32 = 1, |
| 28 | QuantisedAsymm8 = 2, |
| 29 | Signed32 = 3, |
Nattapat Chaimanowong | cd5ac23 | 2019-03-19 12:26:36 +0000 | [diff] [blame] | 30 | Boolean = 4, |
| 31 | QuantisedSymm16 = 5 |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 32 | } |
| 33 | |
Saoirse Stewart | 3166c3e | 2019-02-18 15:24:53 +0000 | [diff] [blame] | 34 | enum DataLayout : byte { |
| 35 | NHWC = 0, |
| 36 | NCHW = 1 |
| 37 | } |
| 38 | |
FinnWilliamsArm | 6fb339a | 2019-06-28 15:07:10 +0100 | [diff] [blame] | 39 | enum ResizeMethod: byte { |
| 40 | NearestNeighbor = 0, |
| 41 | Bilinear = 1, |
| 42 | } |
| 43 | |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 44 | table TensorInfo { |
| 45 | dimensions:[uint]; |
| 46 | dataType:DataType; |
| 47 | quantizationScale:float = 1.0; |
| 48 | quantizationOffset:int = 0; |
| 49 | } |
| 50 | |
| 51 | struct Connection { |
| 52 | sourceLayerIndex:uint; |
| 53 | outputSlotIndex:uint; |
| 54 | } |
| 55 | |
| 56 | table ByteData { |
| 57 | data:[byte]; |
| 58 | } |
| 59 | |
| 60 | table ShortData { |
| 61 | data:[short]; |
| 62 | } |
| 63 | |
| 64 | table IntData { |
| 65 | data:[int]; |
| 66 | } |
| 67 | |
| 68 | table LongData { |
| 69 | data:[long]; |
| 70 | } |
| 71 | |
| 72 | union ConstTensorData { ByteData, ShortData, IntData, LongData } |
| 73 | |
| 74 | table ConstTensor { |
| 75 | info:TensorInfo; |
| 76 | data:ConstTensorData; |
| 77 | } |
| 78 | |
| 79 | table InputSlot { |
| 80 | index:uint; |
| 81 | connection:Connection; |
| 82 | } |
| 83 | |
| 84 | table OutputSlot { |
| 85 | index:uint; |
| 86 | tensorInfo:TensorInfo; |
| 87 | } |
| 88 | |
| 89 | enum LayerType : uint { |
| 90 | Addition = 0, |
| 91 | Input = 1, |
Sadik Armagan | 5f45027 | 2019-02-12 14:31:45 +0000 | [diff] [blame] | 92 | Multiplication = 2, |
Aron Virginas-Tar | fc413c0 | 2019-02-13 15:41:52 +0000 | [diff] [blame] | 93 | Output = 3, |
Saoirse Stewart | 3166c3e | 2019-02-18 15:24:53 +0000 | [diff] [blame] | 94 | Pooling2d = 4, |
Saoirse Stewart | 263829c | 2019-02-19 15:54:14 +0000 | [diff] [blame] | 95 | Reshape = 5, |
Mike Kelly | a0766c3 | 2019-02-19 17:22:07 +0000 | [diff] [blame] | 96 | Softmax = 6, |
Aron Virginas-Tar | c04125f | 2019-02-19 16:31:08 +0000 | [diff] [blame] | 97 | Convolution2d = 7, |
Mike Kelly | af48401 | 2019-02-20 16:53:11 +0000 | [diff] [blame] | 98 | DepthwiseConvolution2d = 8, |
Nattapat Chaimanowong | 30b0020 | 2019-02-20 17:31:34 +0000 | [diff] [blame] | 99 | Activation = 9, |
Sadik Armagan | dbb0c0c | 2019-02-21 09:01:41 +0000 | [diff] [blame] | 100 | Permute = 10, |
Conor Kennedy | 7627788 | 2019-02-26 08:29:54 +0000 | [diff] [blame] | 101 | FullyConnected = 11, |
Nattapat Chaimanowong | 4528699 | 2019-02-26 15:53:02 +0000 | [diff] [blame] | 102 | Constant = 12, |
Nattapat Chaimanowong | 6b4ed98 | 2019-02-26 17:24:13 +0000 | [diff] [blame] | 103 | SpaceToBatchNd = 13, |
Éanna Ó Catháin | 5888589 | 2019-02-27 16:16:39 +0000 | [diff] [blame] | 104 | BatchToSpaceNd = 14, |
Aron Virginas-Tar | 0fe3245 | 2019-02-28 13:12:47 +0000 | [diff] [blame] | 105 | Division = 15, |
Nattapat Chaimanowong | 235cea5 | 2019-02-28 16:27:30 +0000 | [diff] [blame] | 106 | Minimum = 16, |
Aron Virginas-Tar | 377351e | 2019-02-27 14:42:31 +0000 | [diff] [blame] | 107 | Equal = 17, |
Nina Drozd | 5772878 | 2019-02-27 10:53:27 +0000 | [diff] [blame] | 108 | Maximum = 18, |
Nattapat Chaimanowong | ebb0f9c | 2019-03-01 12:14:06 +0000 | [diff] [blame] | 109 | Normalization = 19, |
Sadik Armagan | 8b42a38 | 2019-03-01 14:24:49 +0000 | [diff] [blame] | 110 | Pad = 20, |
Finn Williams | dd2ba7e | 2019-03-01 11:51:52 +0000 | [diff] [blame] | 111 | Rsqrt = 21, |
ruoyan01 | 8e7fa23 | 2019-02-28 15:09:07 +0000 | [diff] [blame] | 112 | Floor = 22, |
Conor Kennedy | 79ffdf5 | 2019-03-01 14:24:54 +0000 | [diff] [blame] | 113 | BatchNormalization = 23, |
Nattapat Chaimanowong | 6522cdc | 2019-03-01 16:14:13 +0000 | [diff] [blame] | 114 | Greater = 24, |
Conor Kennedy | da1f975 | 2019-03-01 14:37:12 +0000 | [diff] [blame] | 115 | ResizeBilinear = 25, |
Nattapat Chaimanowong | b348521 | 2019-03-04 12:35:39 +0000 | [diff] [blame] | 116 | Subtraction = 26, |
Saoirse Stewart | a1ed73a | 2019-03-04 13:40:12 +0000 | [diff] [blame] | 117 | StridedSlice = 27, |
Sadik Armagan | ac97c8c | 2019-03-04 17:44:21 +0000 | [diff] [blame] | 118 | Gather = 28, |
Jim Flynn | ac25a1b | 2019-02-28 10:40:49 +0000 | [diff] [blame] | 119 | Mean = 29, |
Narumol Prangnawarat | 495701f | 2019-03-07 17:31:34 +0000 | [diff] [blame] | 120 | Merger = 30, |
Jim Flynn | 18ce338 | 2019-03-08 11:08:30 +0000 | [diff] [blame] | 121 | L2Normalization = 31, |
Nattapat Chaimanowong | 3e14a9d | 2019-03-18 12:37:06 +0000 | [diff] [blame] | 122 | Splitter = 32, |
Jim Flynn | 11af375 | 2019-03-19 17:22:29 +0000 | [diff] [blame] | 123 | DetectionPostProcess = 33, |
Derek Lamberti | 87acb27 | 2019-03-27 16:51:31 +0000 | [diff] [blame] | 124 | Lstm = 34, |
Nattapat Chaimanowong | e4294fd | 2019-03-28 09:56:53 +0000 | [diff] [blame] | 125 | Quantize = 35, |
Nattapat Chaimanowong | 1f88630 | 2019-04-05 13:37:19 +0100 | [diff] [blame] | 126 | Dequantize = 36, |
Sadik Armagan | eff363d | 2019-04-05 15:25:46 +0100 | [diff] [blame] | 127 | Merge = 37, |
Jim Flynn | e242f2d | 2019-05-22 14:24:13 +0100 | [diff] [blame] | 128 | Switch = 38, |
Aron Virginas-Tar | aa06714 | 2019-06-11 16:01:44 +0100 | [diff] [blame] | 129 | Concat = 39, |
Ellen Norris-Thompson | 5198247 | 2019-06-19 11:46:21 +0100 | [diff] [blame] | 130 | SpaceToDepth = 40, |
Aron Virginas-Tar | cb54930 | 2019-06-21 13:53:38 +0100 | [diff] [blame] | 131 | Prelu = 41, |
FinnWilliamsArm | 6fb339a | 2019-06-28 15:07:10 +0100 | [diff] [blame] | 132 | TransposeConvolution2d = 42, |
| 133 | Resize = 43 |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 134 | } |
| 135 | |
| 136 | // Base layer table to be used as part of other layers |
| 137 | table LayerBase { |
| 138 | index:uint; |
| 139 | layerName:string; |
| 140 | layerType:LayerType; |
| 141 | inputSlots:[InputSlot]; |
| 142 | outputSlots:[OutputSlot]; |
| 143 | } |
| 144 | |
| 145 | table BindableLayerBase { |
| 146 | base:LayerBase; |
| 147 | layerBindingId:int; |
| 148 | } |
| 149 | |
| 150 | // Table for each layer defined below |
Mike Kelly | af48401 | 2019-02-20 16:53:11 +0000 | [diff] [blame] | 151 | table ActivationLayer { |
| 152 | base:LayerBase; |
| 153 | descriptor:ActivationDescriptor; |
| 154 | } |
| 155 | |
| 156 | table ActivationDescriptor { |
| 157 | function:ActivationFunction = Sigmoid; |
| 158 | a:float; |
| 159 | b:float; |
| 160 | } |
| 161 | |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 162 | table AdditionLayer { |
| 163 | base:LayerBase; |
| 164 | } |
| 165 | |
Conor Kennedy | 7627788 | 2019-02-26 08:29:54 +0000 | [diff] [blame] | 166 | table ConstantLayer { |
| 167 | base:LayerBase; |
| 168 | input:ConstTensor; |
| 169 | } |
| 170 | |
Mike Kelly | a0766c3 | 2019-02-19 17:22:07 +0000 | [diff] [blame] | 171 | table Convolution2dLayer { |
| 172 | base:LayerBase; |
| 173 | descriptor:Convolution2dDescriptor; |
| 174 | weights:ConstTensor; |
| 175 | biases:ConstTensor; |
| 176 | } |
| 177 | |
| 178 | table Convolution2dDescriptor { |
| 179 | padLeft:uint; |
| 180 | padRight:uint; |
| 181 | padTop:uint; |
| 182 | padBottom:uint; |
| 183 | strideX:uint; |
| 184 | strideY:uint; |
Matthew Bentham | acad04e | 2019-05-13 10:02:45 +0100 | [diff] [blame] | 185 | dilationX:uint = 1; |
| 186 | dilationY:uint = 1; |
Mike Kelly | a0766c3 | 2019-02-19 17:22:07 +0000 | [diff] [blame] | 187 | biasEnabled:bool = false; |
| 188 | dataLayout:DataLayout = NCHW; |
| 189 | } |
| 190 | |
Éanna Ó Catháin | 5888589 | 2019-02-27 16:16:39 +0000 | [diff] [blame] | 191 | table DivisionLayer { |
| 192 | base:LayerBase; |
| 193 | } |
| 194 | |
Nattapat Chaimanowong | 235cea5 | 2019-02-28 16:27:30 +0000 | [diff] [blame] | 195 | table EqualLayer { |
| 196 | base:LayerBase; |
| 197 | } |
| 198 | |
Finn Williams | dd2ba7e | 2019-03-01 11:51:52 +0000 | [diff] [blame] | 199 | table FloorLayer{ |
| 200 | base:LayerBase; |
| 201 | } |
| 202 | |
Sadik Armagan | dbb0c0c | 2019-02-21 09:01:41 +0000 | [diff] [blame] | 203 | table FullyConnectedLayer { |
| 204 | base:LayerBase; |
| 205 | descriptor:FullyConnectedDescriptor; |
| 206 | weights:ConstTensor; |
| 207 | biases:ConstTensor; |
| 208 | } |
| 209 | |
| 210 | table FullyConnectedDescriptor { |
| 211 | biasEnabled:bool = false; |
| 212 | transposeWeightsMatrix:bool = false; |
| 213 | } |
| 214 | |
Saoirse Stewart | a1ed73a | 2019-03-04 13:40:12 +0000 | [diff] [blame] | 215 | table GatherLayer { |
| 216 | base:LayerBase; |
| 217 | } |
| 218 | |
Conor Kennedy | 79ffdf5 | 2019-03-01 14:24:54 +0000 | [diff] [blame] | 219 | table GreaterLayer { |
| 220 | base:LayerBase; |
| 221 | } |
| 222 | |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 223 | table InputLayer { |
| 224 | base:BindableLayerBase; |
| 225 | } |
| 226 | |
Narumol Prangnawarat | 495701f | 2019-03-07 17:31:34 +0000 | [diff] [blame] | 227 | table L2NormalizationLayer { |
| 228 | base:LayerBase; |
| 229 | descriptor:L2NormalizationDescriptor; |
| 230 | } |
| 231 | |
| 232 | table L2NormalizationDescriptor { |
| 233 | dataLayout:DataLayout = NCHW; |
Ferran Balaguer | 0dcffec | 2019-06-18 16:25:06 +0100 | [diff] [blame] | 234 | eps:float = 1e-12; |
Narumol Prangnawarat | 495701f | 2019-03-07 17:31:34 +0000 | [diff] [blame] | 235 | } |
| 236 | |
Aron Virginas-Tar | 0fe3245 | 2019-02-28 13:12:47 +0000 | [diff] [blame] | 237 | table MinimumLayer { |
| 238 | base:LayerBase; |
| 239 | } |
| 240 | |
Aron Virginas-Tar | 377351e | 2019-02-27 14:42:31 +0000 | [diff] [blame] | 241 | table MaximumLayer { |
| 242 | base:LayerBase; |
| 243 | } |
| 244 | |
Sadik Armagan | 5f45027 | 2019-02-12 14:31:45 +0000 | [diff] [blame] | 245 | table MultiplicationLayer { |
| 246 | base:LayerBase; |
| 247 | } |
| 248 | |
Saoirse Stewart | 3166c3e | 2019-02-18 15:24:53 +0000 | [diff] [blame] | 249 | table Pooling2dLayer { |
| 250 | base:LayerBase; |
| 251 | descriptor:Pooling2dDescriptor; |
| 252 | } |
| 253 | |
| 254 | enum PoolingAlgorithm : byte { |
| 255 | Max = 0, |
| 256 | Average = 1, |
| 257 | L2 = 2 |
| 258 | } |
| 259 | |
| 260 | enum OutputShapeRounding : byte { |
| 261 | Floor = 0, |
| 262 | Ceiling = 1 |
| 263 | } |
| 264 | |
| 265 | enum PaddingMethod : byte { |
| 266 | IgnoreValue = 0, |
| 267 | Exclude = 1 |
| 268 | } |
| 269 | |
| 270 | table Pooling2dDescriptor { |
| 271 | poolType:PoolingAlgorithm; |
| 272 | padLeft:uint; |
| 273 | padRight:uint; |
| 274 | padTop:uint; |
| 275 | padBottom:uint; |
| 276 | poolWidth:uint; |
| 277 | poolHeight:uint; |
| 278 | strideX:uint; |
| 279 | strideY:uint; |
| 280 | outputShapeRounding:OutputShapeRounding; |
| 281 | paddingMethod:PaddingMethod; |
| 282 | dataLayout:DataLayout; |
| 283 | } |
| 284 | |
Derek Lamberti | 87acb27 | 2019-03-27 16:51:31 +0000 | [diff] [blame] | 285 | table QuantizeLayer { |
| 286 | base:LayerBase; |
| 287 | } |
| 288 | |
Aron Virginas-Tar | fc413c0 | 2019-02-13 15:41:52 +0000 | [diff] [blame] | 289 | table SoftmaxLayer { |
| 290 | base:LayerBase; |
| 291 | descriptor:SoftmaxDescriptor; |
| 292 | } |
| 293 | |
| 294 | table SoftmaxDescriptor { |
| 295 | beta:float; |
| 296 | } |
| 297 | |
Aron Virginas-Tar | c04125f | 2019-02-19 16:31:08 +0000 | [diff] [blame] | 298 | table DepthwiseConvolution2dLayer { |
| 299 | base:LayerBase; |
| 300 | descriptor:DepthwiseConvolution2dDescriptor; |
| 301 | weights:ConstTensor; |
| 302 | biases:ConstTensor; |
| 303 | } |
| 304 | |
| 305 | table DepthwiseConvolution2dDescriptor { |
| 306 | padLeft:uint; |
| 307 | padRight:uint; |
| 308 | padTop:uint; |
| 309 | padBottom:uint; |
| 310 | strideX:uint; |
| 311 | strideY:uint; |
Matthew Bentham | acad04e | 2019-05-13 10:02:45 +0100 | [diff] [blame] | 312 | dilationX:uint = 1; |
| 313 | dilationY:uint = 1; |
Aron Virginas-Tar | c04125f | 2019-02-19 16:31:08 +0000 | [diff] [blame] | 314 | biasEnabled:bool = false; |
| 315 | dataLayout:DataLayout = NCHW; |
| 316 | } |
| 317 | |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 318 | table OutputLayer { |
| 319 | base:BindableLayerBase; |
| 320 | } |
| 321 | |
Saoirse Stewart | 263829c | 2019-02-19 15:54:14 +0000 | [diff] [blame] | 322 | table ReshapeLayer { |
| 323 | base:LayerBase; |
| 324 | descriptor:ReshapeDescriptor; |
| 325 | } |
| 326 | |
| 327 | table ReshapeDescriptor { |
| 328 | targetShape:[uint]; |
| 329 | } |
| 330 | |
Nattapat Chaimanowong | 30b0020 | 2019-02-20 17:31:34 +0000 | [diff] [blame] | 331 | table PermuteLayer { |
| 332 | base:LayerBase; |
| 333 | descriptor:PermuteDescriptor; |
| 334 | } |
| 335 | |
| 336 | table PermuteDescriptor { |
| 337 | dimMappings:[uint]; |
| 338 | } |
| 339 | |
Nattapat Chaimanowong | 4528699 | 2019-02-26 15:53:02 +0000 | [diff] [blame] | 340 | table SpaceToBatchNdLayer { |
| 341 | base:LayerBase; |
| 342 | descriptor:SpaceToBatchNdDescriptor; |
| 343 | } |
| 344 | |
| 345 | table SpaceToBatchNdDescriptor { |
| 346 | blockShape:[uint]; |
| 347 | padList:[uint]; |
| 348 | dataLayout:DataLayout; |
| 349 | } |
| 350 | |
Aron Virginas-Tar | aa06714 | 2019-06-11 16:01:44 +0100 | [diff] [blame] | 351 | table SpaceToDepthLayer { |
| 352 | base:LayerBase; |
| 353 | descriptor:SpaceToDepthDescriptor; |
| 354 | } |
| 355 | |
| 356 | table SpaceToDepthDescriptor { |
| 357 | blockSize:uint; |
| 358 | dataLayout:DataLayout; |
| 359 | } |
| 360 | |
Conor Kennedy | da1f975 | 2019-03-01 14:37:12 +0000 | [diff] [blame] | 361 | table SubtractionLayer { |
| 362 | base:LayerBase; |
| 363 | } |
| 364 | |
Nattapat Chaimanowong | 6b4ed98 | 2019-02-26 17:24:13 +0000 | [diff] [blame] | 365 | table BatchToSpaceNdLayer { |
| 366 | base:LayerBase; |
| 367 | descriptor:BatchToSpaceNdDescriptor; |
| 368 | } |
| 369 | |
| 370 | table BatchToSpaceNdDescriptor { |
| 371 | blockShape:[uint]; |
| 372 | crops:[uint]; |
| 373 | dataLayout:DataLayout; |
| 374 | } |
| 375 | |
Nina Drozd | 5772878 | 2019-02-27 10:53:27 +0000 | [diff] [blame] | 376 | enum NormalizationAlgorithmChannel : byte { |
| 377 | Across = 0, |
| 378 | Within = 1 |
| 379 | } |
| 380 | |
| 381 | enum NormalizationAlgorithmMethod : byte { |
| 382 | LocalBrightness = 0, |
| 383 | LocalContrast = 1 |
| 384 | } |
| 385 | |
| 386 | table NormalizationLayer { |
| 387 | base:LayerBase; |
| 388 | descriptor:NormalizationDescriptor; |
| 389 | } |
| 390 | |
| 391 | table NormalizationDescriptor { |
| 392 | normChannelType:NormalizationAlgorithmChannel = Across; |
| 393 | normMethodType:NormalizationAlgorithmMethod = LocalBrightness; |
| 394 | normSize:uint; |
| 395 | alpha:float; |
| 396 | beta:float; |
| 397 | k:float; |
| 398 | dataLayout:DataLayout = NCHW; |
| 399 | } |
| 400 | |
Sadik Armagan | ac97c8c | 2019-03-04 17:44:21 +0000 | [diff] [blame] | 401 | table MeanLayer { |
| 402 | base:LayerBase; |
| 403 | descriptor:MeanDescriptor; |
| 404 | } |
| 405 | |
| 406 | table MeanDescriptor { |
| 407 | axis:[uint]; |
| 408 | keepDims:bool = false; |
| 409 | } |
| 410 | |
Nattapat Chaimanowong | ebb0f9c | 2019-03-01 12:14:06 +0000 | [diff] [blame] | 411 | table PadLayer { |
| 412 | base:LayerBase; |
| 413 | descriptor:PadDescriptor; |
| 414 | } |
| 415 | |
| 416 | table PadDescriptor { |
| 417 | padList:[uint]; |
David Monahan | 3475781 | 2019-06-19 11:47:21 +0100 | [diff] [blame] | 418 | padValue:float = 0; |
Nattapat Chaimanowong | ebb0f9c | 2019-03-01 12:14:06 +0000 | [diff] [blame] | 419 | } |
| 420 | |
Sadik Armagan | 8b42a38 | 2019-03-01 14:24:49 +0000 | [diff] [blame] | 421 | table RsqrtLayer { |
| 422 | base:LayerBase; |
| 423 | } |
| 424 | |
ruoyan01 | 8e7fa23 | 2019-02-28 15:09:07 +0000 | [diff] [blame] | 425 | table BatchNormalizationLayer { |
| 426 | base:LayerBase; |
| 427 | descriptor:BatchNormalizationDescriptor; |
| 428 | mean:ConstTensor; |
| 429 | variance:ConstTensor; |
| 430 | beta:ConstTensor; |
| 431 | gamma:ConstTensor; |
| 432 | } |
| 433 | |
| 434 | table BatchNormalizationDescriptor { |
| 435 | eps:float; |
| 436 | dataLayout:DataLayout; |
| 437 | } |
| 438 | |
Nattapat Chaimanowong | 6522cdc | 2019-03-01 16:14:13 +0000 | [diff] [blame] | 439 | table ResizeBilinearLayer { |
| 440 | base:LayerBase; |
| 441 | descriptor:ResizeBilinearDescriptor; |
| 442 | } |
| 443 | |
| 444 | table ResizeBilinearDescriptor { |
| 445 | targetWidth:uint; |
| 446 | targetHeight:uint; |
| 447 | dataLayout:DataLayout; |
| 448 | } |
| 449 | |
Nattapat Chaimanowong | b348521 | 2019-03-04 12:35:39 +0000 | [diff] [blame] | 450 | table StridedSliceLayer { |
| 451 | base:LayerBase; |
| 452 | descriptor:StridedSliceDescriptor; |
| 453 | } |
| 454 | |
| 455 | table StridedSliceDescriptor { |
| 456 | begin:[int]; |
| 457 | end:[int]; |
| 458 | stride:[int]; |
| 459 | beginMask:int; |
| 460 | endMask:int; |
| 461 | shrinkAxisMask:int; |
| 462 | ellipsisMask:int; |
| 463 | newAxisMask:int; |
| 464 | dataLayout:DataLayout; |
| 465 | } |
| 466 | |
Jim Flynn | e242f2d | 2019-05-22 14:24:13 +0100 | [diff] [blame] | 467 | table ConcatLayer { |
| 468 | base:LayerBase; |
| 469 | descriptor:OriginsDescriptor; |
| 470 | } |
| 471 | |
Jim Flynn | ac25a1b | 2019-02-28 10:40:49 +0000 | [diff] [blame] | 472 | table MergerLayer { |
| 473 | base:LayerBase; |
| 474 | descriptor:OriginsDescriptor; |
| 475 | } |
| 476 | |
| 477 | table UintVector { |
| 478 | data:[uint]; |
| 479 | } |
| 480 | |
| 481 | table OriginsDescriptor { |
| 482 | concatAxis:uint; |
| 483 | numViews:uint; |
| 484 | numDimensions:uint; |
| 485 | viewOrigins:[UintVector]; |
| 486 | } |
| 487 | |
Jim Flynn | 18ce338 | 2019-03-08 11:08:30 +0000 | [diff] [blame] | 488 | table ViewsDescriptor { |
| 489 | origins:OriginsDescriptor; |
| 490 | viewSizes:[UintVector]; |
| 491 | } |
| 492 | |
| 493 | table SplitterLayer { |
| 494 | base:LayerBase; |
| 495 | descriptor:ViewsDescriptor; |
| 496 | } |
| 497 | |
Nattapat Chaimanowong | 3e14a9d | 2019-03-18 12:37:06 +0000 | [diff] [blame] | 498 | table DetectionPostProcessLayer { |
| 499 | base:LayerBase; |
| 500 | descriptor:DetectionPostProcessDescriptor; |
| 501 | anchors:ConstTensor; |
| 502 | } |
| 503 | |
| 504 | table DetectionPostProcessDescriptor { |
| 505 | maxDetections:uint; |
| 506 | maxClassesPerDetection:uint; |
| 507 | detectionsPerClass:uint; |
| 508 | nmsScoreThreshold:float; |
| 509 | nmsIouThreshold:float; |
| 510 | numClasses:uint; |
| 511 | useRegularNms:bool; |
| 512 | scaleX:float; |
| 513 | scaleY:float; |
| 514 | scaleW:float; |
| 515 | scaleH:float; |
| 516 | } |
| 517 | |
Jim Flynn | 11af375 | 2019-03-19 17:22:29 +0000 | [diff] [blame] | 518 | table LstmInputParams { |
| 519 | inputToForgetWeights:ConstTensor; |
| 520 | inputToCellWeights:ConstTensor; |
| 521 | inputToOutputWeights:ConstTensor; |
| 522 | recurrentToForgetWeights:ConstTensor; |
| 523 | recurrentToCellWeights:ConstTensor; |
| 524 | recurrentToOutputWeights:ConstTensor; |
| 525 | forgetGateBias:ConstTensor; |
| 526 | cellBias:ConstTensor; |
| 527 | outputGateBias:ConstTensor; |
| 528 | |
| 529 | inputToInputWeights:ConstTensor; |
| 530 | recurrentToInputWeights:ConstTensor; |
| 531 | cellToInputWeights:ConstTensor; |
| 532 | inputGateBias:ConstTensor; |
| 533 | |
| 534 | projectionWeights:ConstTensor; |
| 535 | projectionBias:ConstTensor; |
| 536 | |
| 537 | cellToForgetWeights:ConstTensor; |
| 538 | cellToOutputWeights:ConstTensor; |
| 539 | } |
| 540 | |
| 541 | table LstmDescriptor { |
| 542 | activationFunc:uint; |
| 543 | clippingThresCell:float; |
| 544 | clippingThresProj:float; |
| 545 | cifgEnabled:bool = true; |
| 546 | peepholeEnabled:bool = false; |
| 547 | projectionEnabled:bool = false; |
| 548 | } |
| 549 | |
| 550 | table LstmLayer { |
| 551 | base:LayerBase; |
| 552 | descriptor:LstmDescriptor; |
| 553 | inputParams:LstmInputParams; |
| 554 | } |
| 555 | |
Nattapat Chaimanowong | e4294fd | 2019-03-28 09:56:53 +0000 | [diff] [blame] | 556 | table DequantizeLayer { |
| 557 | base:LayerBase; |
| 558 | } |
| 559 | |
Nattapat Chaimanowong | 1f88630 | 2019-04-05 13:37:19 +0100 | [diff] [blame] | 560 | table MergeLayer { |
| 561 | base:LayerBase; |
| 562 | } |
| 563 | |
Sadik Armagan | eff363d | 2019-04-05 15:25:46 +0100 | [diff] [blame] | 564 | table SwitchLayer { |
| 565 | base:LayerBase; |
| 566 | } |
| 567 | |
Ellen Norris-Thompson | 5198247 | 2019-06-19 11:46:21 +0100 | [diff] [blame] | 568 | table PreluLayer { |
| 569 | base:LayerBase; |
| 570 | } |
| 571 | |
Aron Virginas-Tar | cb54930 | 2019-06-21 13:53:38 +0100 | [diff] [blame] | 572 | table TransposeConvolution2dLayer { |
| 573 | base:LayerBase; |
| 574 | descriptor:TransposeConvolution2dDescriptor; |
| 575 | weights:ConstTensor; |
| 576 | biases:ConstTensor; |
| 577 | } |
| 578 | |
| 579 | table TransposeConvolution2dDescriptor { |
| 580 | padLeft:uint; |
| 581 | padRight:uint; |
| 582 | padTop:uint; |
| 583 | padBottom:uint; |
| 584 | strideX:uint; |
| 585 | strideY:uint; |
| 586 | biasEnabled:bool = false; |
| 587 | dataLayout:DataLayout = NCHW; |
| 588 | } |
| 589 | |
FinnWilliamsArm | 6fb339a | 2019-06-28 15:07:10 +0100 | [diff] [blame] | 590 | table ResizeLayer { |
| 591 | base:LayerBase; |
| 592 | descriptor:ResizeDescriptor; |
| 593 | } |
| 594 | |
| 595 | table ResizeDescriptor { |
| 596 | targetHeight:uint; |
| 597 | targetWidth:uint; |
| 598 | method:ResizeMethod = NearestNeighbor; |
| 599 | dataLayout:DataLayout; |
| 600 | } |
| 601 | |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 602 | union Layer { |
Mike Kelly | af48401 | 2019-02-20 16:53:11 +0000 | [diff] [blame] | 603 | ActivationLayer, |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 604 | AdditionLayer, |
Nattapat Chaimanowong | 6b4ed98 | 2019-02-26 17:24:13 +0000 | [diff] [blame] | 605 | BatchToSpaceNdLayer, |
ruoyan01 | 8e7fa23 | 2019-02-28 15:09:07 +0000 | [diff] [blame] | 606 | BatchNormalizationLayer, |
Conor Kennedy | 7627788 | 2019-02-26 08:29:54 +0000 | [diff] [blame] | 607 | ConstantLayer, |
Mike Kelly | a0766c3 | 2019-02-19 17:22:07 +0000 | [diff] [blame] | 608 | Convolution2dLayer, |
Aron Virginas-Tar | c04125f | 2019-02-19 16:31:08 +0000 | [diff] [blame] | 609 | DepthwiseConvolution2dLayer, |
Sadik Armagan | dbb0c0c | 2019-02-21 09:01:41 +0000 | [diff] [blame] | 610 | FullyConnectedLayer, |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 611 | InputLayer, |
Sadik Armagan | 5f45027 | 2019-02-12 14:31:45 +0000 | [diff] [blame] | 612 | MultiplicationLayer, |
Aron Virginas-Tar | fc413c0 | 2019-02-13 15:41:52 +0000 | [diff] [blame] | 613 | OutputLayer, |
Nattapat Chaimanowong | 30b0020 | 2019-02-20 17:31:34 +0000 | [diff] [blame] | 614 | PermuteLayer, |
Saoirse Stewart | 3166c3e | 2019-02-18 15:24:53 +0000 | [diff] [blame] | 615 | Pooling2dLayer, |
Saoirse Stewart | 263829c | 2019-02-19 15:54:14 +0000 | [diff] [blame] | 616 | ReshapeLayer, |
Nattapat Chaimanowong | 4528699 | 2019-02-26 15:53:02 +0000 | [diff] [blame] | 617 | SoftmaxLayer, |
Éanna Ó Catháin | 5888589 | 2019-02-27 16:16:39 +0000 | [diff] [blame] | 618 | SpaceToBatchNdLayer, |
Aron Virginas-Tar | 0fe3245 | 2019-02-28 13:12:47 +0000 | [diff] [blame] | 619 | DivisionLayer, |
Nattapat Chaimanowong | 235cea5 | 2019-02-28 16:27:30 +0000 | [diff] [blame] | 620 | MinimumLayer, |
Aron Virginas-Tar | 377351e | 2019-02-27 14:42:31 +0000 | [diff] [blame] | 621 | EqualLayer, |
Nina Drozd | 5772878 | 2019-02-27 10:53:27 +0000 | [diff] [blame] | 622 | MaximumLayer, |
Nattapat Chaimanowong | ebb0f9c | 2019-03-01 12:14:06 +0000 | [diff] [blame] | 623 | NormalizationLayer, |
Sadik Armagan | 8b42a38 | 2019-03-01 14:24:49 +0000 | [diff] [blame] | 624 | PadLayer, |
Finn Williams | dd2ba7e | 2019-03-01 11:51:52 +0000 | [diff] [blame] | 625 | RsqrtLayer, |
Conor Kennedy | 79ffdf5 | 2019-03-01 14:24:54 +0000 | [diff] [blame] | 626 | FloorLayer, |
Nattapat Chaimanowong | 6522cdc | 2019-03-01 16:14:13 +0000 | [diff] [blame] | 627 | GreaterLayer, |
Conor Kennedy | da1f975 | 2019-03-01 14:37:12 +0000 | [diff] [blame] | 628 | ResizeBilinearLayer, |
Nattapat Chaimanowong | b348521 | 2019-03-04 12:35:39 +0000 | [diff] [blame] | 629 | SubtractionLayer, |
Saoirse Stewart | a1ed73a | 2019-03-04 13:40:12 +0000 | [diff] [blame] | 630 | StridedSliceLayer, |
Sadik Armagan | ac97c8c | 2019-03-04 17:44:21 +0000 | [diff] [blame] | 631 | GatherLayer, |
Jim Flynn | ac25a1b | 2019-02-28 10:40:49 +0000 | [diff] [blame] | 632 | MeanLayer, |
Narumol Prangnawarat | 495701f | 2019-03-07 17:31:34 +0000 | [diff] [blame] | 633 | MergerLayer, |
Jim Flynn | 18ce338 | 2019-03-08 11:08:30 +0000 | [diff] [blame] | 634 | L2NormalizationLayer, |
Nattapat Chaimanowong | 3e14a9d | 2019-03-18 12:37:06 +0000 | [diff] [blame] | 635 | SplitterLayer, |
Jim Flynn | 11af375 | 2019-03-19 17:22:29 +0000 | [diff] [blame] | 636 | DetectionPostProcessLayer, |
Derek Lamberti | 87acb27 | 2019-03-27 16:51:31 +0000 | [diff] [blame] | 637 | LstmLayer, |
Nattapat Chaimanowong | e4294fd | 2019-03-28 09:56:53 +0000 | [diff] [blame] | 638 | QuantizeLayer, |
Nattapat Chaimanowong | 1f88630 | 2019-04-05 13:37:19 +0100 | [diff] [blame] | 639 | DequantizeLayer, |
Sadik Armagan | eff363d | 2019-04-05 15:25:46 +0100 | [diff] [blame] | 640 | MergeLayer, |
Jim Flynn | e242f2d | 2019-05-22 14:24:13 +0100 | [diff] [blame] | 641 | SwitchLayer, |
Aron Virginas-Tar | aa06714 | 2019-06-11 16:01:44 +0100 | [diff] [blame] | 642 | ConcatLayer, |
Ellen Norris-Thompson | 5198247 | 2019-06-19 11:46:21 +0100 | [diff] [blame] | 643 | SpaceToDepthLayer, |
Aron Virginas-Tar | cb54930 | 2019-06-21 13:53:38 +0100 | [diff] [blame] | 644 | PreluLayer, |
FinnWilliamsArm | 6fb339a | 2019-06-28 15:07:10 +0100 | [diff] [blame] | 645 | TransposeConvolution2dLayer, |
| 646 | ResizeLayer |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 647 | } |
| 648 | |
Saoirse Stewart | 49dbe0e | 2019-02-05 17:27:06 +0000 | [diff] [blame] | 649 | table AnyLayer { |
| 650 | layer:Layer; |
| 651 | } |
| 652 | |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 653 | // Root type for serialized data is the graph of the network |
| 654 | table SerializedGraph { |
Saoirse Stewart | 49dbe0e | 2019-02-05 17:27:06 +0000 | [diff] [blame] | 655 | layers:[AnyLayer]; |
Mike Kelly | 8c1701a | 2019-02-11 17:01:27 +0000 | [diff] [blame] | 656 | inputIds:[uint]; |
| 657 | outputIds:[uint]; |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 658 | } |
| 659 | |
| 660 | root_type SerializedGraph; |