Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 1 | // |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 2 | // Copyright © 2017 Arm Ltd and Contributors. All rights reserved. |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 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, |
David Monahan | 3b3c381 | 2020-02-25 09:03:29 +0000 | [diff] [blame] | 22 | Square = 9, |
Colm Donelan | 03fbeaf | 2020-02-26 15:39:23 +0000 | [diff] [blame] | 23 | Elu = 10, |
| 24 | HardSwish = 11 |
Mike Kelly | af48401 | 2019-02-20 16:53:11 +0000 | [diff] [blame] | 25 | } |
| 26 | |
Narumol Prangnawarat | 0cfcf23 | 2019-09-09 17:16:24 +0100 | [diff] [blame] | 27 | enum ArgMinMaxFunction : byte { |
| 28 | Min = 0, |
| 29 | Max = 1 |
| 30 | } |
| 31 | |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 32 | enum DataType : byte { |
| 33 | Float16 = 0, |
| 34 | Float32 = 1, |
Derek Lamberti | f90c56d | 2020-01-10 17:14:08 +0000 | [diff] [blame] | 35 | QuantisedAsymm8 = 2, // deprecated |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 36 | Signed32 = 3, |
Nattapat Chaimanowong | cd5ac23 | 2019-03-19 12:26:36 +0000 | [diff] [blame] | 37 | Boolean = 4, |
Derek Lamberti | f90c56d | 2020-01-10 17:14:08 +0000 | [diff] [blame] | 38 | QuantisedSymm16 = 5, // deprecated |
| 39 | QAsymmU8 = 6, |
Francis Murtagh | ddb1d06 | 2020-03-10 13:51:45 +0000 | [diff] [blame] | 40 | QSymmS16 = 7, |
Sadik Armagan | 1a84fe3 | 2020-03-27 15:56:57 +0000 | [diff] [blame] | 41 | QAsymmS8 = 8, |
| 42 | QSymmS8 = 9 |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 43 | } |
| 44 | |
Saoirse Stewart | 3166c3e | 2019-02-18 15:24:53 +0000 | [diff] [blame] | 45 | enum DataLayout : byte { |
| 46 | NHWC = 0, |
| 47 | NCHW = 1 |
| 48 | } |
| 49 | |
FinnWilliamsArm | 6fb339a | 2019-06-28 15:07:10 +0100 | [diff] [blame] | 50 | enum ResizeMethod: byte { |
| 51 | NearestNeighbor = 0, |
| 52 | Bilinear = 1, |
| 53 | } |
| 54 | |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 55 | table TensorInfo { |
| 56 | dimensions:[uint]; |
| 57 | dataType:DataType; |
Sadik Armagan | 1a84fe3 | 2020-03-27 15:56:57 +0000 | [diff] [blame] | 58 | quantizationScale:float = 1.0; // @deprecated Use quantizationScales instead |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 59 | quantizationOffset:int = 0; |
Sadik Armagan | 1a84fe3 | 2020-03-27 15:56:57 +0000 | [diff] [blame] | 60 | quantizationScales:[float]; |
| 61 | quantizationDim:uint; |
Finn Williams | 2605b23 | 2020-06-10 15:53:46 +0100 | [diff] [blame] | 62 | dimensionality:uint = 1; |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 63 | } |
| 64 | |
| 65 | struct Connection { |
| 66 | sourceLayerIndex:uint; |
| 67 | outputSlotIndex:uint; |
| 68 | } |
| 69 | |
| 70 | table ByteData { |
| 71 | data:[byte]; |
| 72 | } |
| 73 | |
| 74 | table ShortData { |
| 75 | data:[short]; |
| 76 | } |
| 77 | |
| 78 | table IntData { |
| 79 | data:[int]; |
| 80 | } |
| 81 | |
| 82 | table LongData { |
| 83 | data:[long]; |
| 84 | } |
| 85 | |
| 86 | union ConstTensorData { ByteData, ShortData, IntData, LongData } |
| 87 | |
| 88 | table ConstTensor { |
| 89 | info:TensorInfo; |
| 90 | data:ConstTensorData; |
| 91 | } |
| 92 | |
| 93 | table InputSlot { |
| 94 | index:uint; |
| 95 | connection:Connection; |
| 96 | } |
| 97 | |
| 98 | table OutputSlot { |
| 99 | index:uint; |
| 100 | tensorInfo:TensorInfo; |
| 101 | } |
| 102 | |
| 103 | enum LayerType : uint { |
| 104 | Addition = 0, |
| 105 | Input = 1, |
Sadik Armagan | 5f45027 | 2019-02-12 14:31:45 +0000 | [diff] [blame] | 106 | Multiplication = 2, |
Aron Virginas-Tar | fc413c0 | 2019-02-13 15:41:52 +0000 | [diff] [blame] | 107 | Output = 3, |
Saoirse Stewart | 3166c3e | 2019-02-18 15:24:53 +0000 | [diff] [blame] | 108 | Pooling2d = 4, |
Saoirse Stewart | 263829c | 2019-02-19 15:54:14 +0000 | [diff] [blame] | 109 | Reshape = 5, |
Mike Kelly | a0766c3 | 2019-02-19 17:22:07 +0000 | [diff] [blame] | 110 | Softmax = 6, |
Aron Virginas-Tar | c04125f | 2019-02-19 16:31:08 +0000 | [diff] [blame] | 111 | Convolution2d = 7, |
Mike Kelly | af48401 | 2019-02-20 16:53:11 +0000 | [diff] [blame] | 112 | DepthwiseConvolution2d = 8, |
Nattapat Chaimanowong | 30b0020 | 2019-02-20 17:31:34 +0000 | [diff] [blame] | 113 | Activation = 9, |
Sadik Armagan | dbb0c0c | 2019-02-21 09:01:41 +0000 | [diff] [blame] | 114 | Permute = 10, |
Conor Kennedy | 7627788 | 2019-02-26 08:29:54 +0000 | [diff] [blame] | 115 | FullyConnected = 11, |
Nattapat Chaimanowong | 4528699 | 2019-02-26 15:53:02 +0000 | [diff] [blame] | 116 | Constant = 12, |
Nattapat Chaimanowong | 6b4ed98 | 2019-02-26 17:24:13 +0000 | [diff] [blame] | 117 | SpaceToBatchNd = 13, |
Éanna Ó Catháin | 5888589 | 2019-02-27 16:16:39 +0000 | [diff] [blame] | 118 | BatchToSpaceNd = 14, |
Aron Virginas-Tar | 0fe3245 | 2019-02-28 13:12:47 +0000 | [diff] [blame] | 119 | Division = 15, |
Nattapat Chaimanowong | 235cea5 | 2019-02-28 16:27:30 +0000 | [diff] [blame] | 120 | Minimum = 16, |
Aron Virginas-Tar | 377351e | 2019-02-27 14:42:31 +0000 | [diff] [blame] | 121 | Equal = 17, |
Nina Drozd | 5772878 | 2019-02-27 10:53:27 +0000 | [diff] [blame] | 122 | Maximum = 18, |
Nattapat Chaimanowong | ebb0f9c | 2019-03-01 12:14:06 +0000 | [diff] [blame] | 123 | Normalization = 19, |
Sadik Armagan | 8b42a38 | 2019-03-01 14:24:49 +0000 | [diff] [blame] | 124 | Pad = 20, |
Finn Williams | dd2ba7e | 2019-03-01 11:51:52 +0000 | [diff] [blame] | 125 | Rsqrt = 21, |
ruoyan01 | 8e7fa23 | 2019-02-28 15:09:07 +0000 | [diff] [blame] | 126 | Floor = 22, |
Conor Kennedy | 79ffdf5 | 2019-03-01 14:24:54 +0000 | [diff] [blame] | 127 | BatchNormalization = 23, |
Nattapat Chaimanowong | 6522cdc | 2019-03-01 16:14:13 +0000 | [diff] [blame] | 128 | Greater = 24, |
Conor Kennedy | da1f975 | 2019-03-01 14:37:12 +0000 | [diff] [blame] | 129 | ResizeBilinear = 25, |
Nattapat Chaimanowong | b348521 | 2019-03-04 12:35:39 +0000 | [diff] [blame] | 130 | Subtraction = 26, |
Saoirse Stewart | a1ed73a | 2019-03-04 13:40:12 +0000 | [diff] [blame] | 131 | StridedSlice = 27, |
Sadik Armagan | ac97c8c | 2019-03-04 17:44:21 +0000 | [diff] [blame] | 132 | Gather = 28, |
Jim Flynn | ac25a1b | 2019-02-28 10:40:49 +0000 | [diff] [blame] | 133 | Mean = 29, |
Narumol Prangnawarat | 495701f | 2019-03-07 17:31:34 +0000 | [diff] [blame] | 134 | Merger = 30, |
Jim Flynn | 18ce338 | 2019-03-08 11:08:30 +0000 | [diff] [blame] | 135 | L2Normalization = 31, |
Nattapat Chaimanowong | 3e14a9d | 2019-03-18 12:37:06 +0000 | [diff] [blame] | 136 | Splitter = 32, |
Jim Flynn | 11af375 | 2019-03-19 17:22:29 +0000 | [diff] [blame] | 137 | DetectionPostProcess = 33, |
Derek Lamberti | 87acb27 | 2019-03-27 16:51:31 +0000 | [diff] [blame] | 138 | Lstm = 34, |
Nattapat Chaimanowong | e4294fd | 2019-03-28 09:56:53 +0000 | [diff] [blame] | 139 | Quantize = 35, |
Nattapat Chaimanowong | 1f88630 | 2019-04-05 13:37:19 +0100 | [diff] [blame] | 140 | Dequantize = 36, |
Sadik Armagan | eff363d | 2019-04-05 15:25:46 +0100 | [diff] [blame] | 141 | Merge = 37, |
Jim Flynn | e242f2d | 2019-05-22 14:24:13 +0100 | [diff] [blame] | 142 | Switch = 38, |
Aron Virginas-Tar | aa06714 | 2019-06-11 16:01:44 +0100 | [diff] [blame] | 143 | Concat = 39, |
Ellen Norris-Thompson | 5198247 | 2019-06-19 11:46:21 +0100 | [diff] [blame] | 144 | SpaceToDepth = 40, |
Aron Virginas-Tar | cb54930 | 2019-06-21 13:53:38 +0100 | [diff] [blame] | 145 | Prelu = 41, |
FinnWilliamsArm | 6fb339a | 2019-06-28 15:07:10 +0100 | [diff] [blame] | 146 | TransposeConvolution2d = 42, |
Matthew Jackson | b5433ee | 2019-07-11 15:54:20 +0100 | [diff] [blame] | 147 | Resize = 43, |
Jan Eilers | 5b01a89 | 2019-07-23 09:47:43 +0100 | [diff] [blame] | 148 | Stack = 44, |
FinnWilliamsArm | 4ffcc8f | 2019-09-05 14:34:20 +0100 | [diff] [blame] | 149 | QuantizedLstm = 45, |
Narumol Prangnawarat | 0cfcf23 | 2019-09-09 17:16:24 +0100 | [diff] [blame] | 150 | Abs = 46, |
Aron Virginas-Tar | 2fda80b | 2019-09-18 13:36:52 +0100 | [diff] [blame] | 151 | ArgMinMax = 47, |
Aron Virginas-Tar | da9d2d3 | 2019-09-20 10:42:02 +0100 | [diff] [blame] | 152 | Slice = 48, |
Aron Virginas-Tar | 781ced9 | 2019-10-03 11:15:39 +0100 | [diff] [blame] | 153 | DepthToSpace = 49, |
Sadik Armagan | 2625785 | 2019-10-14 13:00:47 +0100 | [diff] [blame] | 154 | InstanceNormalization = 50, |
Aron Virginas-Tar | e80ebd1 | 2019-10-17 16:11:54 +0100 | [diff] [blame] | 155 | LogSoftmax = 51, |
Aron Virginas-Tar | 85121a2 | 2019-10-23 10:41:35 +0100 | [diff] [blame] | 156 | Comparison = 52, |
josh minor | 4a3c610 | 2020-01-06 16:40:46 -0600 | [diff] [blame] | 157 | StandIn = 53, |
Mike Kelly | c9ea45a | 2020-02-28 18:11:58 +0000 | [diff] [blame] | 158 | ElementwiseUnary = 54, |
James Conroy | 8d33318 | 2020-05-13 10:27:58 +0100 | [diff] [blame] | 159 | Transpose = 55, |
Keith Davis | 300ad56 | 2020-06-04 16:34:23 +0100 | [diff] [blame] | 160 | QLstm = 56, |
Finn Williams | 2605b23 | 2020-06-10 15:53:46 +0100 | [diff] [blame] | 161 | Fill = 57, |
James Conroy | aba90cd | 2020-11-06 16:28:18 +0000 | [diff] [blame] | 162 | Rank = 58, |
| 163 | LogicalBinary = 59 |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 164 | } |
| 165 | |
| 166 | // Base layer table to be used as part of other layers |
| 167 | table LayerBase { |
| 168 | index:uint; |
| 169 | layerName:string; |
| 170 | layerType:LayerType; |
| 171 | inputSlots:[InputSlot]; |
| 172 | outputSlots:[OutputSlot]; |
| 173 | } |
| 174 | |
| 175 | table BindableLayerBase { |
| 176 | base:LayerBase; |
| 177 | layerBindingId:int; |
| 178 | } |
| 179 | |
| 180 | // Table for each layer defined below |
FinnWilliamsArm | 4ffcc8f | 2019-09-05 14:34:20 +0100 | [diff] [blame] | 181 | |
josh minor | 4a3c610 | 2020-01-06 16:40:46 -0600 | [diff] [blame] | 182 | /// @deprecated Use ElementwiseUnaryLayer instead |
FinnWilliamsArm | 4ffcc8f | 2019-09-05 14:34:20 +0100 | [diff] [blame] | 183 | table AbsLayer { |
| 184 | base:LayerBase; |
| 185 | } |
| 186 | |
Mike Kelly | af48401 | 2019-02-20 16:53:11 +0000 | [diff] [blame] | 187 | table ActivationLayer { |
| 188 | base:LayerBase; |
| 189 | descriptor:ActivationDescriptor; |
| 190 | } |
| 191 | |
| 192 | table ActivationDescriptor { |
Tee Jung | 86bc3d8 | 2019-10-01 11:25:56 +0900 | [diff] [blame] | 193 | activationFunction:ActivationFunction = Sigmoid; |
Mike Kelly | af48401 | 2019-02-20 16:53:11 +0000 | [diff] [blame] | 194 | a:float; |
| 195 | b:float; |
| 196 | } |
| 197 | |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 198 | table AdditionLayer { |
| 199 | base:LayerBase; |
| 200 | } |
| 201 | |
Narumol Prangnawarat | 0cfcf23 | 2019-09-09 17:16:24 +0100 | [diff] [blame] | 202 | table ArgMinMaxLayer { |
| 203 | base:LayerBase; |
| 204 | descriptor:ArgMinMaxDescriptor; |
| 205 | } |
| 206 | |
| 207 | table ArgMinMaxDescriptor{ |
Tee Jung | 86bc3d8 | 2019-10-01 11:25:56 +0900 | [diff] [blame] | 208 | argMinMaxFunction:ArgMinMaxFunction; |
Narumol Prangnawarat | 0cfcf23 | 2019-09-09 17:16:24 +0100 | [diff] [blame] | 209 | axis:int; |
| 210 | } |
| 211 | |
Aron Virginas-Tar | e80ebd1 | 2019-10-17 16:11:54 +0100 | [diff] [blame] | 212 | enum ComparisonOperation : byte { |
| 213 | Equal = 0, |
| 214 | Greater = 1, |
| 215 | GreaterOrEqual = 2, |
| 216 | Less = 3, |
| 217 | LessOrEqual = 4, |
| 218 | NotEqual = 5 |
| 219 | } |
| 220 | |
| 221 | table ComparisonDescriptor { |
| 222 | operation:ComparisonOperation; |
| 223 | } |
| 224 | |
| 225 | table ComparisonLayer { |
| 226 | base:LayerBase; |
| 227 | descriptor:ComparisonDescriptor; |
| 228 | } |
| 229 | |
Conor Kennedy | 7627788 | 2019-02-26 08:29:54 +0000 | [diff] [blame] | 230 | table ConstantLayer { |
| 231 | base:LayerBase; |
| 232 | input:ConstTensor; |
| 233 | } |
| 234 | |
Mike Kelly | a0766c3 | 2019-02-19 17:22:07 +0000 | [diff] [blame] | 235 | table Convolution2dLayer { |
| 236 | base:LayerBase; |
| 237 | descriptor:Convolution2dDescriptor; |
| 238 | weights:ConstTensor; |
| 239 | biases:ConstTensor; |
| 240 | } |
| 241 | |
| 242 | table Convolution2dDescriptor { |
| 243 | padLeft:uint; |
| 244 | padRight:uint; |
| 245 | padTop:uint; |
| 246 | padBottom:uint; |
| 247 | strideX:uint; |
| 248 | strideY:uint; |
Matthew Bentham | acad04e | 2019-05-13 10:02:45 +0100 | [diff] [blame] | 249 | dilationX:uint = 1; |
| 250 | dilationY:uint = 1; |
Mike Kelly | a0766c3 | 2019-02-19 17:22:07 +0000 | [diff] [blame] | 251 | biasEnabled:bool = false; |
| 252 | dataLayout:DataLayout = NCHW; |
| 253 | } |
| 254 | |
Aron Virginas-Tar | da9d2d3 | 2019-09-20 10:42:02 +0100 | [diff] [blame] | 255 | table DepthToSpaceLayer { |
| 256 | base:LayerBase; |
| 257 | descriptor:DepthToSpaceDescriptor; |
| 258 | } |
| 259 | |
| 260 | table DepthToSpaceDescriptor { |
| 261 | blockSize:uint; |
| 262 | dataLayout:DataLayout; |
| 263 | } |
| 264 | |
Éanna Ó Catháin | 5888589 | 2019-02-27 16:16:39 +0000 | [diff] [blame] | 265 | table DivisionLayer { |
| 266 | base:LayerBase; |
| 267 | } |
| 268 | |
josh minor | 4a3c610 | 2020-01-06 16:40:46 -0600 | [diff] [blame] | 269 | enum UnaryOperation : byte { |
| 270 | Abs = 0, |
| 271 | Rsqrt = 1, |
| 272 | Sqrt = 2, |
| 273 | Exp = 3, |
James Conroy | aba90cd | 2020-11-06 16:28:18 +0000 | [diff] [blame] | 274 | Neg = 4, |
| 275 | LogicalNot = 5 |
josh minor | 4a3c610 | 2020-01-06 16:40:46 -0600 | [diff] [blame] | 276 | } |
| 277 | |
| 278 | table ElementwiseUnaryDescriptor { |
| 279 | operation:UnaryOperation; |
| 280 | } |
| 281 | |
| 282 | table ElementwiseUnaryLayer { |
| 283 | base:LayerBase; |
| 284 | descriptor:ElementwiseUnaryDescriptor; |
| 285 | } |
| 286 | |
Aron Virginas-Tar | e80ebd1 | 2019-10-17 16:11:54 +0100 | [diff] [blame] | 287 | /// @deprecated Use ComparisonLayer instead |
Nattapat Chaimanowong | 235cea5 | 2019-02-28 16:27:30 +0000 | [diff] [blame] | 288 | table EqualLayer { |
| 289 | base:LayerBase; |
| 290 | } |
| 291 | |
Keith Davis | 300ad56 | 2020-06-04 16:34:23 +0100 | [diff] [blame] | 292 | table FillLayer { |
| 293 | base:LayerBase; |
| 294 | descriptor:FillDescriptor; |
| 295 | } |
| 296 | |
| 297 | table FillDescriptor { |
| 298 | value:float; |
| 299 | } |
| 300 | |
Finn Williams | dd2ba7e | 2019-03-01 11:51:52 +0000 | [diff] [blame] | 301 | table FloorLayer{ |
| 302 | base:LayerBase; |
| 303 | } |
| 304 | |
Sadik Armagan | dbb0c0c | 2019-02-21 09:01:41 +0000 | [diff] [blame] | 305 | table FullyConnectedLayer { |
| 306 | base:LayerBase; |
| 307 | descriptor:FullyConnectedDescriptor; |
| 308 | weights:ConstTensor; |
| 309 | biases:ConstTensor; |
| 310 | } |
| 311 | |
| 312 | table FullyConnectedDescriptor { |
| 313 | biasEnabled:bool = false; |
| 314 | transposeWeightsMatrix:bool = false; |
| 315 | } |
| 316 | |
Saoirse Stewart | a1ed73a | 2019-03-04 13:40:12 +0000 | [diff] [blame] | 317 | table GatherLayer { |
| 318 | base:LayerBase; |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 319 | descriptor:GatherDescriptor; |
| 320 | } |
| 321 | |
| 322 | table GatherDescriptor { |
| 323 | axis:int = 0; |
Saoirse Stewart | a1ed73a | 2019-03-04 13:40:12 +0000 | [diff] [blame] | 324 | } |
| 325 | |
Aron Virginas-Tar | e80ebd1 | 2019-10-17 16:11:54 +0100 | [diff] [blame] | 326 | /// @deprecated Use ComparisonLayer instead |
Conor Kennedy | 79ffdf5 | 2019-03-01 14:24:54 +0000 | [diff] [blame] | 327 | table GreaterLayer { |
| 328 | base:LayerBase; |
| 329 | } |
| 330 | |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 331 | table InputLayer { |
| 332 | base:BindableLayerBase; |
| 333 | } |
| 334 | |
Aron Virginas-Tar | 781ced9 | 2019-10-03 11:15:39 +0100 | [diff] [blame] | 335 | table InstanceNormalizationLayer { |
| 336 | base:LayerBase; |
| 337 | descriptor:InstanceNormalizationDescriptor; |
| 338 | } |
| 339 | |
| 340 | table InstanceNormalizationDescriptor { |
| 341 | gamma:float; |
| 342 | beta:float; |
| 343 | eps:float; |
| 344 | dataLayout:DataLayout; |
| 345 | } |
| 346 | |
Sadik Armagan | 2625785 | 2019-10-14 13:00:47 +0100 | [diff] [blame] | 347 | table LogSoftmaxLayer { |
| 348 | base:LayerBase; |
| 349 | descriptor:LogSoftmaxDescriptor; |
| 350 | } |
| 351 | |
| 352 | table LogSoftmaxDescriptor { |
| 353 | beta:float = 1; |
| 354 | axis:int = -1; |
| 355 | } |
| 356 | |
Narumol Prangnawarat | 495701f | 2019-03-07 17:31:34 +0000 | [diff] [blame] | 357 | table L2NormalizationLayer { |
| 358 | base:LayerBase; |
| 359 | descriptor:L2NormalizationDescriptor; |
| 360 | } |
| 361 | |
| 362 | table L2NormalizationDescriptor { |
| 363 | dataLayout:DataLayout = NCHW; |
Ferran Balaguer | 0dcffec | 2019-06-18 16:25:06 +0100 | [diff] [blame] | 364 | eps:float = 1e-12; |
Narumol Prangnawarat | 495701f | 2019-03-07 17:31:34 +0000 | [diff] [blame] | 365 | } |
| 366 | |
James Conroy | aba90cd | 2020-11-06 16:28:18 +0000 | [diff] [blame] | 367 | enum LogicalBinaryOperation : byte { |
| 368 | LogicalAnd = 0, |
| 369 | LogicalOr = 1 |
| 370 | } |
| 371 | |
| 372 | table LogicalBinaryDescriptor { |
| 373 | operation:LogicalBinaryOperation; |
| 374 | } |
| 375 | |
| 376 | table LogicalBinaryLayer { |
| 377 | base:LayerBase; |
| 378 | descriptor:LogicalBinaryDescriptor; |
| 379 | } |
| 380 | |
Aron Virginas-Tar | 0fe3245 | 2019-02-28 13:12:47 +0000 | [diff] [blame] | 381 | table MinimumLayer { |
| 382 | base:LayerBase; |
| 383 | } |
| 384 | |
Aron Virginas-Tar | 377351e | 2019-02-27 14:42:31 +0000 | [diff] [blame] | 385 | table MaximumLayer { |
| 386 | base:LayerBase; |
| 387 | } |
| 388 | |
Sadik Armagan | 5f45027 | 2019-02-12 14:31:45 +0000 | [diff] [blame] | 389 | table MultiplicationLayer { |
| 390 | base:LayerBase; |
| 391 | } |
| 392 | |
Saoirse Stewart | 3166c3e | 2019-02-18 15:24:53 +0000 | [diff] [blame] | 393 | table Pooling2dLayer { |
| 394 | base:LayerBase; |
| 395 | descriptor:Pooling2dDescriptor; |
| 396 | } |
| 397 | |
| 398 | enum PoolingAlgorithm : byte { |
| 399 | Max = 0, |
| 400 | Average = 1, |
| 401 | L2 = 2 |
| 402 | } |
| 403 | |
| 404 | enum OutputShapeRounding : byte { |
| 405 | Floor = 0, |
| 406 | Ceiling = 1 |
| 407 | } |
| 408 | |
| 409 | enum PaddingMethod : byte { |
| 410 | IgnoreValue = 0, |
| 411 | Exclude = 1 |
| 412 | } |
| 413 | |
| 414 | table Pooling2dDescriptor { |
| 415 | poolType:PoolingAlgorithm; |
| 416 | padLeft:uint; |
| 417 | padRight:uint; |
| 418 | padTop:uint; |
| 419 | padBottom:uint; |
| 420 | poolWidth:uint; |
| 421 | poolHeight:uint; |
| 422 | strideX:uint; |
| 423 | strideY:uint; |
| 424 | outputShapeRounding:OutputShapeRounding; |
| 425 | paddingMethod:PaddingMethod; |
| 426 | dataLayout:DataLayout; |
| 427 | } |
| 428 | |
Derek Lamberti | 87acb27 | 2019-03-27 16:51:31 +0000 | [diff] [blame] | 429 | table QuantizeLayer { |
| 430 | base:LayerBase; |
| 431 | } |
| 432 | |
Aron Virginas-Tar | fc413c0 | 2019-02-13 15:41:52 +0000 | [diff] [blame] | 433 | table SoftmaxLayer { |
| 434 | base:LayerBase; |
| 435 | descriptor:SoftmaxDescriptor; |
| 436 | } |
| 437 | |
| 438 | table SoftmaxDescriptor { |
| 439 | beta:float; |
| 440 | } |
| 441 | |
Aron Virginas-Tar | c04125f | 2019-02-19 16:31:08 +0000 | [diff] [blame] | 442 | table DepthwiseConvolution2dLayer { |
| 443 | base:LayerBase; |
| 444 | descriptor:DepthwiseConvolution2dDescriptor; |
| 445 | weights:ConstTensor; |
| 446 | biases:ConstTensor; |
| 447 | } |
| 448 | |
| 449 | table DepthwiseConvolution2dDescriptor { |
| 450 | padLeft:uint; |
| 451 | padRight:uint; |
| 452 | padTop:uint; |
| 453 | padBottom:uint; |
| 454 | strideX:uint; |
| 455 | strideY:uint; |
Matthew Bentham | acad04e | 2019-05-13 10:02:45 +0100 | [diff] [blame] | 456 | dilationX:uint = 1; |
| 457 | dilationY:uint = 1; |
Aron Virginas-Tar | c04125f | 2019-02-19 16:31:08 +0000 | [diff] [blame] | 458 | biasEnabled:bool = false; |
| 459 | dataLayout:DataLayout = NCHW; |
| 460 | } |
| 461 | |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 462 | table OutputLayer { |
| 463 | base:BindableLayerBase; |
| 464 | } |
| 465 | |
Saoirse Stewart | 263829c | 2019-02-19 15:54:14 +0000 | [diff] [blame] | 466 | table ReshapeLayer { |
| 467 | base:LayerBase; |
| 468 | descriptor:ReshapeDescriptor; |
| 469 | } |
| 470 | |
| 471 | table ReshapeDescriptor { |
| 472 | targetShape:[uint]; |
| 473 | } |
| 474 | |
Nattapat Chaimanowong | 30b0020 | 2019-02-20 17:31:34 +0000 | [diff] [blame] | 475 | table PermuteLayer { |
| 476 | base:LayerBase; |
| 477 | descriptor:PermuteDescriptor; |
| 478 | } |
| 479 | |
| 480 | table PermuteDescriptor { |
| 481 | dimMappings:[uint]; |
| 482 | } |
| 483 | |
Nattapat Chaimanowong | 4528699 | 2019-02-26 15:53:02 +0000 | [diff] [blame] | 484 | table SpaceToBatchNdLayer { |
| 485 | base:LayerBase; |
| 486 | descriptor:SpaceToBatchNdDescriptor; |
| 487 | } |
| 488 | |
| 489 | table SpaceToBatchNdDescriptor { |
| 490 | blockShape:[uint]; |
| 491 | padList:[uint]; |
| 492 | dataLayout:DataLayout; |
| 493 | } |
| 494 | |
Aron Virginas-Tar | aa06714 | 2019-06-11 16:01:44 +0100 | [diff] [blame] | 495 | table SpaceToDepthLayer { |
| 496 | base:LayerBase; |
| 497 | descriptor:SpaceToDepthDescriptor; |
| 498 | } |
| 499 | |
| 500 | table SpaceToDepthDescriptor { |
| 501 | blockSize:uint; |
| 502 | dataLayout:DataLayout; |
| 503 | } |
| 504 | |
Conor Kennedy | da1f975 | 2019-03-01 14:37:12 +0000 | [diff] [blame] | 505 | table SubtractionLayer { |
| 506 | base:LayerBase; |
| 507 | } |
| 508 | |
Nattapat Chaimanowong | 6b4ed98 | 2019-02-26 17:24:13 +0000 | [diff] [blame] | 509 | table BatchToSpaceNdLayer { |
| 510 | base:LayerBase; |
| 511 | descriptor:BatchToSpaceNdDescriptor; |
| 512 | } |
| 513 | |
| 514 | table BatchToSpaceNdDescriptor { |
| 515 | blockShape:[uint]; |
| 516 | crops:[uint]; |
| 517 | dataLayout:DataLayout; |
| 518 | } |
| 519 | |
Nina Drozd | 5772878 | 2019-02-27 10:53:27 +0000 | [diff] [blame] | 520 | enum NormalizationAlgorithmChannel : byte { |
| 521 | Across = 0, |
| 522 | Within = 1 |
| 523 | } |
| 524 | |
| 525 | enum NormalizationAlgorithmMethod : byte { |
| 526 | LocalBrightness = 0, |
| 527 | LocalContrast = 1 |
| 528 | } |
| 529 | |
| 530 | table NormalizationLayer { |
| 531 | base:LayerBase; |
| 532 | descriptor:NormalizationDescriptor; |
| 533 | } |
| 534 | |
| 535 | table NormalizationDescriptor { |
| 536 | normChannelType:NormalizationAlgorithmChannel = Across; |
| 537 | normMethodType:NormalizationAlgorithmMethod = LocalBrightness; |
| 538 | normSize:uint; |
| 539 | alpha:float; |
| 540 | beta:float; |
| 541 | k:float; |
| 542 | dataLayout:DataLayout = NCHW; |
| 543 | } |
| 544 | |
Sadik Armagan | ac97c8c | 2019-03-04 17:44:21 +0000 | [diff] [blame] | 545 | table MeanLayer { |
| 546 | base:LayerBase; |
| 547 | descriptor:MeanDescriptor; |
| 548 | } |
| 549 | |
| 550 | table MeanDescriptor { |
| 551 | axis:[uint]; |
| 552 | keepDims:bool = false; |
| 553 | } |
| 554 | |
Nattapat Chaimanowong | ebb0f9c | 2019-03-01 12:14:06 +0000 | [diff] [blame] | 555 | table PadLayer { |
| 556 | base:LayerBase; |
| 557 | descriptor:PadDescriptor; |
| 558 | } |
| 559 | |
| 560 | table PadDescriptor { |
| 561 | padList:[uint]; |
David Monahan | 3475781 | 2019-06-19 11:47:21 +0100 | [diff] [blame] | 562 | padValue:float = 0; |
Nattapat Chaimanowong | ebb0f9c | 2019-03-01 12:14:06 +0000 | [diff] [blame] | 563 | } |
| 564 | |
josh minor | 4a3c610 | 2020-01-06 16:40:46 -0600 | [diff] [blame] | 565 | /// @deprecated Use ElementwiseUnaryLayer instead |
Sadik Armagan | 8b42a38 | 2019-03-01 14:24:49 +0000 | [diff] [blame] | 566 | table RsqrtLayer { |
| 567 | base:LayerBase; |
| 568 | } |
| 569 | |
ruoyan01 | 8e7fa23 | 2019-02-28 15:09:07 +0000 | [diff] [blame] | 570 | table BatchNormalizationLayer { |
| 571 | base:LayerBase; |
| 572 | descriptor:BatchNormalizationDescriptor; |
| 573 | mean:ConstTensor; |
| 574 | variance:ConstTensor; |
| 575 | beta:ConstTensor; |
| 576 | gamma:ConstTensor; |
| 577 | } |
| 578 | |
| 579 | table BatchNormalizationDescriptor { |
| 580 | eps:float; |
| 581 | dataLayout:DataLayout; |
| 582 | } |
| 583 | |
Aron Virginas-Tar | e80ebd1 | 2019-10-17 16:11:54 +0100 | [diff] [blame] | 584 | /// @deprecated Use ResizeLayer instead |
Nattapat Chaimanowong | 6522cdc | 2019-03-01 16:14:13 +0000 | [diff] [blame] | 585 | table ResizeBilinearLayer { |
| 586 | base:LayerBase; |
| 587 | descriptor:ResizeBilinearDescriptor; |
| 588 | } |
| 589 | |
| 590 | table ResizeBilinearDescriptor { |
| 591 | targetWidth:uint; |
| 592 | targetHeight:uint; |
| 593 | dataLayout:DataLayout; |
David Monahan | 4a0c9b9 | 2020-05-30 09:48:39 +0100 | [diff] [blame] | 594 | alignCorners:bool; |
| 595 | halfPixelCenters:bool; |
Nattapat Chaimanowong | 6522cdc | 2019-03-01 16:14:13 +0000 | [diff] [blame] | 596 | } |
| 597 | |
Aron Virginas-Tar | 2fda80b | 2019-09-18 13:36:52 +0100 | [diff] [blame] | 598 | table SliceLayer { |
| 599 | base:LayerBase; |
| 600 | descriptor:SliceDescriptor; |
| 601 | } |
| 602 | |
| 603 | table SliceDescriptor { |
| 604 | begin:[uint]; |
| 605 | size:[uint]; |
| 606 | } |
| 607 | |
Nattapat Chaimanowong | b348521 | 2019-03-04 12:35:39 +0000 | [diff] [blame] | 608 | table StridedSliceLayer { |
| 609 | base:LayerBase; |
| 610 | descriptor:StridedSliceDescriptor; |
| 611 | } |
| 612 | |
| 613 | table StridedSliceDescriptor { |
| 614 | begin:[int]; |
| 615 | end:[int]; |
| 616 | stride:[int]; |
| 617 | beginMask:int; |
| 618 | endMask:int; |
| 619 | shrinkAxisMask:int; |
| 620 | ellipsisMask:int; |
| 621 | newAxisMask:int; |
| 622 | dataLayout:DataLayout; |
| 623 | } |
| 624 | |
Jim Flynn | e242f2d | 2019-05-22 14:24:13 +0100 | [diff] [blame] | 625 | table ConcatLayer { |
| 626 | base:LayerBase; |
| 627 | descriptor:OriginsDescriptor; |
| 628 | } |
| 629 | |
Aron Virginas-Tar | e80ebd1 | 2019-10-17 16:11:54 +0100 | [diff] [blame] | 630 | /// @deprecated Use ConcatLayer instead |
Jim Flynn | ac25a1b | 2019-02-28 10:40:49 +0000 | [diff] [blame] | 631 | table MergerLayer { |
| 632 | base:LayerBase; |
| 633 | descriptor:OriginsDescriptor; |
| 634 | } |
| 635 | |
| 636 | table UintVector { |
| 637 | data:[uint]; |
| 638 | } |
| 639 | |
| 640 | table OriginsDescriptor { |
| 641 | concatAxis:uint; |
| 642 | numViews:uint; |
| 643 | numDimensions:uint; |
| 644 | viewOrigins:[UintVector]; |
| 645 | } |
| 646 | |
Jim Flynn | 18ce338 | 2019-03-08 11:08:30 +0000 | [diff] [blame] | 647 | table ViewsDescriptor { |
| 648 | origins:OriginsDescriptor; |
| 649 | viewSizes:[UintVector]; |
| 650 | } |
| 651 | |
| 652 | table SplitterLayer { |
| 653 | base:LayerBase; |
| 654 | descriptor:ViewsDescriptor; |
| 655 | } |
| 656 | |
Nattapat Chaimanowong | 3e14a9d | 2019-03-18 12:37:06 +0000 | [diff] [blame] | 657 | table DetectionPostProcessLayer { |
| 658 | base:LayerBase; |
| 659 | descriptor:DetectionPostProcessDescriptor; |
| 660 | anchors:ConstTensor; |
| 661 | } |
| 662 | |
| 663 | table DetectionPostProcessDescriptor { |
| 664 | maxDetections:uint; |
| 665 | maxClassesPerDetection:uint; |
| 666 | detectionsPerClass:uint; |
| 667 | nmsScoreThreshold:float; |
| 668 | nmsIouThreshold:float; |
| 669 | numClasses:uint; |
| 670 | useRegularNms:bool; |
| 671 | scaleX:float; |
| 672 | scaleY:float; |
| 673 | scaleW:float; |
| 674 | scaleH:float; |
| 675 | } |
| 676 | |
Jim Flynn | 11af375 | 2019-03-19 17:22:29 +0000 | [diff] [blame] | 677 | table LstmInputParams { |
| 678 | inputToForgetWeights:ConstTensor; |
| 679 | inputToCellWeights:ConstTensor; |
| 680 | inputToOutputWeights:ConstTensor; |
| 681 | recurrentToForgetWeights:ConstTensor; |
| 682 | recurrentToCellWeights:ConstTensor; |
| 683 | recurrentToOutputWeights:ConstTensor; |
| 684 | forgetGateBias:ConstTensor; |
| 685 | cellBias:ConstTensor; |
| 686 | outputGateBias:ConstTensor; |
| 687 | |
| 688 | inputToInputWeights:ConstTensor; |
| 689 | recurrentToInputWeights:ConstTensor; |
| 690 | cellToInputWeights:ConstTensor; |
| 691 | inputGateBias:ConstTensor; |
| 692 | |
| 693 | projectionWeights:ConstTensor; |
| 694 | projectionBias:ConstTensor; |
| 695 | |
| 696 | cellToForgetWeights:ConstTensor; |
| 697 | cellToOutputWeights:ConstTensor; |
Jan Eilers | f8c6297 | 2019-07-17 11:07:49 +0100 | [diff] [blame] | 698 | |
| 699 | inputLayerNormWeights:ConstTensor; |
| 700 | forgetLayerNormWeights:ConstTensor; |
| 701 | cellLayerNormWeights:ConstTensor; |
| 702 | outputLayerNormWeights:ConstTensor; |
Jim Flynn | 11af375 | 2019-03-19 17:22:29 +0000 | [diff] [blame] | 703 | } |
| 704 | |
James Conroy | 8d33318 | 2020-05-13 10:27:58 +0100 | [diff] [blame] | 705 | table LstmDescriptor { |
| 706 | activationFunc:uint; |
| 707 | clippingThresCell:float; |
| 708 | clippingThresProj:float; |
| 709 | cifgEnabled:bool = true; |
| 710 | peepholeEnabled:bool = false; |
| 711 | projectionEnabled:bool = false; |
| 712 | layerNormEnabled:bool = false; |
| 713 | } |
| 714 | |
| 715 | table LstmLayer { |
| 716 | base:LayerBase; |
| 717 | descriptor:LstmDescriptor; |
| 718 | inputParams:LstmInputParams; |
| 719 | } |
| 720 | |
| 721 | table QLstmInputParams { |
| 722 | // Mandatory |
| 723 | inputToForgetWeights:ConstTensor; |
| 724 | inputToCellWeights:ConstTensor; |
| 725 | inputToOutputWeights:ConstTensor; |
| 726 | |
| 727 | recurrentToForgetWeights:ConstTensor; |
| 728 | recurrentToCellWeights:ConstTensor; |
| 729 | recurrentToOutputWeights:ConstTensor; |
| 730 | |
| 731 | forgetGateBias:ConstTensor; |
| 732 | cellBias:ConstTensor; |
| 733 | outputGateBias:ConstTensor; |
| 734 | |
| 735 | // CIFG |
| 736 | inputToInputWeights:ConstTensor; |
| 737 | recurrentToInputWeights:ConstTensor; |
| 738 | inputGateBias:ConstTensor; |
| 739 | |
| 740 | // Projection |
| 741 | projectionWeights:ConstTensor; |
| 742 | projectionBias:ConstTensor; |
| 743 | |
| 744 | // Peephole |
| 745 | cellToInputWeights:ConstTensor; |
| 746 | cellToForgetWeights:ConstTensor; |
| 747 | cellToOutputWeights:ConstTensor; |
| 748 | |
| 749 | // Layer norm |
| 750 | inputLayerNormWeights:ConstTensor; |
| 751 | forgetLayerNormWeights:ConstTensor; |
| 752 | cellLayerNormWeights:ConstTensor; |
| 753 | outputLayerNormWeights:ConstTensor; |
| 754 | } |
| 755 | |
| 756 | table QLstmDescriptor { |
| 757 | cifgEnabled:bool = true; |
| 758 | peepholeEnabled:bool = false; |
| 759 | projectionEnabled:bool = false; |
| 760 | layerNormEnabled:bool = false; |
| 761 | |
| 762 | cellClip:float; |
| 763 | projectionClip:float; |
| 764 | |
| 765 | inputIntermediateScale:float; |
| 766 | forgetIntermediateScale:float; |
| 767 | cellIntermediateScale:float; |
| 768 | outputIntermediateScale:float; |
| 769 | |
| 770 | hiddenStateZeroPoint:int; |
| 771 | hiddenStateScale:float; |
| 772 | } |
| 773 | |
| 774 | table QLstmLayer { |
| 775 | base:LayerBase; |
| 776 | descriptor:QLstmDescriptor; |
| 777 | inputParams:QLstmInputParams; |
| 778 | } |
| 779 | |
Jan Eilers | 5b01a89 | 2019-07-23 09:47:43 +0100 | [diff] [blame] | 780 | table QuantizedLstmInputParams { |
| 781 | inputToInputWeights:ConstTensor; |
| 782 | inputToForgetWeights:ConstTensor; |
| 783 | inputToCellWeights:ConstTensor; |
| 784 | inputToOutputWeights:ConstTensor; |
| 785 | |
| 786 | recurrentToInputWeights:ConstTensor; |
| 787 | recurrentToForgetWeights:ConstTensor; |
| 788 | recurrentToCellWeights:ConstTensor; |
| 789 | recurrentToOutputWeights:ConstTensor; |
| 790 | |
| 791 | inputGateBias:ConstTensor; |
| 792 | forgetGateBias:ConstTensor; |
| 793 | cellBias:ConstTensor; |
| 794 | outputGateBias:ConstTensor; |
| 795 | } |
| 796 | |
Jan Eilers | 5b01a89 | 2019-07-23 09:47:43 +0100 | [diff] [blame] | 797 | table QuantizedLstmLayer { |
| 798 | base:LayerBase; |
| 799 | inputParams:QuantizedLstmInputParams; |
| 800 | } |
| 801 | |
Nattapat Chaimanowong | e4294fd | 2019-03-28 09:56:53 +0000 | [diff] [blame] | 802 | table DequantizeLayer { |
| 803 | base:LayerBase; |
| 804 | } |
| 805 | |
Nattapat Chaimanowong | 1f88630 | 2019-04-05 13:37:19 +0100 | [diff] [blame] | 806 | table MergeLayer { |
| 807 | base:LayerBase; |
| 808 | } |
| 809 | |
Sadik Armagan | eff363d | 2019-04-05 15:25:46 +0100 | [diff] [blame] | 810 | table SwitchLayer { |
| 811 | base:LayerBase; |
| 812 | } |
| 813 | |
Ellen Norris-Thompson | 5198247 | 2019-06-19 11:46:21 +0100 | [diff] [blame] | 814 | table PreluLayer { |
| 815 | base:LayerBase; |
| 816 | } |
| 817 | |
Aron Virginas-Tar | cb54930 | 2019-06-21 13:53:38 +0100 | [diff] [blame] | 818 | table TransposeConvolution2dLayer { |
| 819 | base:LayerBase; |
| 820 | descriptor:TransposeConvolution2dDescriptor; |
| 821 | weights:ConstTensor; |
| 822 | biases:ConstTensor; |
| 823 | } |
| 824 | |
| 825 | table TransposeConvolution2dDescriptor { |
| 826 | padLeft:uint; |
| 827 | padRight:uint; |
| 828 | padTop:uint; |
| 829 | padBottom:uint; |
| 830 | strideX:uint; |
| 831 | strideY:uint; |
| 832 | biasEnabled:bool = false; |
| 833 | dataLayout:DataLayout = NCHW; |
| 834 | } |
| 835 | |
Mike Kelly | c9ea45a | 2020-02-28 18:11:58 +0000 | [diff] [blame] | 836 | table TransposeLayer { |
| 837 | base:LayerBase; |
| 838 | descriptor:TransposeDescriptor; |
| 839 | } |
| 840 | |
| 841 | table TransposeDescriptor { |
| 842 | dimMappings:[uint]; |
| 843 | } |
| 844 | |
FinnWilliamsArm | 6fb339a | 2019-06-28 15:07:10 +0100 | [diff] [blame] | 845 | table ResizeLayer { |
| 846 | base:LayerBase; |
| 847 | descriptor:ResizeDescriptor; |
| 848 | } |
| 849 | |
| 850 | table ResizeDescriptor { |
| 851 | targetHeight:uint; |
| 852 | targetWidth:uint; |
| 853 | method:ResizeMethod = NearestNeighbor; |
| 854 | dataLayout:DataLayout; |
David Monahan | 4a0c9b9 | 2020-05-30 09:48:39 +0100 | [diff] [blame] | 855 | alignCorners:bool; |
| 856 | halfPixelCenters:bool; |
FinnWilliamsArm | 6fb339a | 2019-06-28 15:07:10 +0100 | [diff] [blame] | 857 | } |
| 858 | |
Matthew Jackson | b5433ee | 2019-07-11 15:54:20 +0100 | [diff] [blame] | 859 | table StackLayer { |
| 860 | base:LayerBase; |
| 861 | descriptor:StackDescriptor; |
| 862 | } |
| 863 | |
| 864 | table StackDescriptor { |
| 865 | axis:uint; |
| 866 | numInputs:uint; |
| 867 | inputShape:[uint]; |
| 868 | } |
| 869 | |
Aron Virginas-Tar | 85121a2 | 2019-10-23 10:41:35 +0100 | [diff] [blame] | 870 | table StandInDescriptor { |
| 871 | numInputs:uint; |
| 872 | numOutputs:uint; |
| 873 | } |
| 874 | |
| 875 | table StandInLayer { |
| 876 | base:LayerBase; |
| 877 | descriptor:StandInDescriptor; |
| 878 | } |
| 879 | |
Finn Williams | 2605b23 | 2020-06-10 15:53:46 +0100 | [diff] [blame] | 880 | table RankLayer { |
| 881 | base:LayerBase; |
| 882 | } |
| 883 | |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 884 | union Layer { |
Mike Kelly | af48401 | 2019-02-20 16:53:11 +0000 | [diff] [blame] | 885 | ActivationLayer, |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 886 | AdditionLayer, |
Nattapat Chaimanowong | 6b4ed98 | 2019-02-26 17:24:13 +0000 | [diff] [blame] | 887 | BatchToSpaceNdLayer, |
ruoyan01 | 8e7fa23 | 2019-02-28 15:09:07 +0000 | [diff] [blame] | 888 | BatchNormalizationLayer, |
Conor Kennedy | 7627788 | 2019-02-26 08:29:54 +0000 | [diff] [blame] | 889 | ConstantLayer, |
Mike Kelly | a0766c3 | 2019-02-19 17:22:07 +0000 | [diff] [blame] | 890 | Convolution2dLayer, |
Aron Virginas-Tar | c04125f | 2019-02-19 16:31:08 +0000 | [diff] [blame] | 891 | DepthwiseConvolution2dLayer, |
Sadik Armagan | dbb0c0c | 2019-02-21 09:01:41 +0000 | [diff] [blame] | 892 | FullyConnectedLayer, |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 893 | InputLayer, |
Sadik Armagan | 5f45027 | 2019-02-12 14:31:45 +0000 | [diff] [blame] | 894 | MultiplicationLayer, |
Aron Virginas-Tar | fc413c0 | 2019-02-13 15:41:52 +0000 | [diff] [blame] | 895 | OutputLayer, |
Nattapat Chaimanowong | 30b0020 | 2019-02-20 17:31:34 +0000 | [diff] [blame] | 896 | PermuteLayer, |
Saoirse Stewart | 3166c3e | 2019-02-18 15:24:53 +0000 | [diff] [blame] | 897 | Pooling2dLayer, |
Saoirse Stewart | 263829c | 2019-02-19 15:54:14 +0000 | [diff] [blame] | 898 | ReshapeLayer, |
Nattapat Chaimanowong | 4528699 | 2019-02-26 15:53:02 +0000 | [diff] [blame] | 899 | SoftmaxLayer, |
Éanna Ó Catháin | 5888589 | 2019-02-27 16:16:39 +0000 | [diff] [blame] | 900 | SpaceToBatchNdLayer, |
Aron Virginas-Tar | 0fe3245 | 2019-02-28 13:12:47 +0000 | [diff] [blame] | 901 | DivisionLayer, |
Nattapat Chaimanowong | 235cea5 | 2019-02-28 16:27:30 +0000 | [diff] [blame] | 902 | MinimumLayer, |
Aron Virginas-Tar | 377351e | 2019-02-27 14:42:31 +0000 | [diff] [blame] | 903 | EqualLayer, |
Nina Drozd | 5772878 | 2019-02-27 10:53:27 +0000 | [diff] [blame] | 904 | MaximumLayer, |
Nattapat Chaimanowong | ebb0f9c | 2019-03-01 12:14:06 +0000 | [diff] [blame] | 905 | NormalizationLayer, |
Sadik Armagan | 8b42a38 | 2019-03-01 14:24:49 +0000 | [diff] [blame] | 906 | PadLayer, |
Finn Williams | dd2ba7e | 2019-03-01 11:51:52 +0000 | [diff] [blame] | 907 | RsqrtLayer, |
Conor Kennedy | 79ffdf5 | 2019-03-01 14:24:54 +0000 | [diff] [blame] | 908 | FloorLayer, |
Nattapat Chaimanowong | 6522cdc | 2019-03-01 16:14:13 +0000 | [diff] [blame] | 909 | GreaterLayer, |
Conor Kennedy | da1f975 | 2019-03-01 14:37:12 +0000 | [diff] [blame] | 910 | ResizeBilinearLayer, |
Nattapat Chaimanowong | b348521 | 2019-03-04 12:35:39 +0000 | [diff] [blame] | 911 | SubtractionLayer, |
Saoirse Stewart | a1ed73a | 2019-03-04 13:40:12 +0000 | [diff] [blame] | 912 | StridedSliceLayer, |
Sadik Armagan | ac97c8c | 2019-03-04 17:44:21 +0000 | [diff] [blame] | 913 | GatherLayer, |
Jim Flynn | ac25a1b | 2019-02-28 10:40:49 +0000 | [diff] [blame] | 914 | MeanLayer, |
Narumol Prangnawarat | 495701f | 2019-03-07 17:31:34 +0000 | [diff] [blame] | 915 | MergerLayer, |
Jim Flynn | 18ce338 | 2019-03-08 11:08:30 +0000 | [diff] [blame] | 916 | L2NormalizationLayer, |
Nattapat Chaimanowong | 3e14a9d | 2019-03-18 12:37:06 +0000 | [diff] [blame] | 917 | SplitterLayer, |
Jim Flynn | 11af375 | 2019-03-19 17:22:29 +0000 | [diff] [blame] | 918 | DetectionPostProcessLayer, |
Derek Lamberti | 87acb27 | 2019-03-27 16:51:31 +0000 | [diff] [blame] | 919 | LstmLayer, |
Jan Eilers | 5b01a89 | 2019-07-23 09:47:43 +0100 | [diff] [blame] | 920 | QuantizedLstmLayer, |
Nattapat Chaimanowong | e4294fd | 2019-03-28 09:56:53 +0000 | [diff] [blame] | 921 | QuantizeLayer, |
Nattapat Chaimanowong | 1f88630 | 2019-04-05 13:37:19 +0100 | [diff] [blame] | 922 | DequantizeLayer, |
Sadik Armagan | eff363d | 2019-04-05 15:25:46 +0100 | [diff] [blame] | 923 | MergeLayer, |
Jim Flynn | e242f2d | 2019-05-22 14:24:13 +0100 | [diff] [blame] | 924 | SwitchLayer, |
Aron Virginas-Tar | aa06714 | 2019-06-11 16:01:44 +0100 | [diff] [blame] | 925 | ConcatLayer, |
Ellen Norris-Thompson | 5198247 | 2019-06-19 11:46:21 +0100 | [diff] [blame] | 926 | SpaceToDepthLayer, |
Aron Virginas-Tar | cb54930 | 2019-06-21 13:53:38 +0100 | [diff] [blame] | 927 | PreluLayer, |
FinnWilliamsArm | 6fb339a | 2019-06-28 15:07:10 +0100 | [diff] [blame] | 928 | TransposeConvolution2dLayer, |
Matthew Jackson | b5433ee | 2019-07-11 15:54:20 +0100 | [diff] [blame] | 929 | ResizeLayer, |
FinnWilliamsArm | 4ffcc8f | 2019-09-05 14:34:20 +0100 | [diff] [blame] | 930 | StackLayer, |
Narumol Prangnawarat | 0cfcf23 | 2019-09-09 17:16:24 +0100 | [diff] [blame] | 931 | AbsLayer, |
Aron Virginas-Tar | 2fda80b | 2019-09-18 13:36:52 +0100 | [diff] [blame] | 932 | ArgMinMaxLayer, |
Aron Virginas-Tar | da9d2d3 | 2019-09-20 10:42:02 +0100 | [diff] [blame] | 933 | SliceLayer, |
Aron Virginas-Tar | 781ced9 | 2019-10-03 11:15:39 +0100 | [diff] [blame] | 934 | DepthToSpaceLayer, |
Sadik Armagan | 2625785 | 2019-10-14 13:00:47 +0100 | [diff] [blame] | 935 | InstanceNormalizationLayer, |
Aron Virginas-Tar | e80ebd1 | 2019-10-17 16:11:54 +0100 | [diff] [blame] | 936 | LogSoftmaxLayer, |
Aron Virginas-Tar | 85121a2 | 2019-10-23 10:41:35 +0100 | [diff] [blame] | 937 | ComparisonLayer, |
josh minor | 4a3c610 | 2020-01-06 16:40:46 -0600 | [diff] [blame] | 938 | StandInLayer, |
Mike Kelly | c9ea45a | 2020-02-28 18:11:58 +0000 | [diff] [blame] | 939 | ElementwiseUnaryLayer, |
James Conroy | 8d33318 | 2020-05-13 10:27:58 +0100 | [diff] [blame] | 940 | TransposeLayer, |
Keith Davis | 300ad56 | 2020-06-04 16:34:23 +0100 | [diff] [blame] | 941 | QLstmLayer, |
Finn Williams | 2605b23 | 2020-06-10 15:53:46 +0100 | [diff] [blame] | 942 | FillLayer, |
James Conroy | aba90cd | 2020-11-06 16:28:18 +0000 | [diff] [blame] | 943 | RankLayer, |
| 944 | LogicalBinaryLayer |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 945 | } |
| 946 | |
Saoirse Stewart | 49dbe0e | 2019-02-05 17:27:06 +0000 | [diff] [blame] | 947 | table AnyLayer { |
| 948 | layer:Layer; |
| 949 | } |
| 950 | |
Tee Jung | aa920c5 | 2019-11-05 10:48:25 +0000 | [diff] [blame] | 951 | table FeatureCompatibilityVersions { |
| 952 | bindingIdsScheme:uint = 0; |
| 953 | } |
| 954 | |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 955 | // Root type for serialized data is the graph of the network |
| 956 | table SerializedGraph { |
Saoirse Stewart | 49dbe0e | 2019-02-05 17:27:06 +0000 | [diff] [blame] | 957 | layers:[AnyLayer]; |
Tee Jung | aa920c5 | 2019-11-05 10:48:25 +0000 | [diff] [blame] | 958 | inputIds:[int]; |
| 959 | outputIds:[int]; |
| 960 | featureVersions:FeatureCompatibilityVersions; |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 961 | } |
| 962 | |
Keith Davis | 300ad56 | 2020-06-04 16:34:23 +0100 | [diff] [blame] | 963 | root_type SerializedGraph; |