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