Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 1 | // automatically generated by the FlatBuffers compiler, do not modify |
| 2 | |
| 3 | |
| 4 | #ifndef FLATBUFFERS_GENERATED_SCHEMA_TFLITE_H_ |
| 5 | #define FLATBUFFERS_GENERATED_SCHEMA_TFLITE_H_ |
| 6 | |
| 7 | #include "flatbuffers/flatbuffers.h" |
| 8 | |
| 9 | namespace tflite { |
| 10 | |
| 11 | struct CustomQuantization; |
| 12 | struct CustomQuantizationBuilder; |
| 13 | |
| 14 | struct QuantizationParameters; |
| 15 | struct QuantizationParametersBuilder; |
| 16 | |
| 17 | struct Int32Vector; |
| 18 | struct Int32VectorBuilder; |
| 19 | |
| 20 | struct Uint16Vector; |
| 21 | struct Uint16VectorBuilder; |
| 22 | |
| 23 | struct Uint8Vector; |
| 24 | struct Uint8VectorBuilder; |
| 25 | |
| 26 | struct DimensionMetadata; |
| 27 | struct DimensionMetadataBuilder; |
| 28 | |
| 29 | struct SparsityParameters; |
| 30 | struct SparsityParametersBuilder; |
| 31 | |
| 32 | struct Tensor; |
| 33 | struct TensorBuilder; |
| 34 | |
| 35 | struct Conv2DOptions; |
| 36 | struct Conv2DOptionsBuilder; |
| 37 | |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 38 | struct Conv3DOptions; |
| 39 | struct Conv3DOptionsBuilder; |
| 40 | |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 41 | struct Pool2DOptions; |
| 42 | struct Pool2DOptionsBuilder; |
| 43 | |
| 44 | struct DepthwiseConv2DOptions; |
| 45 | struct DepthwiseConv2DOptionsBuilder; |
| 46 | |
| 47 | struct ConcatEmbeddingsOptions; |
| 48 | struct ConcatEmbeddingsOptionsBuilder; |
| 49 | |
| 50 | struct LSHProjectionOptions; |
| 51 | struct LSHProjectionOptionsBuilder; |
| 52 | |
| 53 | struct SVDFOptions; |
| 54 | struct SVDFOptionsBuilder; |
| 55 | |
| 56 | struct RNNOptions; |
| 57 | struct RNNOptionsBuilder; |
| 58 | |
| 59 | struct SequenceRNNOptions; |
| 60 | struct SequenceRNNOptionsBuilder; |
| 61 | |
| 62 | struct BidirectionalSequenceRNNOptions; |
| 63 | struct BidirectionalSequenceRNNOptionsBuilder; |
| 64 | |
| 65 | struct FullyConnectedOptions; |
| 66 | struct FullyConnectedOptionsBuilder; |
| 67 | |
| 68 | struct SoftmaxOptions; |
| 69 | struct SoftmaxOptionsBuilder; |
| 70 | |
| 71 | struct ConcatenationOptions; |
| 72 | struct ConcatenationOptionsBuilder; |
| 73 | |
| 74 | struct AddOptions; |
| 75 | struct AddOptionsBuilder; |
| 76 | |
| 77 | struct MulOptions; |
| 78 | struct MulOptionsBuilder; |
| 79 | |
| 80 | struct L2NormOptions; |
| 81 | struct L2NormOptionsBuilder; |
| 82 | |
| 83 | struct LocalResponseNormalizationOptions; |
| 84 | struct LocalResponseNormalizationOptionsBuilder; |
| 85 | |
| 86 | struct LSTMOptions; |
| 87 | struct LSTMOptionsBuilder; |
| 88 | |
| 89 | struct UnidirectionalSequenceLSTMOptions; |
| 90 | struct UnidirectionalSequenceLSTMOptionsBuilder; |
| 91 | |
| 92 | struct BidirectionalSequenceLSTMOptions; |
| 93 | struct BidirectionalSequenceLSTMOptionsBuilder; |
| 94 | |
| 95 | struct ResizeBilinearOptions; |
| 96 | struct ResizeBilinearOptionsBuilder; |
| 97 | |
| 98 | struct ResizeNearestNeighborOptions; |
| 99 | struct ResizeNearestNeighborOptionsBuilder; |
| 100 | |
| 101 | struct CallOptions; |
| 102 | struct CallOptionsBuilder; |
| 103 | |
| 104 | struct PadOptions; |
| 105 | struct PadOptionsBuilder; |
| 106 | |
| 107 | struct PadV2Options; |
| 108 | struct PadV2OptionsBuilder; |
| 109 | |
| 110 | struct ReshapeOptions; |
| 111 | struct ReshapeOptionsBuilder; |
| 112 | |
| 113 | struct SpaceToBatchNDOptions; |
| 114 | struct SpaceToBatchNDOptionsBuilder; |
| 115 | |
| 116 | struct BatchToSpaceNDOptions; |
| 117 | struct BatchToSpaceNDOptionsBuilder; |
| 118 | |
| 119 | struct SkipGramOptions; |
| 120 | struct SkipGramOptionsBuilder; |
| 121 | |
| 122 | struct SpaceToDepthOptions; |
| 123 | struct SpaceToDepthOptionsBuilder; |
| 124 | |
| 125 | struct DepthToSpaceOptions; |
| 126 | struct DepthToSpaceOptionsBuilder; |
| 127 | |
| 128 | struct SubOptions; |
| 129 | struct SubOptionsBuilder; |
| 130 | |
| 131 | struct DivOptions; |
| 132 | struct DivOptionsBuilder; |
| 133 | |
| 134 | struct TopKV2Options; |
| 135 | struct TopKV2OptionsBuilder; |
| 136 | |
| 137 | struct EmbeddingLookupSparseOptions; |
| 138 | struct EmbeddingLookupSparseOptionsBuilder; |
| 139 | |
| 140 | struct GatherOptions; |
| 141 | struct GatherOptionsBuilder; |
| 142 | |
| 143 | struct TransposeOptions; |
| 144 | struct TransposeOptionsBuilder; |
| 145 | |
| 146 | struct ExpOptions; |
| 147 | struct ExpOptionsBuilder; |
| 148 | |
| 149 | struct CosOptions; |
| 150 | struct CosOptionsBuilder; |
| 151 | |
| 152 | struct ReducerOptions; |
| 153 | struct ReducerOptionsBuilder; |
| 154 | |
| 155 | struct SqueezeOptions; |
| 156 | struct SqueezeOptionsBuilder; |
| 157 | |
| 158 | struct SplitOptions; |
| 159 | struct SplitOptionsBuilder; |
| 160 | |
| 161 | struct SplitVOptions; |
| 162 | struct SplitVOptionsBuilder; |
| 163 | |
| 164 | struct StridedSliceOptions; |
| 165 | struct StridedSliceOptionsBuilder; |
| 166 | |
| 167 | struct LogSoftmaxOptions; |
| 168 | struct LogSoftmaxOptionsBuilder; |
| 169 | |
| 170 | struct CastOptions; |
| 171 | struct CastOptionsBuilder; |
| 172 | |
| 173 | struct DequantizeOptions; |
| 174 | struct DequantizeOptionsBuilder; |
| 175 | |
| 176 | struct MaximumMinimumOptions; |
| 177 | struct MaximumMinimumOptionsBuilder; |
| 178 | |
| 179 | struct TileOptions; |
| 180 | struct TileOptionsBuilder; |
| 181 | |
| 182 | struct ArgMaxOptions; |
| 183 | struct ArgMaxOptionsBuilder; |
| 184 | |
| 185 | struct ArgMinOptions; |
| 186 | struct ArgMinOptionsBuilder; |
| 187 | |
| 188 | struct GreaterOptions; |
| 189 | struct GreaterOptionsBuilder; |
| 190 | |
| 191 | struct GreaterEqualOptions; |
| 192 | struct GreaterEqualOptionsBuilder; |
| 193 | |
| 194 | struct LessOptions; |
| 195 | struct LessOptionsBuilder; |
| 196 | |
| 197 | struct LessEqualOptions; |
| 198 | struct LessEqualOptionsBuilder; |
| 199 | |
| 200 | struct NegOptions; |
| 201 | struct NegOptionsBuilder; |
| 202 | |
| 203 | struct SelectOptions; |
| 204 | struct SelectOptionsBuilder; |
| 205 | |
| 206 | struct SliceOptions; |
| 207 | struct SliceOptionsBuilder; |
| 208 | |
| 209 | struct TransposeConvOptions; |
| 210 | struct TransposeConvOptionsBuilder; |
| 211 | |
| 212 | struct ExpandDimsOptions; |
| 213 | struct ExpandDimsOptionsBuilder; |
| 214 | |
| 215 | struct SparseToDenseOptions; |
| 216 | struct SparseToDenseOptionsBuilder; |
| 217 | |
| 218 | struct EqualOptions; |
| 219 | struct EqualOptionsBuilder; |
| 220 | |
| 221 | struct NotEqualOptions; |
| 222 | struct NotEqualOptionsBuilder; |
| 223 | |
| 224 | struct ShapeOptions; |
| 225 | struct ShapeOptionsBuilder; |
| 226 | |
| 227 | struct RankOptions; |
| 228 | struct RankOptionsBuilder; |
| 229 | |
| 230 | struct PowOptions; |
| 231 | struct PowOptionsBuilder; |
| 232 | |
| 233 | struct FakeQuantOptions; |
| 234 | struct FakeQuantOptionsBuilder; |
| 235 | |
| 236 | struct PackOptions; |
| 237 | struct PackOptionsBuilder; |
| 238 | |
| 239 | struct LogicalOrOptions; |
| 240 | struct LogicalOrOptionsBuilder; |
| 241 | |
| 242 | struct OneHotOptions; |
| 243 | struct OneHotOptionsBuilder; |
| 244 | |
| 245 | struct AbsOptions; |
| 246 | struct AbsOptionsBuilder; |
| 247 | |
| 248 | struct HardSwishOptions; |
| 249 | struct HardSwishOptionsBuilder; |
| 250 | |
| 251 | struct LogicalAndOptions; |
| 252 | struct LogicalAndOptionsBuilder; |
| 253 | |
| 254 | struct LogicalNotOptions; |
| 255 | struct LogicalNotOptionsBuilder; |
| 256 | |
| 257 | struct UnpackOptions; |
| 258 | struct UnpackOptionsBuilder; |
| 259 | |
| 260 | struct FloorDivOptions; |
| 261 | struct FloorDivOptionsBuilder; |
| 262 | |
| 263 | struct SquareOptions; |
| 264 | struct SquareOptionsBuilder; |
| 265 | |
| 266 | struct ZerosLikeOptions; |
| 267 | struct ZerosLikeOptionsBuilder; |
| 268 | |
| 269 | struct FillOptions; |
| 270 | struct FillOptionsBuilder; |
| 271 | |
| 272 | struct FloorModOptions; |
| 273 | struct FloorModOptionsBuilder; |
| 274 | |
| 275 | struct RangeOptions; |
| 276 | struct RangeOptionsBuilder; |
| 277 | |
| 278 | struct LeakyReluOptions; |
| 279 | struct LeakyReluOptionsBuilder; |
| 280 | |
| 281 | struct SquaredDifferenceOptions; |
| 282 | struct SquaredDifferenceOptionsBuilder; |
| 283 | |
| 284 | struct MirrorPadOptions; |
| 285 | struct MirrorPadOptionsBuilder; |
| 286 | |
| 287 | struct UniqueOptions; |
| 288 | struct UniqueOptionsBuilder; |
| 289 | |
| 290 | struct ReverseV2Options; |
| 291 | struct ReverseV2OptionsBuilder; |
| 292 | |
| 293 | struct AddNOptions; |
| 294 | struct AddNOptionsBuilder; |
| 295 | |
| 296 | struct GatherNdOptions; |
| 297 | struct GatherNdOptionsBuilder; |
| 298 | |
| 299 | struct WhereOptions; |
| 300 | struct WhereOptionsBuilder; |
| 301 | |
| 302 | struct ReverseSequenceOptions; |
| 303 | struct ReverseSequenceOptionsBuilder; |
| 304 | |
| 305 | struct MatrixDiagOptions; |
| 306 | struct MatrixDiagOptionsBuilder; |
| 307 | |
| 308 | struct QuantizeOptions; |
| 309 | struct QuantizeOptionsBuilder; |
| 310 | |
| 311 | struct MatrixSetDiagOptions; |
| 312 | struct MatrixSetDiagOptionsBuilder; |
| 313 | |
| 314 | struct IfOptions; |
| 315 | struct IfOptionsBuilder; |
| 316 | |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 317 | struct CallOnceOptions; |
| 318 | struct CallOnceOptionsBuilder; |
| 319 | |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 320 | struct WhileOptions; |
| 321 | struct WhileOptionsBuilder; |
| 322 | |
| 323 | struct NonMaxSuppressionV4Options; |
| 324 | struct NonMaxSuppressionV4OptionsBuilder; |
| 325 | |
| 326 | struct NonMaxSuppressionV5Options; |
| 327 | struct NonMaxSuppressionV5OptionsBuilder; |
| 328 | |
| 329 | struct ScatterNdOptions; |
| 330 | struct ScatterNdOptionsBuilder; |
| 331 | |
| 332 | struct SelectV2Options; |
| 333 | struct SelectV2OptionsBuilder; |
| 334 | |
| 335 | struct DensifyOptions; |
| 336 | struct DensifyOptionsBuilder; |
| 337 | |
| 338 | struct SegmentSumOptions; |
| 339 | struct SegmentSumOptionsBuilder; |
| 340 | |
| 341 | struct BatchMatMulOptions; |
| 342 | struct BatchMatMulOptionsBuilder; |
| 343 | |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 344 | struct CumsumOptions; |
| 345 | struct CumsumOptionsBuilder; |
| 346 | |
| 347 | struct BroadcastToOptions; |
| 348 | struct BroadcastToOptionsBuilder; |
| 349 | |
| 350 | struct Rfft2dOptions; |
| 351 | struct Rfft2dOptionsBuilder; |
| 352 | |
| 353 | struct HashtableOptions; |
| 354 | struct HashtableOptionsBuilder; |
| 355 | |
| 356 | struct HashtableFindOptions; |
| 357 | struct HashtableFindOptionsBuilder; |
| 358 | |
| 359 | struct HashtableImportOptions; |
| 360 | struct HashtableImportOptionsBuilder; |
| 361 | |
| 362 | struct HashtableSizeOptions; |
| 363 | struct HashtableSizeOptionsBuilder; |
| 364 | |
| 365 | struct VarHandleOptions; |
| 366 | struct VarHandleOptionsBuilder; |
| 367 | |
| 368 | struct ReadVariableOptions; |
| 369 | struct ReadVariableOptionsBuilder; |
| 370 | |
| 371 | struct AssignVariableOptions; |
| 372 | struct AssignVariableOptionsBuilder; |
| 373 | |
| 374 | struct RandomOptions; |
| 375 | struct RandomOptionsBuilder; |
| 376 | |
| 377 | struct BucketizeOptions; |
| 378 | struct BucketizeOptionsBuilder; |
| 379 | |
| 380 | struct GeluOptions; |
| 381 | struct GeluOptionsBuilder; |
| 382 | |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 383 | struct OperatorCode; |
| 384 | struct OperatorCodeBuilder; |
| 385 | |
| 386 | struct Operator; |
| 387 | struct OperatorBuilder; |
| 388 | |
| 389 | struct SubGraph; |
| 390 | struct SubGraphBuilder; |
| 391 | |
| 392 | struct Buffer; |
| 393 | struct BufferBuilder; |
| 394 | |
| 395 | struct Metadata; |
| 396 | struct MetadataBuilder; |
| 397 | |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 398 | struct TensorMap; |
| 399 | struct TensorMapBuilder; |
| 400 | |
| 401 | struct SignatureDef; |
| 402 | struct SignatureDefBuilder; |
| 403 | |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 404 | struct Model; |
| 405 | struct ModelBuilder; |
| 406 | |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 407 | enum TensorType : int8_t { |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 408 | TensorType_FLOAT32 = 0, |
| 409 | TensorType_FLOAT16 = 1, |
| 410 | TensorType_INT32 = 2, |
| 411 | TensorType_UINT8 = 3, |
| 412 | TensorType_INT64 = 4, |
| 413 | TensorType_STRING = 5, |
| 414 | TensorType_BOOL = 6, |
| 415 | TensorType_INT16 = 7, |
| 416 | TensorType_COMPLEX64 = 8, |
| 417 | TensorType_INT8 = 9, |
| 418 | TensorType_FLOAT64 = 10, |
| 419 | TensorType_COMPLEX128 = 11, |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 420 | TensorType_UINT64 = 12, |
| 421 | TensorType_RESOURCE = 13, |
| 422 | TensorType_VARIANT = 14, |
| 423 | TensorType_UINT32 = 15, |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 424 | TensorType_MIN = TensorType_FLOAT32, |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 425 | TensorType_MAX = TensorType_UINT32 |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 426 | }; |
| 427 | |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 428 | inline const TensorType (&EnumValuesTensorType())[16] { |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 429 | static const TensorType values[] = { |
| 430 | TensorType_FLOAT32, |
| 431 | TensorType_FLOAT16, |
| 432 | TensorType_INT32, |
| 433 | TensorType_UINT8, |
| 434 | TensorType_INT64, |
| 435 | TensorType_STRING, |
| 436 | TensorType_BOOL, |
| 437 | TensorType_INT16, |
| 438 | TensorType_COMPLEX64, |
| 439 | TensorType_INT8, |
| 440 | TensorType_FLOAT64, |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 441 | TensorType_COMPLEX128, |
| 442 | TensorType_UINT64, |
| 443 | TensorType_RESOURCE, |
| 444 | TensorType_VARIANT, |
| 445 | TensorType_UINT32 |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 446 | }; |
| 447 | return values; |
| 448 | } |
| 449 | |
| 450 | inline const char * const *EnumNamesTensorType() { |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 451 | static const char * const names[17] = { |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 452 | "FLOAT32", |
| 453 | "FLOAT16", |
| 454 | "INT32", |
| 455 | "UINT8", |
| 456 | "INT64", |
| 457 | "STRING", |
| 458 | "BOOL", |
| 459 | "INT16", |
| 460 | "COMPLEX64", |
| 461 | "INT8", |
| 462 | "FLOAT64", |
| 463 | "COMPLEX128", |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 464 | "UINT64", |
| 465 | "RESOURCE", |
| 466 | "VARIANT", |
| 467 | "UINT32", |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 468 | nullptr |
| 469 | }; |
| 470 | return names; |
| 471 | } |
| 472 | |
| 473 | inline const char *EnumNameTensorType(TensorType e) { |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 474 | if (flatbuffers::IsOutRange(e, TensorType_FLOAT32, TensorType_UINT32)) return ""; |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 475 | const size_t index = static_cast<size_t>(e); |
| 476 | return EnumNamesTensorType()[index]; |
| 477 | } |
| 478 | |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 479 | enum QuantizationDetails : uint8_t { |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 480 | QuantizationDetails_NONE = 0, |
| 481 | QuantizationDetails_CustomQuantization = 1, |
| 482 | QuantizationDetails_MIN = QuantizationDetails_NONE, |
| 483 | QuantizationDetails_MAX = QuantizationDetails_CustomQuantization |
| 484 | }; |
| 485 | |
| 486 | inline const QuantizationDetails (&EnumValuesQuantizationDetails())[2] { |
| 487 | static const QuantizationDetails values[] = { |
| 488 | QuantizationDetails_NONE, |
| 489 | QuantizationDetails_CustomQuantization |
| 490 | }; |
| 491 | return values; |
| 492 | } |
| 493 | |
| 494 | inline const char * const *EnumNamesQuantizationDetails() { |
| 495 | static const char * const names[3] = { |
| 496 | "NONE", |
| 497 | "CustomQuantization", |
| 498 | nullptr |
| 499 | }; |
| 500 | return names; |
| 501 | } |
| 502 | |
| 503 | inline const char *EnumNameQuantizationDetails(QuantizationDetails e) { |
| 504 | if (flatbuffers::IsOutRange(e, QuantizationDetails_NONE, QuantizationDetails_CustomQuantization)) return ""; |
| 505 | const size_t index = static_cast<size_t>(e); |
| 506 | return EnumNamesQuantizationDetails()[index]; |
| 507 | } |
| 508 | |
| 509 | template<typename T> struct QuantizationDetailsTraits { |
| 510 | static const QuantizationDetails enum_value = QuantizationDetails_NONE; |
| 511 | }; |
| 512 | |
| 513 | template<> struct QuantizationDetailsTraits<tflite::CustomQuantization> { |
| 514 | static const QuantizationDetails enum_value = QuantizationDetails_CustomQuantization; |
| 515 | }; |
| 516 | |
| 517 | bool VerifyQuantizationDetails(flatbuffers::Verifier &verifier, const void *obj, QuantizationDetails type); |
| 518 | bool VerifyQuantizationDetailsVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector<flatbuffers::Offset<void>> *values, const flatbuffers::Vector<uint8_t> *types); |
| 519 | |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 520 | enum DimensionType : int8_t { |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 521 | DimensionType_DENSE = 0, |
| 522 | DimensionType_SPARSE_CSR = 1, |
| 523 | DimensionType_MIN = DimensionType_DENSE, |
| 524 | DimensionType_MAX = DimensionType_SPARSE_CSR |
| 525 | }; |
| 526 | |
| 527 | inline const DimensionType (&EnumValuesDimensionType())[2] { |
| 528 | static const DimensionType values[] = { |
| 529 | DimensionType_DENSE, |
| 530 | DimensionType_SPARSE_CSR |
| 531 | }; |
| 532 | return values; |
| 533 | } |
| 534 | |
| 535 | inline const char * const *EnumNamesDimensionType() { |
| 536 | static const char * const names[3] = { |
| 537 | "DENSE", |
| 538 | "SPARSE_CSR", |
| 539 | nullptr |
| 540 | }; |
| 541 | return names; |
| 542 | } |
| 543 | |
| 544 | inline const char *EnumNameDimensionType(DimensionType e) { |
| 545 | if (flatbuffers::IsOutRange(e, DimensionType_DENSE, DimensionType_SPARSE_CSR)) return ""; |
| 546 | const size_t index = static_cast<size_t>(e); |
| 547 | return EnumNamesDimensionType()[index]; |
| 548 | } |
| 549 | |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 550 | enum SparseIndexVector : uint8_t { |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 551 | SparseIndexVector_NONE = 0, |
| 552 | SparseIndexVector_Int32Vector = 1, |
| 553 | SparseIndexVector_Uint16Vector = 2, |
| 554 | SparseIndexVector_Uint8Vector = 3, |
| 555 | SparseIndexVector_MIN = SparseIndexVector_NONE, |
| 556 | SparseIndexVector_MAX = SparseIndexVector_Uint8Vector |
| 557 | }; |
| 558 | |
| 559 | inline const SparseIndexVector (&EnumValuesSparseIndexVector())[4] { |
| 560 | static const SparseIndexVector values[] = { |
| 561 | SparseIndexVector_NONE, |
| 562 | SparseIndexVector_Int32Vector, |
| 563 | SparseIndexVector_Uint16Vector, |
| 564 | SparseIndexVector_Uint8Vector |
| 565 | }; |
| 566 | return values; |
| 567 | } |
| 568 | |
| 569 | inline const char * const *EnumNamesSparseIndexVector() { |
| 570 | static const char * const names[5] = { |
| 571 | "NONE", |
| 572 | "Int32Vector", |
| 573 | "Uint16Vector", |
| 574 | "Uint8Vector", |
| 575 | nullptr |
| 576 | }; |
| 577 | return names; |
| 578 | } |
| 579 | |
| 580 | inline const char *EnumNameSparseIndexVector(SparseIndexVector e) { |
| 581 | if (flatbuffers::IsOutRange(e, SparseIndexVector_NONE, SparseIndexVector_Uint8Vector)) return ""; |
| 582 | const size_t index = static_cast<size_t>(e); |
| 583 | return EnumNamesSparseIndexVector()[index]; |
| 584 | } |
| 585 | |
| 586 | template<typename T> struct SparseIndexVectorTraits { |
| 587 | static const SparseIndexVector enum_value = SparseIndexVector_NONE; |
| 588 | }; |
| 589 | |
| 590 | template<> struct SparseIndexVectorTraits<tflite::Int32Vector> { |
| 591 | static const SparseIndexVector enum_value = SparseIndexVector_Int32Vector; |
| 592 | }; |
| 593 | |
| 594 | template<> struct SparseIndexVectorTraits<tflite::Uint16Vector> { |
| 595 | static const SparseIndexVector enum_value = SparseIndexVector_Uint16Vector; |
| 596 | }; |
| 597 | |
| 598 | template<> struct SparseIndexVectorTraits<tflite::Uint8Vector> { |
| 599 | static const SparseIndexVector enum_value = SparseIndexVector_Uint8Vector; |
| 600 | }; |
| 601 | |
| 602 | bool VerifySparseIndexVector(flatbuffers::Verifier &verifier, const void *obj, SparseIndexVector type); |
| 603 | bool VerifySparseIndexVectorVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector<flatbuffers::Offset<void>> *values, const flatbuffers::Vector<uint8_t> *types); |
| 604 | |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 605 | enum BuiltinOperator : int32_t { |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 606 | BuiltinOperator_ADD = 0, |
| 607 | BuiltinOperator_AVERAGE_POOL_2D = 1, |
| 608 | BuiltinOperator_CONCATENATION = 2, |
| 609 | BuiltinOperator_CONV_2D = 3, |
| 610 | BuiltinOperator_DEPTHWISE_CONV_2D = 4, |
| 611 | BuiltinOperator_DEPTH_TO_SPACE = 5, |
| 612 | BuiltinOperator_DEQUANTIZE = 6, |
| 613 | BuiltinOperator_EMBEDDING_LOOKUP = 7, |
| 614 | BuiltinOperator_FLOOR = 8, |
| 615 | BuiltinOperator_FULLY_CONNECTED = 9, |
| 616 | BuiltinOperator_HASHTABLE_LOOKUP = 10, |
| 617 | BuiltinOperator_L2_NORMALIZATION = 11, |
| 618 | BuiltinOperator_L2_POOL_2D = 12, |
| 619 | BuiltinOperator_LOCAL_RESPONSE_NORMALIZATION = 13, |
| 620 | BuiltinOperator_LOGISTIC = 14, |
| 621 | BuiltinOperator_LSH_PROJECTION = 15, |
| 622 | BuiltinOperator_LSTM = 16, |
| 623 | BuiltinOperator_MAX_POOL_2D = 17, |
| 624 | BuiltinOperator_MUL = 18, |
| 625 | BuiltinOperator_RELU = 19, |
| 626 | BuiltinOperator_RELU_N1_TO_1 = 20, |
| 627 | BuiltinOperator_RELU6 = 21, |
| 628 | BuiltinOperator_RESHAPE = 22, |
| 629 | BuiltinOperator_RESIZE_BILINEAR = 23, |
| 630 | BuiltinOperator_RNN = 24, |
| 631 | BuiltinOperator_SOFTMAX = 25, |
| 632 | BuiltinOperator_SPACE_TO_DEPTH = 26, |
| 633 | BuiltinOperator_SVDF = 27, |
| 634 | BuiltinOperator_TANH = 28, |
| 635 | BuiltinOperator_CONCAT_EMBEDDINGS = 29, |
| 636 | BuiltinOperator_SKIP_GRAM = 30, |
| 637 | BuiltinOperator_CALL = 31, |
| 638 | BuiltinOperator_CUSTOM = 32, |
| 639 | BuiltinOperator_EMBEDDING_LOOKUP_SPARSE = 33, |
| 640 | BuiltinOperator_PAD = 34, |
| 641 | BuiltinOperator_UNIDIRECTIONAL_SEQUENCE_RNN = 35, |
| 642 | BuiltinOperator_GATHER = 36, |
| 643 | BuiltinOperator_BATCH_TO_SPACE_ND = 37, |
| 644 | BuiltinOperator_SPACE_TO_BATCH_ND = 38, |
| 645 | BuiltinOperator_TRANSPOSE = 39, |
| 646 | BuiltinOperator_MEAN = 40, |
| 647 | BuiltinOperator_SUB = 41, |
| 648 | BuiltinOperator_DIV = 42, |
| 649 | BuiltinOperator_SQUEEZE = 43, |
| 650 | BuiltinOperator_UNIDIRECTIONAL_SEQUENCE_LSTM = 44, |
| 651 | BuiltinOperator_STRIDED_SLICE = 45, |
| 652 | BuiltinOperator_BIDIRECTIONAL_SEQUENCE_RNN = 46, |
| 653 | BuiltinOperator_EXP = 47, |
| 654 | BuiltinOperator_TOPK_V2 = 48, |
| 655 | BuiltinOperator_SPLIT = 49, |
| 656 | BuiltinOperator_LOG_SOFTMAX = 50, |
| 657 | BuiltinOperator_DELEGATE = 51, |
| 658 | BuiltinOperator_BIDIRECTIONAL_SEQUENCE_LSTM = 52, |
| 659 | BuiltinOperator_CAST = 53, |
| 660 | BuiltinOperator_PRELU = 54, |
| 661 | BuiltinOperator_MAXIMUM = 55, |
| 662 | BuiltinOperator_ARG_MAX = 56, |
| 663 | BuiltinOperator_MINIMUM = 57, |
| 664 | BuiltinOperator_LESS = 58, |
| 665 | BuiltinOperator_NEG = 59, |
| 666 | BuiltinOperator_PADV2 = 60, |
| 667 | BuiltinOperator_GREATER = 61, |
| 668 | BuiltinOperator_GREATER_EQUAL = 62, |
| 669 | BuiltinOperator_LESS_EQUAL = 63, |
| 670 | BuiltinOperator_SELECT = 64, |
| 671 | BuiltinOperator_SLICE = 65, |
| 672 | BuiltinOperator_SIN = 66, |
| 673 | BuiltinOperator_TRANSPOSE_CONV = 67, |
| 674 | BuiltinOperator_SPARSE_TO_DENSE = 68, |
| 675 | BuiltinOperator_TILE = 69, |
| 676 | BuiltinOperator_EXPAND_DIMS = 70, |
| 677 | BuiltinOperator_EQUAL = 71, |
| 678 | BuiltinOperator_NOT_EQUAL = 72, |
| 679 | BuiltinOperator_LOG = 73, |
| 680 | BuiltinOperator_SUM = 74, |
| 681 | BuiltinOperator_SQRT = 75, |
| 682 | BuiltinOperator_RSQRT = 76, |
| 683 | BuiltinOperator_SHAPE = 77, |
| 684 | BuiltinOperator_POW = 78, |
| 685 | BuiltinOperator_ARG_MIN = 79, |
| 686 | BuiltinOperator_FAKE_QUANT = 80, |
| 687 | BuiltinOperator_REDUCE_PROD = 81, |
| 688 | BuiltinOperator_REDUCE_MAX = 82, |
| 689 | BuiltinOperator_PACK = 83, |
| 690 | BuiltinOperator_LOGICAL_OR = 84, |
| 691 | BuiltinOperator_ONE_HOT = 85, |
| 692 | BuiltinOperator_LOGICAL_AND = 86, |
| 693 | BuiltinOperator_LOGICAL_NOT = 87, |
| 694 | BuiltinOperator_UNPACK = 88, |
| 695 | BuiltinOperator_REDUCE_MIN = 89, |
| 696 | BuiltinOperator_FLOOR_DIV = 90, |
| 697 | BuiltinOperator_REDUCE_ANY = 91, |
| 698 | BuiltinOperator_SQUARE = 92, |
| 699 | BuiltinOperator_ZEROS_LIKE = 93, |
| 700 | BuiltinOperator_FILL = 94, |
| 701 | BuiltinOperator_FLOOR_MOD = 95, |
| 702 | BuiltinOperator_RANGE = 96, |
| 703 | BuiltinOperator_RESIZE_NEAREST_NEIGHBOR = 97, |
| 704 | BuiltinOperator_LEAKY_RELU = 98, |
| 705 | BuiltinOperator_SQUARED_DIFFERENCE = 99, |
| 706 | BuiltinOperator_MIRROR_PAD = 100, |
| 707 | BuiltinOperator_ABS = 101, |
| 708 | BuiltinOperator_SPLIT_V = 102, |
| 709 | BuiltinOperator_UNIQUE = 103, |
| 710 | BuiltinOperator_CEIL = 104, |
| 711 | BuiltinOperator_REVERSE_V2 = 105, |
| 712 | BuiltinOperator_ADD_N = 106, |
| 713 | BuiltinOperator_GATHER_ND = 107, |
| 714 | BuiltinOperator_COS = 108, |
| 715 | BuiltinOperator_WHERE = 109, |
| 716 | BuiltinOperator_RANK = 110, |
| 717 | BuiltinOperator_ELU = 111, |
| 718 | BuiltinOperator_REVERSE_SEQUENCE = 112, |
| 719 | BuiltinOperator_MATRIX_DIAG = 113, |
| 720 | BuiltinOperator_QUANTIZE = 114, |
| 721 | BuiltinOperator_MATRIX_SET_DIAG = 115, |
| 722 | BuiltinOperator_ROUND = 116, |
| 723 | BuiltinOperator_HARD_SWISH = 117, |
| 724 | BuiltinOperator_IF = 118, |
| 725 | BuiltinOperator_WHILE = 119, |
| 726 | BuiltinOperator_NON_MAX_SUPPRESSION_V4 = 120, |
| 727 | BuiltinOperator_NON_MAX_SUPPRESSION_V5 = 121, |
| 728 | BuiltinOperator_SCATTER_ND = 122, |
| 729 | BuiltinOperator_SELECT_V2 = 123, |
| 730 | BuiltinOperator_DENSIFY = 124, |
| 731 | BuiltinOperator_SEGMENT_SUM = 125, |
| 732 | BuiltinOperator_BATCH_MATMUL = 126, |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 733 | BuiltinOperator_PLACEHOLDER_FOR_GREATER_OP_CODES = 127, |
| 734 | BuiltinOperator_CUMSUM = 128, |
| 735 | BuiltinOperator_CALL_ONCE = 129, |
| 736 | BuiltinOperator_BROADCAST_TO = 130, |
| 737 | BuiltinOperator_RFFT2D = 131, |
| 738 | BuiltinOperator_CONV_3D = 132, |
| 739 | BuiltinOperator_IMAG = 133, |
| 740 | BuiltinOperator_REAL = 134, |
| 741 | BuiltinOperator_COMPLEX_ABS = 135, |
| 742 | BuiltinOperator_HASHTABLE = 136, |
| 743 | BuiltinOperator_HASHTABLE_FIND = 137, |
| 744 | BuiltinOperator_HASHTABLE_IMPORT = 138, |
| 745 | BuiltinOperator_HASHTABLE_SIZE = 139, |
| 746 | BuiltinOperator_REDUCE_ALL = 140, |
| 747 | BuiltinOperator_CONV_3D_TRANSPOSE = 141, |
| 748 | BuiltinOperator_VAR_HANDLE = 142, |
| 749 | BuiltinOperator_READ_VARIABLE = 143, |
| 750 | BuiltinOperator_ASSIGN_VARIABLE = 144, |
| 751 | BuiltinOperator_BROADCAST_ARGS = 145, |
| 752 | BuiltinOperator_RANDOM_STANDARD_NORMAL = 146, |
| 753 | BuiltinOperator_BUCKETIZE = 147, |
| 754 | BuiltinOperator_RANDOM_UNIFORM = 148, |
| 755 | BuiltinOperator_MULTINOMIAL = 149, |
| 756 | BuiltinOperator_GELU = 150, |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 757 | BuiltinOperator_MIN = BuiltinOperator_ADD, |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 758 | BuiltinOperator_MAX = BuiltinOperator_GELU |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 759 | }; |
| 760 | |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 761 | inline const BuiltinOperator (&EnumValuesBuiltinOperator())[151] { |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 762 | static const BuiltinOperator values[] = { |
| 763 | BuiltinOperator_ADD, |
| 764 | BuiltinOperator_AVERAGE_POOL_2D, |
| 765 | BuiltinOperator_CONCATENATION, |
| 766 | BuiltinOperator_CONV_2D, |
| 767 | BuiltinOperator_DEPTHWISE_CONV_2D, |
| 768 | BuiltinOperator_DEPTH_TO_SPACE, |
| 769 | BuiltinOperator_DEQUANTIZE, |
| 770 | BuiltinOperator_EMBEDDING_LOOKUP, |
| 771 | BuiltinOperator_FLOOR, |
| 772 | BuiltinOperator_FULLY_CONNECTED, |
| 773 | BuiltinOperator_HASHTABLE_LOOKUP, |
| 774 | BuiltinOperator_L2_NORMALIZATION, |
| 775 | BuiltinOperator_L2_POOL_2D, |
| 776 | BuiltinOperator_LOCAL_RESPONSE_NORMALIZATION, |
| 777 | BuiltinOperator_LOGISTIC, |
| 778 | BuiltinOperator_LSH_PROJECTION, |
| 779 | BuiltinOperator_LSTM, |
| 780 | BuiltinOperator_MAX_POOL_2D, |
| 781 | BuiltinOperator_MUL, |
| 782 | BuiltinOperator_RELU, |
| 783 | BuiltinOperator_RELU_N1_TO_1, |
| 784 | BuiltinOperator_RELU6, |
| 785 | BuiltinOperator_RESHAPE, |
| 786 | BuiltinOperator_RESIZE_BILINEAR, |
| 787 | BuiltinOperator_RNN, |
| 788 | BuiltinOperator_SOFTMAX, |
| 789 | BuiltinOperator_SPACE_TO_DEPTH, |
| 790 | BuiltinOperator_SVDF, |
| 791 | BuiltinOperator_TANH, |
| 792 | BuiltinOperator_CONCAT_EMBEDDINGS, |
| 793 | BuiltinOperator_SKIP_GRAM, |
| 794 | BuiltinOperator_CALL, |
| 795 | BuiltinOperator_CUSTOM, |
| 796 | BuiltinOperator_EMBEDDING_LOOKUP_SPARSE, |
| 797 | BuiltinOperator_PAD, |
| 798 | BuiltinOperator_UNIDIRECTIONAL_SEQUENCE_RNN, |
| 799 | BuiltinOperator_GATHER, |
| 800 | BuiltinOperator_BATCH_TO_SPACE_ND, |
| 801 | BuiltinOperator_SPACE_TO_BATCH_ND, |
| 802 | BuiltinOperator_TRANSPOSE, |
| 803 | BuiltinOperator_MEAN, |
| 804 | BuiltinOperator_SUB, |
| 805 | BuiltinOperator_DIV, |
| 806 | BuiltinOperator_SQUEEZE, |
| 807 | BuiltinOperator_UNIDIRECTIONAL_SEQUENCE_LSTM, |
| 808 | BuiltinOperator_STRIDED_SLICE, |
| 809 | BuiltinOperator_BIDIRECTIONAL_SEQUENCE_RNN, |
| 810 | BuiltinOperator_EXP, |
| 811 | BuiltinOperator_TOPK_V2, |
| 812 | BuiltinOperator_SPLIT, |
| 813 | BuiltinOperator_LOG_SOFTMAX, |
| 814 | BuiltinOperator_DELEGATE, |
| 815 | BuiltinOperator_BIDIRECTIONAL_SEQUENCE_LSTM, |
| 816 | BuiltinOperator_CAST, |
| 817 | BuiltinOperator_PRELU, |
| 818 | BuiltinOperator_MAXIMUM, |
| 819 | BuiltinOperator_ARG_MAX, |
| 820 | BuiltinOperator_MINIMUM, |
| 821 | BuiltinOperator_LESS, |
| 822 | BuiltinOperator_NEG, |
| 823 | BuiltinOperator_PADV2, |
| 824 | BuiltinOperator_GREATER, |
| 825 | BuiltinOperator_GREATER_EQUAL, |
| 826 | BuiltinOperator_LESS_EQUAL, |
| 827 | BuiltinOperator_SELECT, |
| 828 | BuiltinOperator_SLICE, |
| 829 | BuiltinOperator_SIN, |
| 830 | BuiltinOperator_TRANSPOSE_CONV, |
| 831 | BuiltinOperator_SPARSE_TO_DENSE, |
| 832 | BuiltinOperator_TILE, |
| 833 | BuiltinOperator_EXPAND_DIMS, |
| 834 | BuiltinOperator_EQUAL, |
| 835 | BuiltinOperator_NOT_EQUAL, |
| 836 | BuiltinOperator_LOG, |
| 837 | BuiltinOperator_SUM, |
| 838 | BuiltinOperator_SQRT, |
| 839 | BuiltinOperator_RSQRT, |
| 840 | BuiltinOperator_SHAPE, |
| 841 | BuiltinOperator_POW, |
| 842 | BuiltinOperator_ARG_MIN, |
| 843 | BuiltinOperator_FAKE_QUANT, |
| 844 | BuiltinOperator_REDUCE_PROD, |
| 845 | BuiltinOperator_REDUCE_MAX, |
| 846 | BuiltinOperator_PACK, |
| 847 | BuiltinOperator_LOGICAL_OR, |
| 848 | BuiltinOperator_ONE_HOT, |
| 849 | BuiltinOperator_LOGICAL_AND, |
| 850 | BuiltinOperator_LOGICAL_NOT, |
| 851 | BuiltinOperator_UNPACK, |
| 852 | BuiltinOperator_REDUCE_MIN, |
| 853 | BuiltinOperator_FLOOR_DIV, |
| 854 | BuiltinOperator_REDUCE_ANY, |
| 855 | BuiltinOperator_SQUARE, |
| 856 | BuiltinOperator_ZEROS_LIKE, |
| 857 | BuiltinOperator_FILL, |
| 858 | BuiltinOperator_FLOOR_MOD, |
| 859 | BuiltinOperator_RANGE, |
| 860 | BuiltinOperator_RESIZE_NEAREST_NEIGHBOR, |
| 861 | BuiltinOperator_LEAKY_RELU, |
| 862 | BuiltinOperator_SQUARED_DIFFERENCE, |
| 863 | BuiltinOperator_MIRROR_PAD, |
| 864 | BuiltinOperator_ABS, |
| 865 | BuiltinOperator_SPLIT_V, |
| 866 | BuiltinOperator_UNIQUE, |
| 867 | BuiltinOperator_CEIL, |
| 868 | BuiltinOperator_REVERSE_V2, |
| 869 | BuiltinOperator_ADD_N, |
| 870 | BuiltinOperator_GATHER_ND, |
| 871 | BuiltinOperator_COS, |
| 872 | BuiltinOperator_WHERE, |
| 873 | BuiltinOperator_RANK, |
| 874 | BuiltinOperator_ELU, |
| 875 | BuiltinOperator_REVERSE_SEQUENCE, |
| 876 | BuiltinOperator_MATRIX_DIAG, |
| 877 | BuiltinOperator_QUANTIZE, |
| 878 | BuiltinOperator_MATRIX_SET_DIAG, |
| 879 | BuiltinOperator_ROUND, |
| 880 | BuiltinOperator_HARD_SWISH, |
| 881 | BuiltinOperator_IF, |
| 882 | BuiltinOperator_WHILE, |
| 883 | BuiltinOperator_NON_MAX_SUPPRESSION_V4, |
| 884 | BuiltinOperator_NON_MAX_SUPPRESSION_V5, |
| 885 | BuiltinOperator_SCATTER_ND, |
| 886 | BuiltinOperator_SELECT_V2, |
| 887 | BuiltinOperator_DENSIFY, |
| 888 | BuiltinOperator_SEGMENT_SUM, |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 889 | BuiltinOperator_BATCH_MATMUL, |
| 890 | BuiltinOperator_PLACEHOLDER_FOR_GREATER_OP_CODES, |
| 891 | BuiltinOperator_CUMSUM, |
| 892 | BuiltinOperator_CALL_ONCE, |
| 893 | BuiltinOperator_BROADCAST_TO, |
| 894 | BuiltinOperator_RFFT2D, |
| 895 | BuiltinOperator_CONV_3D, |
| 896 | BuiltinOperator_IMAG, |
| 897 | BuiltinOperator_REAL, |
| 898 | BuiltinOperator_COMPLEX_ABS, |
| 899 | BuiltinOperator_HASHTABLE, |
| 900 | BuiltinOperator_HASHTABLE_FIND, |
| 901 | BuiltinOperator_HASHTABLE_IMPORT, |
| 902 | BuiltinOperator_HASHTABLE_SIZE, |
| 903 | BuiltinOperator_REDUCE_ALL, |
| 904 | BuiltinOperator_CONV_3D_TRANSPOSE, |
| 905 | BuiltinOperator_VAR_HANDLE, |
| 906 | BuiltinOperator_READ_VARIABLE, |
| 907 | BuiltinOperator_ASSIGN_VARIABLE, |
| 908 | BuiltinOperator_BROADCAST_ARGS, |
| 909 | BuiltinOperator_RANDOM_STANDARD_NORMAL, |
| 910 | BuiltinOperator_BUCKETIZE, |
| 911 | BuiltinOperator_RANDOM_UNIFORM, |
| 912 | BuiltinOperator_MULTINOMIAL, |
| 913 | BuiltinOperator_GELU |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 914 | }; |
| 915 | return values; |
| 916 | } |
| 917 | |
| 918 | inline const char * const *EnumNamesBuiltinOperator() { |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 919 | static const char * const names[152] = { |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 920 | "ADD", |
| 921 | "AVERAGE_POOL_2D", |
| 922 | "CONCATENATION", |
| 923 | "CONV_2D", |
| 924 | "DEPTHWISE_CONV_2D", |
| 925 | "DEPTH_TO_SPACE", |
| 926 | "DEQUANTIZE", |
| 927 | "EMBEDDING_LOOKUP", |
| 928 | "FLOOR", |
| 929 | "FULLY_CONNECTED", |
| 930 | "HASHTABLE_LOOKUP", |
| 931 | "L2_NORMALIZATION", |
| 932 | "L2_POOL_2D", |
| 933 | "LOCAL_RESPONSE_NORMALIZATION", |
| 934 | "LOGISTIC", |
| 935 | "LSH_PROJECTION", |
| 936 | "LSTM", |
| 937 | "MAX_POOL_2D", |
| 938 | "MUL", |
| 939 | "RELU", |
| 940 | "RELU_N1_TO_1", |
| 941 | "RELU6", |
| 942 | "RESHAPE", |
| 943 | "RESIZE_BILINEAR", |
| 944 | "RNN", |
| 945 | "SOFTMAX", |
| 946 | "SPACE_TO_DEPTH", |
| 947 | "SVDF", |
| 948 | "TANH", |
| 949 | "CONCAT_EMBEDDINGS", |
| 950 | "SKIP_GRAM", |
| 951 | "CALL", |
| 952 | "CUSTOM", |
| 953 | "EMBEDDING_LOOKUP_SPARSE", |
| 954 | "PAD", |
| 955 | "UNIDIRECTIONAL_SEQUENCE_RNN", |
| 956 | "GATHER", |
| 957 | "BATCH_TO_SPACE_ND", |
| 958 | "SPACE_TO_BATCH_ND", |
| 959 | "TRANSPOSE", |
| 960 | "MEAN", |
| 961 | "SUB", |
| 962 | "DIV", |
| 963 | "SQUEEZE", |
| 964 | "UNIDIRECTIONAL_SEQUENCE_LSTM", |
| 965 | "STRIDED_SLICE", |
| 966 | "BIDIRECTIONAL_SEQUENCE_RNN", |
| 967 | "EXP", |
| 968 | "TOPK_V2", |
| 969 | "SPLIT", |
| 970 | "LOG_SOFTMAX", |
| 971 | "DELEGATE", |
| 972 | "BIDIRECTIONAL_SEQUENCE_LSTM", |
| 973 | "CAST", |
| 974 | "PRELU", |
| 975 | "MAXIMUM", |
| 976 | "ARG_MAX", |
| 977 | "MINIMUM", |
| 978 | "LESS", |
| 979 | "NEG", |
| 980 | "PADV2", |
| 981 | "GREATER", |
| 982 | "GREATER_EQUAL", |
| 983 | "LESS_EQUAL", |
| 984 | "SELECT", |
| 985 | "SLICE", |
| 986 | "SIN", |
| 987 | "TRANSPOSE_CONV", |
| 988 | "SPARSE_TO_DENSE", |
| 989 | "TILE", |
| 990 | "EXPAND_DIMS", |
| 991 | "EQUAL", |
| 992 | "NOT_EQUAL", |
| 993 | "LOG", |
| 994 | "SUM", |
| 995 | "SQRT", |
| 996 | "RSQRT", |
| 997 | "SHAPE", |
| 998 | "POW", |
| 999 | "ARG_MIN", |
| 1000 | "FAKE_QUANT", |
| 1001 | "REDUCE_PROD", |
| 1002 | "REDUCE_MAX", |
| 1003 | "PACK", |
| 1004 | "LOGICAL_OR", |
| 1005 | "ONE_HOT", |
| 1006 | "LOGICAL_AND", |
| 1007 | "LOGICAL_NOT", |
| 1008 | "UNPACK", |
| 1009 | "REDUCE_MIN", |
| 1010 | "FLOOR_DIV", |
| 1011 | "REDUCE_ANY", |
| 1012 | "SQUARE", |
| 1013 | "ZEROS_LIKE", |
| 1014 | "FILL", |
| 1015 | "FLOOR_MOD", |
| 1016 | "RANGE", |
| 1017 | "RESIZE_NEAREST_NEIGHBOR", |
| 1018 | "LEAKY_RELU", |
| 1019 | "SQUARED_DIFFERENCE", |
| 1020 | "MIRROR_PAD", |
| 1021 | "ABS", |
| 1022 | "SPLIT_V", |
| 1023 | "UNIQUE", |
| 1024 | "CEIL", |
| 1025 | "REVERSE_V2", |
| 1026 | "ADD_N", |
| 1027 | "GATHER_ND", |
| 1028 | "COS", |
| 1029 | "WHERE", |
| 1030 | "RANK", |
| 1031 | "ELU", |
| 1032 | "REVERSE_SEQUENCE", |
| 1033 | "MATRIX_DIAG", |
| 1034 | "QUANTIZE", |
| 1035 | "MATRIX_SET_DIAG", |
| 1036 | "ROUND", |
| 1037 | "HARD_SWISH", |
| 1038 | "IF", |
| 1039 | "WHILE", |
| 1040 | "NON_MAX_SUPPRESSION_V4", |
| 1041 | "NON_MAX_SUPPRESSION_V5", |
| 1042 | "SCATTER_ND", |
| 1043 | "SELECT_V2", |
| 1044 | "DENSIFY", |
| 1045 | "SEGMENT_SUM", |
| 1046 | "BATCH_MATMUL", |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 1047 | "PLACEHOLDER_FOR_GREATER_OP_CODES", |
| 1048 | "CUMSUM", |
| 1049 | "CALL_ONCE", |
| 1050 | "BROADCAST_TO", |
| 1051 | "RFFT2D", |
| 1052 | "CONV_3D", |
| 1053 | "IMAG", |
| 1054 | "REAL", |
| 1055 | "COMPLEX_ABS", |
| 1056 | "HASHTABLE", |
| 1057 | "HASHTABLE_FIND", |
| 1058 | "HASHTABLE_IMPORT", |
| 1059 | "HASHTABLE_SIZE", |
| 1060 | "REDUCE_ALL", |
| 1061 | "CONV_3D_TRANSPOSE", |
| 1062 | "VAR_HANDLE", |
| 1063 | "READ_VARIABLE", |
| 1064 | "ASSIGN_VARIABLE", |
| 1065 | "BROADCAST_ARGS", |
| 1066 | "RANDOM_STANDARD_NORMAL", |
| 1067 | "BUCKETIZE", |
| 1068 | "RANDOM_UNIFORM", |
| 1069 | "MULTINOMIAL", |
| 1070 | "GELU", |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 1071 | nullptr |
| 1072 | }; |
| 1073 | return names; |
| 1074 | } |
| 1075 | |
| 1076 | inline const char *EnumNameBuiltinOperator(BuiltinOperator e) { |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 1077 | if (flatbuffers::IsOutRange(e, BuiltinOperator_ADD, BuiltinOperator_GELU)) return ""; |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 1078 | const size_t index = static_cast<size_t>(e); |
| 1079 | return EnumNamesBuiltinOperator()[index]; |
| 1080 | } |
| 1081 | |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 1082 | enum BuiltinOptions : uint8_t { |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 1083 | BuiltinOptions_NONE = 0, |
| 1084 | BuiltinOptions_Conv2DOptions = 1, |
| 1085 | BuiltinOptions_DepthwiseConv2DOptions = 2, |
| 1086 | BuiltinOptions_ConcatEmbeddingsOptions = 3, |
| 1087 | BuiltinOptions_LSHProjectionOptions = 4, |
| 1088 | BuiltinOptions_Pool2DOptions = 5, |
| 1089 | BuiltinOptions_SVDFOptions = 6, |
| 1090 | BuiltinOptions_RNNOptions = 7, |
| 1091 | BuiltinOptions_FullyConnectedOptions = 8, |
| 1092 | BuiltinOptions_SoftmaxOptions = 9, |
| 1093 | BuiltinOptions_ConcatenationOptions = 10, |
| 1094 | BuiltinOptions_AddOptions = 11, |
| 1095 | BuiltinOptions_L2NormOptions = 12, |
| 1096 | BuiltinOptions_LocalResponseNormalizationOptions = 13, |
| 1097 | BuiltinOptions_LSTMOptions = 14, |
| 1098 | BuiltinOptions_ResizeBilinearOptions = 15, |
| 1099 | BuiltinOptions_CallOptions = 16, |
| 1100 | BuiltinOptions_ReshapeOptions = 17, |
| 1101 | BuiltinOptions_SkipGramOptions = 18, |
| 1102 | BuiltinOptions_SpaceToDepthOptions = 19, |
| 1103 | BuiltinOptions_EmbeddingLookupSparseOptions = 20, |
| 1104 | BuiltinOptions_MulOptions = 21, |
| 1105 | BuiltinOptions_PadOptions = 22, |
| 1106 | BuiltinOptions_GatherOptions = 23, |
| 1107 | BuiltinOptions_BatchToSpaceNDOptions = 24, |
| 1108 | BuiltinOptions_SpaceToBatchNDOptions = 25, |
| 1109 | BuiltinOptions_TransposeOptions = 26, |
| 1110 | BuiltinOptions_ReducerOptions = 27, |
| 1111 | BuiltinOptions_SubOptions = 28, |
| 1112 | BuiltinOptions_DivOptions = 29, |
| 1113 | BuiltinOptions_SqueezeOptions = 30, |
| 1114 | BuiltinOptions_SequenceRNNOptions = 31, |
| 1115 | BuiltinOptions_StridedSliceOptions = 32, |
| 1116 | BuiltinOptions_ExpOptions = 33, |
| 1117 | BuiltinOptions_TopKV2Options = 34, |
| 1118 | BuiltinOptions_SplitOptions = 35, |
| 1119 | BuiltinOptions_LogSoftmaxOptions = 36, |
| 1120 | BuiltinOptions_CastOptions = 37, |
| 1121 | BuiltinOptions_DequantizeOptions = 38, |
| 1122 | BuiltinOptions_MaximumMinimumOptions = 39, |
| 1123 | BuiltinOptions_ArgMaxOptions = 40, |
| 1124 | BuiltinOptions_LessOptions = 41, |
| 1125 | BuiltinOptions_NegOptions = 42, |
| 1126 | BuiltinOptions_PadV2Options = 43, |
| 1127 | BuiltinOptions_GreaterOptions = 44, |
| 1128 | BuiltinOptions_GreaterEqualOptions = 45, |
| 1129 | BuiltinOptions_LessEqualOptions = 46, |
| 1130 | BuiltinOptions_SelectOptions = 47, |
| 1131 | BuiltinOptions_SliceOptions = 48, |
| 1132 | BuiltinOptions_TransposeConvOptions = 49, |
| 1133 | BuiltinOptions_SparseToDenseOptions = 50, |
| 1134 | BuiltinOptions_TileOptions = 51, |
| 1135 | BuiltinOptions_ExpandDimsOptions = 52, |
| 1136 | BuiltinOptions_EqualOptions = 53, |
| 1137 | BuiltinOptions_NotEqualOptions = 54, |
| 1138 | BuiltinOptions_ShapeOptions = 55, |
| 1139 | BuiltinOptions_PowOptions = 56, |
| 1140 | BuiltinOptions_ArgMinOptions = 57, |
| 1141 | BuiltinOptions_FakeQuantOptions = 58, |
| 1142 | BuiltinOptions_PackOptions = 59, |
| 1143 | BuiltinOptions_LogicalOrOptions = 60, |
| 1144 | BuiltinOptions_OneHotOptions = 61, |
| 1145 | BuiltinOptions_LogicalAndOptions = 62, |
| 1146 | BuiltinOptions_LogicalNotOptions = 63, |
| 1147 | BuiltinOptions_UnpackOptions = 64, |
| 1148 | BuiltinOptions_FloorDivOptions = 65, |
| 1149 | BuiltinOptions_SquareOptions = 66, |
| 1150 | BuiltinOptions_ZerosLikeOptions = 67, |
| 1151 | BuiltinOptions_FillOptions = 68, |
| 1152 | BuiltinOptions_BidirectionalSequenceLSTMOptions = 69, |
| 1153 | BuiltinOptions_BidirectionalSequenceRNNOptions = 70, |
| 1154 | BuiltinOptions_UnidirectionalSequenceLSTMOptions = 71, |
| 1155 | BuiltinOptions_FloorModOptions = 72, |
| 1156 | BuiltinOptions_RangeOptions = 73, |
| 1157 | BuiltinOptions_ResizeNearestNeighborOptions = 74, |
| 1158 | BuiltinOptions_LeakyReluOptions = 75, |
| 1159 | BuiltinOptions_SquaredDifferenceOptions = 76, |
| 1160 | BuiltinOptions_MirrorPadOptions = 77, |
| 1161 | BuiltinOptions_AbsOptions = 78, |
| 1162 | BuiltinOptions_SplitVOptions = 79, |
| 1163 | BuiltinOptions_UniqueOptions = 80, |
| 1164 | BuiltinOptions_ReverseV2Options = 81, |
| 1165 | BuiltinOptions_AddNOptions = 82, |
| 1166 | BuiltinOptions_GatherNdOptions = 83, |
| 1167 | BuiltinOptions_CosOptions = 84, |
| 1168 | BuiltinOptions_WhereOptions = 85, |
| 1169 | BuiltinOptions_RankOptions = 86, |
| 1170 | BuiltinOptions_ReverseSequenceOptions = 87, |
| 1171 | BuiltinOptions_MatrixDiagOptions = 88, |
| 1172 | BuiltinOptions_QuantizeOptions = 89, |
| 1173 | BuiltinOptions_MatrixSetDiagOptions = 90, |
| 1174 | BuiltinOptions_HardSwishOptions = 91, |
| 1175 | BuiltinOptions_IfOptions = 92, |
| 1176 | BuiltinOptions_WhileOptions = 93, |
| 1177 | BuiltinOptions_DepthToSpaceOptions = 94, |
| 1178 | BuiltinOptions_NonMaxSuppressionV4Options = 95, |
| 1179 | BuiltinOptions_NonMaxSuppressionV5Options = 96, |
| 1180 | BuiltinOptions_ScatterNdOptions = 97, |
| 1181 | BuiltinOptions_SelectV2Options = 98, |
| 1182 | BuiltinOptions_DensifyOptions = 99, |
| 1183 | BuiltinOptions_SegmentSumOptions = 100, |
| 1184 | BuiltinOptions_BatchMatMulOptions = 101, |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 1185 | BuiltinOptions_CumsumOptions = 102, |
| 1186 | BuiltinOptions_CallOnceOptions = 103, |
| 1187 | BuiltinOptions_BroadcastToOptions = 104, |
| 1188 | BuiltinOptions_Rfft2dOptions = 105, |
| 1189 | BuiltinOptions_Conv3DOptions = 106, |
| 1190 | BuiltinOptions_HashtableOptions = 107, |
| 1191 | BuiltinOptions_HashtableFindOptions = 108, |
| 1192 | BuiltinOptions_HashtableImportOptions = 109, |
| 1193 | BuiltinOptions_HashtableSizeOptions = 110, |
| 1194 | BuiltinOptions_VarHandleOptions = 111, |
| 1195 | BuiltinOptions_ReadVariableOptions = 112, |
| 1196 | BuiltinOptions_AssignVariableOptions = 113, |
| 1197 | BuiltinOptions_RandomOptions = 114, |
| 1198 | BuiltinOptions_BucketizeOptions = 115, |
| 1199 | BuiltinOptions_GeluOptions = 116, |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 1200 | BuiltinOptions_MIN = BuiltinOptions_NONE, |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 1201 | BuiltinOptions_MAX = BuiltinOptions_GeluOptions |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 1202 | }; |
| 1203 | |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 1204 | inline const BuiltinOptions (&EnumValuesBuiltinOptions())[117] { |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 1205 | static const BuiltinOptions values[] = { |
| 1206 | BuiltinOptions_NONE, |
| 1207 | BuiltinOptions_Conv2DOptions, |
| 1208 | BuiltinOptions_DepthwiseConv2DOptions, |
| 1209 | BuiltinOptions_ConcatEmbeddingsOptions, |
| 1210 | BuiltinOptions_LSHProjectionOptions, |
| 1211 | BuiltinOptions_Pool2DOptions, |
| 1212 | BuiltinOptions_SVDFOptions, |
| 1213 | BuiltinOptions_RNNOptions, |
| 1214 | BuiltinOptions_FullyConnectedOptions, |
| 1215 | BuiltinOptions_SoftmaxOptions, |
| 1216 | BuiltinOptions_ConcatenationOptions, |
| 1217 | BuiltinOptions_AddOptions, |
| 1218 | BuiltinOptions_L2NormOptions, |
| 1219 | BuiltinOptions_LocalResponseNormalizationOptions, |
| 1220 | BuiltinOptions_LSTMOptions, |
| 1221 | BuiltinOptions_ResizeBilinearOptions, |
| 1222 | BuiltinOptions_CallOptions, |
| 1223 | BuiltinOptions_ReshapeOptions, |
| 1224 | BuiltinOptions_SkipGramOptions, |
| 1225 | BuiltinOptions_SpaceToDepthOptions, |
| 1226 | BuiltinOptions_EmbeddingLookupSparseOptions, |
| 1227 | BuiltinOptions_MulOptions, |
| 1228 | BuiltinOptions_PadOptions, |
| 1229 | BuiltinOptions_GatherOptions, |
| 1230 | BuiltinOptions_BatchToSpaceNDOptions, |
| 1231 | BuiltinOptions_SpaceToBatchNDOptions, |
| 1232 | BuiltinOptions_TransposeOptions, |
| 1233 | BuiltinOptions_ReducerOptions, |
| 1234 | BuiltinOptions_SubOptions, |
| 1235 | BuiltinOptions_DivOptions, |
| 1236 | BuiltinOptions_SqueezeOptions, |
| 1237 | BuiltinOptions_SequenceRNNOptions, |
| 1238 | BuiltinOptions_StridedSliceOptions, |
| 1239 | BuiltinOptions_ExpOptions, |
| 1240 | BuiltinOptions_TopKV2Options, |
| 1241 | BuiltinOptions_SplitOptions, |
| 1242 | BuiltinOptions_LogSoftmaxOptions, |
| 1243 | BuiltinOptions_CastOptions, |
| 1244 | BuiltinOptions_DequantizeOptions, |
| 1245 | BuiltinOptions_MaximumMinimumOptions, |
| 1246 | BuiltinOptions_ArgMaxOptions, |
| 1247 | BuiltinOptions_LessOptions, |
| 1248 | BuiltinOptions_NegOptions, |
| 1249 | BuiltinOptions_PadV2Options, |
| 1250 | BuiltinOptions_GreaterOptions, |
| 1251 | BuiltinOptions_GreaterEqualOptions, |
| 1252 | BuiltinOptions_LessEqualOptions, |
| 1253 | BuiltinOptions_SelectOptions, |
| 1254 | BuiltinOptions_SliceOptions, |
| 1255 | BuiltinOptions_TransposeConvOptions, |
| 1256 | BuiltinOptions_SparseToDenseOptions, |
| 1257 | BuiltinOptions_TileOptions, |
| 1258 | BuiltinOptions_ExpandDimsOptions, |
| 1259 | BuiltinOptions_EqualOptions, |
| 1260 | BuiltinOptions_NotEqualOptions, |
| 1261 | BuiltinOptions_ShapeOptions, |
| 1262 | BuiltinOptions_PowOptions, |
| 1263 | BuiltinOptions_ArgMinOptions, |
| 1264 | BuiltinOptions_FakeQuantOptions, |
| 1265 | BuiltinOptions_PackOptions, |
| 1266 | BuiltinOptions_LogicalOrOptions, |
| 1267 | BuiltinOptions_OneHotOptions, |
| 1268 | BuiltinOptions_LogicalAndOptions, |
| 1269 | BuiltinOptions_LogicalNotOptions, |
| 1270 | BuiltinOptions_UnpackOptions, |
| 1271 | BuiltinOptions_FloorDivOptions, |
| 1272 | BuiltinOptions_SquareOptions, |
| 1273 | BuiltinOptions_ZerosLikeOptions, |
| 1274 | BuiltinOptions_FillOptions, |
| 1275 | BuiltinOptions_BidirectionalSequenceLSTMOptions, |
| 1276 | BuiltinOptions_BidirectionalSequenceRNNOptions, |
| 1277 | BuiltinOptions_UnidirectionalSequenceLSTMOptions, |
| 1278 | BuiltinOptions_FloorModOptions, |
| 1279 | BuiltinOptions_RangeOptions, |
| 1280 | BuiltinOptions_ResizeNearestNeighborOptions, |
| 1281 | BuiltinOptions_LeakyReluOptions, |
| 1282 | BuiltinOptions_SquaredDifferenceOptions, |
| 1283 | BuiltinOptions_MirrorPadOptions, |
| 1284 | BuiltinOptions_AbsOptions, |
| 1285 | BuiltinOptions_SplitVOptions, |
| 1286 | BuiltinOptions_UniqueOptions, |
| 1287 | BuiltinOptions_ReverseV2Options, |
| 1288 | BuiltinOptions_AddNOptions, |
| 1289 | BuiltinOptions_GatherNdOptions, |
| 1290 | BuiltinOptions_CosOptions, |
| 1291 | BuiltinOptions_WhereOptions, |
| 1292 | BuiltinOptions_RankOptions, |
| 1293 | BuiltinOptions_ReverseSequenceOptions, |
| 1294 | BuiltinOptions_MatrixDiagOptions, |
| 1295 | BuiltinOptions_QuantizeOptions, |
| 1296 | BuiltinOptions_MatrixSetDiagOptions, |
| 1297 | BuiltinOptions_HardSwishOptions, |
| 1298 | BuiltinOptions_IfOptions, |
| 1299 | BuiltinOptions_WhileOptions, |
| 1300 | BuiltinOptions_DepthToSpaceOptions, |
| 1301 | BuiltinOptions_NonMaxSuppressionV4Options, |
| 1302 | BuiltinOptions_NonMaxSuppressionV5Options, |
| 1303 | BuiltinOptions_ScatterNdOptions, |
| 1304 | BuiltinOptions_SelectV2Options, |
| 1305 | BuiltinOptions_DensifyOptions, |
| 1306 | BuiltinOptions_SegmentSumOptions, |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 1307 | BuiltinOptions_BatchMatMulOptions, |
| 1308 | BuiltinOptions_CumsumOptions, |
| 1309 | BuiltinOptions_CallOnceOptions, |
| 1310 | BuiltinOptions_BroadcastToOptions, |
| 1311 | BuiltinOptions_Rfft2dOptions, |
| 1312 | BuiltinOptions_Conv3DOptions, |
| 1313 | BuiltinOptions_HashtableOptions, |
| 1314 | BuiltinOptions_HashtableFindOptions, |
| 1315 | BuiltinOptions_HashtableImportOptions, |
| 1316 | BuiltinOptions_HashtableSizeOptions, |
| 1317 | BuiltinOptions_VarHandleOptions, |
| 1318 | BuiltinOptions_ReadVariableOptions, |
| 1319 | BuiltinOptions_AssignVariableOptions, |
| 1320 | BuiltinOptions_RandomOptions, |
| 1321 | BuiltinOptions_BucketizeOptions, |
| 1322 | BuiltinOptions_GeluOptions |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 1323 | }; |
| 1324 | return values; |
| 1325 | } |
| 1326 | |
| 1327 | inline const char * const *EnumNamesBuiltinOptions() { |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 1328 | static const char * const names[118] = { |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 1329 | "NONE", |
| 1330 | "Conv2DOptions", |
| 1331 | "DepthwiseConv2DOptions", |
| 1332 | "ConcatEmbeddingsOptions", |
| 1333 | "LSHProjectionOptions", |
| 1334 | "Pool2DOptions", |
| 1335 | "SVDFOptions", |
| 1336 | "RNNOptions", |
| 1337 | "FullyConnectedOptions", |
| 1338 | "SoftmaxOptions", |
| 1339 | "ConcatenationOptions", |
| 1340 | "AddOptions", |
| 1341 | "L2NormOptions", |
| 1342 | "LocalResponseNormalizationOptions", |
| 1343 | "LSTMOptions", |
| 1344 | "ResizeBilinearOptions", |
| 1345 | "CallOptions", |
| 1346 | "ReshapeOptions", |
| 1347 | "SkipGramOptions", |
| 1348 | "SpaceToDepthOptions", |
| 1349 | "EmbeddingLookupSparseOptions", |
| 1350 | "MulOptions", |
| 1351 | "PadOptions", |
| 1352 | "GatherOptions", |
| 1353 | "BatchToSpaceNDOptions", |
| 1354 | "SpaceToBatchNDOptions", |
| 1355 | "TransposeOptions", |
| 1356 | "ReducerOptions", |
| 1357 | "SubOptions", |
| 1358 | "DivOptions", |
| 1359 | "SqueezeOptions", |
| 1360 | "SequenceRNNOptions", |
| 1361 | "StridedSliceOptions", |
| 1362 | "ExpOptions", |
| 1363 | "TopKV2Options", |
| 1364 | "SplitOptions", |
| 1365 | "LogSoftmaxOptions", |
| 1366 | "CastOptions", |
| 1367 | "DequantizeOptions", |
| 1368 | "MaximumMinimumOptions", |
| 1369 | "ArgMaxOptions", |
| 1370 | "LessOptions", |
| 1371 | "NegOptions", |
| 1372 | "PadV2Options", |
| 1373 | "GreaterOptions", |
| 1374 | "GreaterEqualOptions", |
| 1375 | "LessEqualOptions", |
| 1376 | "SelectOptions", |
| 1377 | "SliceOptions", |
| 1378 | "TransposeConvOptions", |
| 1379 | "SparseToDenseOptions", |
| 1380 | "TileOptions", |
| 1381 | "ExpandDimsOptions", |
| 1382 | "EqualOptions", |
| 1383 | "NotEqualOptions", |
| 1384 | "ShapeOptions", |
| 1385 | "PowOptions", |
| 1386 | "ArgMinOptions", |
| 1387 | "FakeQuantOptions", |
| 1388 | "PackOptions", |
| 1389 | "LogicalOrOptions", |
| 1390 | "OneHotOptions", |
| 1391 | "LogicalAndOptions", |
| 1392 | "LogicalNotOptions", |
| 1393 | "UnpackOptions", |
| 1394 | "FloorDivOptions", |
| 1395 | "SquareOptions", |
| 1396 | "ZerosLikeOptions", |
| 1397 | "FillOptions", |
| 1398 | "BidirectionalSequenceLSTMOptions", |
| 1399 | "BidirectionalSequenceRNNOptions", |
| 1400 | "UnidirectionalSequenceLSTMOptions", |
| 1401 | "FloorModOptions", |
| 1402 | "RangeOptions", |
| 1403 | "ResizeNearestNeighborOptions", |
| 1404 | "LeakyReluOptions", |
| 1405 | "SquaredDifferenceOptions", |
| 1406 | "MirrorPadOptions", |
| 1407 | "AbsOptions", |
| 1408 | "SplitVOptions", |
| 1409 | "UniqueOptions", |
| 1410 | "ReverseV2Options", |
| 1411 | "AddNOptions", |
| 1412 | "GatherNdOptions", |
| 1413 | "CosOptions", |
| 1414 | "WhereOptions", |
| 1415 | "RankOptions", |
| 1416 | "ReverseSequenceOptions", |
| 1417 | "MatrixDiagOptions", |
| 1418 | "QuantizeOptions", |
| 1419 | "MatrixSetDiagOptions", |
| 1420 | "HardSwishOptions", |
| 1421 | "IfOptions", |
| 1422 | "WhileOptions", |
| 1423 | "DepthToSpaceOptions", |
| 1424 | "NonMaxSuppressionV4Options", |
| 1425 | "NonMaxSuppressionV5Options", |
| 1426 | "ScatterNdOptions", |
| 1427 | "SelectV2Options", |
| 1428 | "DensifyOptions", |
| 1429 | "SegmentSumOptions", |
| 1430 | "BatchMatMulOptions", |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 1431 | "CumsumOptions", |
| 1432 | "CallOnceOptions", |
| 1433 | "BroadcastToOptions", |
| 1434 | "Rfft2dOptions", |
| 1435 | "Conv3DOptions", |
| 1436 | "HashtableOptions", |
| 1437 | "HashtableFindOptions", |
| 1438 | "HashtableImportOptions", |
| 1439 | "HashtableSizeOptions", |
| 1440 | "VarHandleOptions", |
| 1441 | "ReadVariableOptions", |
| 1442 | "AssignVariableOptions", |
| 1443 | "RandomOptions", |
| 1444 | "BucketizeOptions", |
| 1445 | "GeluOptions", |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 1446 | nullptr |
| 1447 | }; |
| 1448 | return names; |
| 1449 | } |
| 1450 | |
| 1451 | inline const char *EnumNameBuiltinOptions(BuiltinOptions e) { |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 1452 | if (flatbuffers::IsOutRange(e, BuiltinOptions_NONE, BuiltinOptions_GeluOptions)) return ""; |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 1453 | const size_t index = static_cast<size_t>(e); |
| 1454 | return EnumNamesBuiltinOptions()[index]; |
| 1455 | } |
| 1456 | |
| 1457 | template<typename T> struct BuiltinOptionsTraits { |
| 1458 | static const BuiltinOptions enum_value = BuiltinOptions_NONE; |
| 1459 | }; |
| 1460 | |
| 1461 | template<> struct BuiltinOptionsTraits<tflite::Conv2DOptions> { |
| 1462 | static const BuiltinOptions enum_value = BuiltinOptions_Conv2DOptions; |
| 1463 | }; |
| 1464 | |
| 1465 | template<> struct BuiltinOptionsTraits<tflite::DepthwiseConv2DOptions> { |
| 1466 | static const BuiltinOptions enum_value = BuiltinOptions_DepthwiseConv2DOptions; |
| 1467 | }; |
| 1468 | |
| 1469 | template<> struct BuiltinOptionsTraits<tflite::ConcatEmbeddingsOptions> { |
| 1470 | static const BuiltinOptions enum_value = BuiltinOptions_ConcatEmbeddingsOptions; |
| 1471 | }; |
| 1472 | |
| 1473 | template<> struct BuiltinOptionsTraits<tflite::LSHProjectionOptions> { |
| 1474 | static const BuiltinOptions enum_value = BuiltinOptions_LSHProjectionOptions; |
| 1475 | }; |
| 1476 | |
| 1477 | template<> struct BuiltinOptionsTraits<tflite::Pool2DOptions> { |
| 1478 | static const BuiltinOptions enum_value = BuiltinOptions_Pool2DOptions; |
| 1479 | }; |
| 1480 | |
| 1481 | template<> struct BuiltinOptionsTraits<tflite::SVDFOptions> { |
| 1482 | static const BuiltinOptions enum_value = BuiltinOptions_SVDFOptions; |
| 1483 | }; |
| 1484 | |
| 1485 | template<> struct BuiltinOptionsTraits<tflite::RNNOptions> { |
| 1486 | static const BuiltinOptions enum_value = BuiltinOptions_RNNOptions; |
| 1487 | }; |
| 1488 | |
| 1489 | template<> struct BuiltinOptionsTraits<tflite::FullyConnectedOptions> { |
| 1490 | static const BuiltinOptions enum_value = BuiltinOptions_FullyConnectedOptions; |
| 1491 | }; |
| 1492 | |
| 1493 | template<> struct BuiltinOptionsTraits<tflite::SoftmaxOptions> { |
| 1494 | static const BuiltinOptions enum_value = BuiltinOptions_SoftmaxOptions; |
| 1495 | }; |
| 1496 | |
| 1497 | template<> struct BuiltinOptionsTraits<tflite::ConcatenationOptions> { |
| 1498 | static const BuiltinOptions enum_value = BuiltinOptions_ConcatenationOptions; |
| 1499 | }; |
| 1500 | |
| 1501 | template<> struct BuiltinOptionsTraits<tflite::AddOptions> { |
| 1502 | static const BuiltinOptions enum_value = BuiltinOptions_AddOptions; |
| 1503 | }; |
| 1504 | |
| 1505 | template<> struct BuiltinOptionsTraits<tflite::L2NormOptions> { |
| 1506 | static const BuiltinOptions enum_value = BuiltinOptions_L2NormOptions; |
| 1507 | }; |
| 1508 | |
| 1509 | template<> struct BuiltinOptionsTraits<tflite::LocalResponseNormalizationOptions> { |
| 1510 | static const BuiltinOptions enum_value = BuiltinOptions_LocalResponseNormalizationOptions; |
| 1511 | }; |
| 1512 | |
| 1513 | template<> struct BuiltinOptionsTraits<tflite::LSTMOptions> { |
| 1514 | static const BuiltinOptions enum_value = BuiltinOptions_LSTMOptions; |
| 1515 | }; |
| 1516 | |
| 1517 | template<> struct BuiltinOptionsTraits<tflite::ResizeBilinearOptions> { |
| 1518 | static const BuiltinOptions enum_value = BuiltinOptions_ResizeBilinearOptions; |
| 1519 | }; |
| 1520 | |
| 1521 | template<> struct BuiltinOptionsTraits<tflite::CallOptions> { |
| 1522 | static const BuiltinOptions enum_value = BuiltinOptions_CallOptions; |
| 1523 | }; |
| 1524 | |
| 1525 | template<> struct BuiltinOptionsTraits<tflite::ReshapeOptions> { |
| 1526 | static const BuiltinOptions enum_value = BuiltinOptions_ReshapeOptions; |
| 1527 | }; |
| 1528 | |
| 1529 | template<> struct BuiltinOptionsTraits<tflite::SkipGramOptions> { |
| 1530 | static const BuiltinOptions enum_value = BuiltinOptions_SkipGramOptions; |
| 1531 | }; |
| 1532 | |
| 1533 | template<> struct BuiltinOptionsTraits<tflite::SpaceToDepthOptions> { |
| 1534 | static const BuiltinOptions enum_value = BuiltinOptions_SpaceToDepthOptions; |
| 1535 | }; |
| 1536 | |
| 1537 | template<> struct BuiltinOptionsTraits<tflite::EmbeddingLookupSparseOptions> { |
| 1538 | static const BuiltinOptions enum_value = BuiltinOptions_EmbeddingLookupSparseOptions; |
| 1539 | }; |
| 1540 | |
| 1541 | template<> struct BuiltinOptionsTraits<tflite::MulOptions> { |
| 1542 | static const BuiltinOptions enum_value = BuiltinOptions_MulOptions; |
| 1543 | }; |
| 1544 | |
| 1545 | template<> struct BuiltinOptionsTraits<tflite::PadOptions> { |
| 1546 | static const BuiltinOptions enum_value = BuiltinOptions_PadOptions; |
| 1547 | }; |
| 1548 | |
| 1549 | template<> struct BuiltinOptionsTraits<tflite::GatherOptions> { |
| 1550 | static const BuiltinOptions enum_value = BuiltinOptions_GatherOptions; |
| 1551 | }; |
| 1552 | |
| 1553 | template<> struct BuiltinOptionsTraits<tflite::BatchToSpaceNDOptions> { |
| 1554 | static const BuiltinOptions enum_value = BuiltinOptions_BatchToSpaceNDOptions; |
| 1555 | }; |
| 1556 | |
| 1557 | template<> struct BuiltinOptionsTraits<tflite::SpaceToBatchNDOptions> { |
| 1558 | static const BuiltinOptions enum_value = BuiltinOptions_SpaceToBatchNDOptions; |
| 1559 | }; |
| 1560 | |
| 1561 | template<> struct BuiltinOptionsTraits<tflite::TransposeOptions> { |
| 1562 | static const BuiltinOptions enum_value = BuiltinOptions_TransposeOptions; |
| 1563 | }; |
| 1564 | |
| 1565 | template<> struct BuiltinOptionsTraits<tflite::ReducerOptions> { |
| 1566 | static const BuiltinOptions enum_value = BuiltinOptions_ReducerOptions; |
| 1567 | }; |
| 1568 | |
| 1569 | template<> struct BuiltinOptionsTraits<tflite::SubOptions> { |
| 1570 | static const BuiltinOptions enum_value = BuiltinOptions_SubOptions; |
| 1571 | }; |
| 1572 | |
| 1573 | template<> struct BuiltinOptionsTraits<tflite::DivOptions> { |
| 1574 | static const BuiltinOptions enum_value = BuiltinOptions_DivOptions; |
| 1575 | }; |
| 1576 | |
| 1577 | template<> struct BuiltinOptionsTraits<tflite::SqueezeOptions> { |
| 1578 | static const BuiltinOptions enum_value = BuiltinOptions_SqueezeOptions; |
| 1579 | }; |
| 1580 | |
| 1581 | template<> struct BuiltinOptionsTraits<tflite::SequenceRNNOptions> { |
| 1582 | static const BuiltinOptions enum_value = BuiltinOptions_SequenceRNNOptions; |
| 1583 | }; |
| 1584 | |
| 1585 | template<> struct BuiltinOptionsTraits<tflite::StridedSliceOptions> { |
| 1586 | static const BuiltinOptions enum_value = BuiltinOptions_StridedSliceOptions; |
| 1587 | }; |
| 1588 | |
| 1589 | template<> struct BuiltinOptionsTraits<tflite::ExpOptions> { |
| 1590 | static const BuiltinOptions enum_value = BuiltinOptions_ExpOptions; |
| 1591 | }; |
| 1592 | |
| 1593 | template<> struct BuiltinOptionsTraits<tflite::TopKV2Options> { |
| 1594 | static const BuiltinOptions enum_value = BuiltinOptions_TopKV2Options; |
| 1595 | }; |
| 1596 | |
| 1597 | template<> struct BuiltinOptionsTraits<tflite::SplitOptions> { |
| 1598 | static const BuiltinOptions enum_value = BuiltinOptions_SplitOptions; |
| 1599 | }; |
| 1600 | |
| 1601 | template<> struct BuiltinOptionsTraits<tflite::LogSoftmaxOptions> { |
| 1602 | static const BuiltinOptions enum_value = BuiltinOptions_LogSoftmaxOptions; |
| 1603 | }; |
| 1604 | |
| 1605 | template<> struct BuiltinOptionsTraits<tflite::CastOptions> { |
| 1606 | static const BuiltinOptions enum_value = BuiltinOptions_CastOptions; |
| 1607 | }; |
| 1608 | |
| 1609 | template<> struct BuiltinOptionsTraits<tflite::DequantizeOptions> { |
| 1610 | static const BuiltinOptions enum_value = BuiltinOptions_DequantizeOptions; |
| 1611 | }; |
| 1612 | |
| 1613 | template<> struct BuiltinOptionsTraits<tflite::MaximumMinimumOptions> { |
| 1614 | static const BuiltinOptions enum_value = BuiltinOptions_MaximumMinimumOptions; |
| 1615 | }; |
| 1616 | |
| 1617 | template<> struct BuiltinOptionsTraits<tflite::ArgMaxOptions> { |
| 1618 | static const BuiltinOptions enum_value = BuiltinOptions_ArgMaxOptions; |
| 1619 | }; |
| 1620 | |
| 1621 | template<> struct BuiltinOptionsTraits<tflite::LessOptions> { |
| 1622 | static const BuiltinOptions enum_value = BuiltinOptions_LessOptions; |
| 1623 | }; |
| 1624 | |
| 1625 | template<> struct BuiltinOptionsTraits<tflite::NegOptions> { |
| 1626 | static const BuiltinOptions enum_value = BuiltinOptions_NegOptions; |
| 1627 | }; |
| 1628 | |
| 1629 | template<> struct BuiltinOptionsTraits<tflite::PadV2Options> { |
| 1630 | static const BuiltinOptions enum_value = BuiltinOptions_PadV2Options; |
| 1631 | }; |
| 1632 | |
| 1633 | template<> struct BuiltinOptionsTraits<tflite::GreaterOptions> { |
| 1634 | static const BuiltinOptions enum_value = BuiltinOptions_GreaterOptions; |
| 1635 | }; |
| 1636 | |
| 1637 | template<> struct BuiltinOptionsTraits<tflite::GreaterEqualOptions> { |
| 1638 | static const BuiltinOptions enum_value = BuiltinOptions_GreaterEqualOptions; |
| 1639 | }; |
| 1640 | |
| 1641 | template<> struct BuiltinOptionsTraits<tflite::LessEqualOptions> { |
| 1642 | static const BuiltinOptions enum_value = BuiltinOptions_LessEqualOptions; |
| 1643 | }; |
| 1644 | |
| 1645 | template<> struct BuiltinOptionsTraits<tflite::SelectOptions> { |
| 1646 | static const BuiltinOptions enum_value = BuiltinOptions_SelectOptions; |
| 1647 | }; |
| 1648 | |
| 1649 | template<> struct BuiltinOptionsTraits<tflite::SliceOptions> { |
| 1650 | static const BuiltinOptions enum_value = BuiltinOptions_SliceOptions; |
| 1651 | }; |
| 1652 | |
| 1653 | template<> struct BuiltinOptionsTraits<tflite::TransposeConvOptions> { |
| 1654 | static const BuiltinOptions enum_value = BuiltinOptions_TransposeConvOptions; |
| 1655 | }; |
| 1656 | |
| 1657 | template<> struct BuiltinOptionsTraits<tflite::SparseToDenseOptions> { |
| 1658 | static const BuiltinOptions enum_value = BuiltinOptions_SparseToDenseOptions; |
| 1659 | }; |
| 1660 | |
| 1661 | template<> struct BuiltinOptionsTraits<tflite::TileOptions> { |
| 1662 | static const BuiltinOptions enum_value = BuiltinOptions_TileOptions; |
| 1663 | }; |
| 1664 | |
| 1665 | template<> struct BuiltinOptionsTraits<tflite::ExpandDimsOptions> { |
| 1666 | static const BuiltinOptions enum_value = BuiltinOptions_ExpandDimsOptions; |
| 1667 | }; |
| 1668 | |
| 1669 | template<> struct BuiltinOptionsTraits<tflite::EqualOptions> { |
| 1670 | static const BuiltinOptions enum_value = BuiltinOptions_EqualOptions; |
| 1671 | }; |
| 1672 | |
| 1673 | template<> struct BuiltinOptionsTraits<tflite::NotEqualOptions> { |
| 1674 | static const BuiltinOptions enum_value = BuiltinOptions_NotEqualOptions; |
| 1675 | }; |
| 1676 | |
| 1677 | template<> struct BuiltinOptionsTraits<tflite::ShapeOptions> { |
| 1678 | static const BuiltinOptions enum_value = BuiltinOptions_ShapeOptions; |
| 1679 | }; |
| 1680 | |
| 1681 | template<> struct BuiltinOptionsTraits<tflite::PowOptions> { |
| 1682 | static const BuiltinOptions enum_value = BuiltinOptions_PowOptions; |
| 1683 | }; |
| 1684 | |
| 1685 | template<> struct BuiltinOptionsTraits<tflite::ArgMinOptions> { |
| 1686 | static const BuiltinOptions enum_value = BuiltinOptions_ArgMinOptions; |
| 1687 | }; |
| 1688 | |
| 1689 | template<> struct BuiltinOptionsTraits<tflite::FakeQuantOptions> { |
| 1690 | static const BuiltinOptions enum_value = BuiltinOptions_FakeQuantOptions; |
| 1691 | }; |
| 1692 | |
| 1693 | template<> struct BuiltinOptionsTraits<tflite::PackOptions> { |
| 1694 | static const BuiltinOptions enum_value = BuiltinOptions_PackOptions; |
| 1695 | }; |
| 1696 | |
| 1697 | template<> struct BuiltinOptionsTraits<tflite::LogicalOrOptions> { |
| 1698 | static const BuiltinOptions enum_value = BuiltinOptions_LogicalOrOptions; |
| 1699 | }; |
| 1700 | |
| 1701 | template<> struct BuiltinOptionsTraits<tflite::OneHotOptions> { |
| 1702 | static const BuiltinOptions enum_value = BuiltinOptions_OneHotOptions; |
| 1703 | }; |
| 1704 | |
| 1705 | template<> struct BuiltinOptionsTraits<tflite::LogicalAndOptions> { |
| 1706 | static const BuiltinOptions enum_value = BuiltinOptions_LogicalAndOptions; |
| 1707 | }; |
| 1708 | |
| 1709 | template<> struct BuiltinOptionsTraits<tflite::LogicalNotOptions> { |
| 1710 | static const BuiltinOptions enum_value = BuiltinOptions_LogicalNotOptions; |
| 1711 | }; |
| 1712 | |
| 1713 | template<> struct BuiltinOptionsTraits<tflite::UnpackOptions> { |
| 1714 | static const BuiltinOptions enum_value = BuiltinOptions_UnpackOptions; |
| 1715 | }; |
| 1716 | |
| 1717 | template<> struct BuiltinOptionsTraits<tflite::FloorDivOptions> { |
| 1718 | static const BuiltinOptions enum_value = BuiltinOptions_FloorDivOptions; |
| 1719 | }; |
| 1720 | |
| 1721 | template<> struct BuiltinOptionsTraits<tflite::SquareOptions> { |
| 1722 | static const BuiltinOptions enum_value = BuiltinOptions_SquareOptions; |
| 1723 | }; |
| 1724 | |
| 1725 | template<> struct BuiltinOptionsTraits<tflite::ZerosLikeOptions> { |
| 1726 | static const BuiltinOptions enum_value = BuiltinOptions_ZerosLikeOptions; |
| 1727 | }; |
| 1728 | |
| 1729 | template<> struct BuiltinOptionsTraits<tflite::FillOptions> { |
| 1730 | static const BuiltinOptions enum_value = BuiltinOptions_FillOptions; |
| 1731 | }; |
| 1732 | |
| 1733 | template<> struct BuiltinOptionsTraits<tflite::BidirectionalSequenceLSTMOptions> { |
| 1734 | static const BuiltinOptions enum_value = BuiltinOptions_BidirectionalSequenceLSTMOptions; |
| 1735 | }; |
| 1736 | |
| 1737 | template<> struct BuiltinOptionsTraits<tflite::BidirectionalSequenceRNNOptions> { |
| 1738 | static const BuiltinOptions enum_value = BuiltinOptions_BidirectionalSequenceRNNOptions; |
| 1739 | }; |
| 1740 | |
| 1741 | template<> struct BuiltinOptionsTraits<tflite::UnidirectionalSequenceLSTMOptions> { |
| 1742 | static const BuiltinOptions enum_value = BuiltinOptions_UnidirectionalSequenceLSTMOptions; |
| 1743 | }; |
| 1744 | |
| 1745 | template<> struct BuiltinOptionsTraits<tflite::FloorModOptions> { |
| 1746 | static const BuiltinOptions enum_value = BuiltinOptions_FloorModOptions; |
| 1747 | }; |
| 1748 | |
| 1749 | template<> struct BuiltinOptionsTraits<tflite::RangeOptions> { |
| 1750 | static const BuiltinOptions enum_value = BuiltinOptions_RangeOptions; |
| 1751 | }; |
| 1752 | |
| 1753 | template<> struct BuiltinOptionsTraits<tflite::ResizeNearestNeighborOptions> { |
| 1754 | static const BuiltinOptions enum_value = BuiltinOptions_ResizeNearestNeighborOptions; |
| 1755 | }; |
| 1756 | |
| 1757 | template<> struct BuiltinOptionsTraits<tflite::LeakyReluOptions> { |
| 1758 | static const BuiltinOptions enum_value = BuiltinOptions_LeakyReluOptions; |
| 1759 | }; |
| 1760 | |
| 1761 | template<> struct BuiltinOptionsTraits<tflite::SquaredDifferenceOptions> { |
| 1762 | static const BuiltinOptions enum_value = BuiltinOptions_SquaredDifferenceOptions; |
| 1763 | }; |
| 1764 | |
| 1765 | template<> struct BuiltinOptionsTraits<tflite::MirrorPadOptions> { |
| 1766 | static const BuiltinOptions enum_value = BuiltinOptions_MirrorPadOptions; |
| 1767 | }; |
| 1768 | |
| 1769 | template<> struct BuiltinOptionsTraits<tflite::AbsOptions> { |
| 1770 | static const BuiltinOptions enum_value = BuiltinOptions_AbsOptions; |
| 1771 | }; |
| 1772 | |
| 1773 | template<> struct BuiltinOptionsTraits<tflite::SplitVOptions> { |
| 1774 | static const BuiltinOptions enum_value = BuiltinOptions_SplitVOptions; |
| 1775 | }; |
| 1776 | |
| 1777 | template<> struct BuiltinOptionsTraits<tflite::UniqueOptions> { |
| 1778 | static const BuiltinOptions enum_value = BuiltinOptions_UniqueOptions; |
| 1779 | }; |
| 1780 | |
| 1781 | template<> struct BuiltinOptionsTraits<tflite::ReverseV2Options> { |
| 1782 | static const BuiltinOptions enum_value = BuiltinOptions_ReverseV2Options; |
| 1783 | }; |
| 1784 | |
| 1785 | template<> struct BuiltinOptionsTraits<tflite::AddNOptions> { |
| 1786 | static const BuiltinOptions enum_value = BuiltinOptions_AddNOptions; |
| 1787 | }; |
| 1788 | |
| 1789 | template<> struct BuiltinOptionsTraits<tflite::GatherNdOptions> { |
| 1790 | static const BuiltinOptions enum_value = BuiltinOptions_GatherNdOptions; |
| 1791 | }; |
| 1792 | |
| 1793 | template<> struct BuiltinOptionsTraits<tflite::CosOptions> { |
| 1794 | static const BuiltinOptions enum_value = BuiltinOptions_CosOptions; |
| 1795 | }; |
| 1796 | |
| 1797 | template<> struct BuiltinOptionsTraits<tflite::WhereOptions> { |
| 1798 | static const BuiltinOptions enum_value = BuiltinOptions_WhereOptions; |
| 1799 | }; |
| 1800 | |
| 1801 | template<> struct BuiltinOptionsTraits<tflite::RankOptions> { |
| 1802 | static const BuiltinOptions enum_value = BuiltinOptions_RankOptions; |
| 1803 | }; |
| 1804 | |
| 1805 | template<> struct BuiltinOptionsTraits<tflite::ReverseSequenceOptions> { |
| 1806 | static const BuiltinOptions enum_value = BuiltinOptions_ReverseSequenceOptions; |
| 1807 | }; |
| 1808 | |
| 1809 | template<> struct BuiltinOptionsTraits<tflite::MatrixDiagOptions> { |
| 1810 | static const BuiltinOptions enum_value = BuiltinOptions_MatrixDiagOptions; |
| 1811 | }; |
| 1812 | |
| 1813 | template<> struct BuiltinOptionsTraits<tflite::QuantizeOptions> { |
| 1814 | static const BuiltinOptions enum_value = BuiltinOptions_QuantizeOptions; |
| 1815 | }; |
| 1816 | |
| 1817 | template<> struct BuiltinOptionsTraits<tflite::MatrixSetDiagOptions> { |
| 1818 | static const BuiltinOptions enum_value = BuiltinOptions_MatrixSetDiagOptions; |
| 1819 | }; |
| 1820 | |
| 1821 | template<> struct BuiltinOptionsTraits<tflite::HardSwishOptions> { |
| 1822 | static const BuiltinOptions enum_value = BuiltinOptions_HardSwishOptions; |
| 1823 | }; |
| 1824 | |
| 1825 | template<> struct BuiltinOptionsTraits<tflite::IfOptions> { |
| 1826 | static const BuiltinOptions enum_value = BuiltinOptions_IfOptions; |
| 1827 | }; |
| 1828 | |
| 1829 | template<> struct BuiltinOptionsTraits<tflite::WhileOptions> { |
| 1830 | static const BuiltinOptions enum_value = BuiltinOptions_WhileOptions; |
| 1831 | }; |
| 1832 | |
| 1833 | template<> struct BuiltinOptionsTraits<tflite::DepthToSpaceOptions> { |
| 1834 | static const BuiltinOptions enum_value = BuiltinOptions_DepthToSpaceOptions; |
| 1835 | }; |
| 1836 | |
| 1837 | template<> struct BuiltinOptionsTraits<tflite::NonMaxSuppressionV4Options> { |
| 1838 | static const BuiltinOptions enum_value = BuiltinOptions_NonMaxSuppressionV4Options; |
| 1839 | }; |
| 1840 | |
| 1841 | template<> struct BuiltinOptionsTraits<tflite::NonMaxSuppressionV5Options> { |
| 1842 | static const BuiltinOptions enum_value = BuiltinOptions_NonMaxSuppressionV5Options; |
| 1843 | }; |
| 1844 | |
| 1845 | template<> struct BuiltinOptionsTraits<tflite::ScatterNdOptions> { |
| 1846 | static const BuiltinOptions enum_value = BuiltinOptions_ScatterNdOptions; |
| 1847 | }; |
| 1848 | |
| 1849 | template<> struct BuiltinOptionsTraits<tflite::SelectV2Options> { |
| 1850 | static const BuiltinOptions enum_value = BuiltinOptions_SelectV2Options; |
| 1851 | }; |
| 1852 | |
| 1853 | template<> struct BuiltinOptionsTraits<tflite::DensifyOptions> { |
| 1854 | static const BuiltinOptions enum_value = BuiltinOptions_DensifyOptions; |
| 1855 | }; |
| 1856 | |
| 1857 | template<> struct BuiltinOptionsTraits<tflite::SegmentSumOptions> { |
| 1858 | static const BuiltinOptions enum_value = BuiltinOptions_SegmentSumOptions; |
| 1859 | }; |
| 1860 | |
| 1861 | template<> struct BuiltinOptionsTraits<tflite::BatchMatMulOptions> { |
| 1862 | static const BuiltinOptions enum_value = BuiltinOptions_BatchMatMulOptions; |
| 1863 | }; |
| 1864 | |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 1865 | template<> struct BuiltinOptionsTraits<tflite::CumsumOptions> { |
| 1866 | static const BuiltinOptions enum_value = BuiltinOptions_CumsumOptions; |
| 1867 | }; |
| 1868 | |
| 1869 | template<> struct BuiltinOptionsTraits<tflite::CallOnceOptions> { |
| 1870 | static const BuiltinOptions enum_value = BuiltinOptions_CallOnceOptions; |
| 1871 | }; |
| 1872 | |
| 1873 | template<> struct BuiltinOptionsTraits<tflite::BroadcastToOptions> { |
| 1874 | static const BuiltinOptions enum_value = BuiltinOptions_BroadcastToOptions; |
| 1875 | }; |
| 1876 | |
| 1877 | template<> struct BuiltinOptionsTraits<tflite::Rfft2dOptions> { |
| 1878 | static const BuiltinOptions enum_value = BuiltinOptions_Rfft2dOptions; |
| 1879 | }; |
| 1880 | |
| 1881 | template<> struct BuiltinOptionsTraits<tflite::Conv3DOptions> { |
| 1882 | static const BuiltinOptions enum_value = BuiltinOptions_Conv3DOptions; |
| 1883 | }; |
| 1884 | |
| 1885 | template<> struct BuiltinOptionsTraits<tflite::HashtableOptions> { |
| 1886 | static const BuiltinOptions enum_value = BuiltinOptions_HashtableOptions; |
| 1887 | }; |
| 1888 | |
| 1889 | template<> struct BuiltinOptionsTraits<tflite::HashtableFindOptions> { |
| 1890 | static const BuiltinOptions enum_value = BuiltinOptions_HashtableFindOptions; |
| 1891 | }; |
| 1892 | |
| 1893 | template<> struct BuiltinOptionsTraits<tflite::HashtableImportOptions> { |
| 1894 | static const BuiltinOptions enum_value = BuiltinOptions_HashtableImportOptions; |
| 1895 | }; |
| 1896 | |
| 1897 | template<> struct BuiltinOptionsTraits<tflite::HashtableSizeOptions> { |
| 1898 | static const BuiltinOptions enum_value = BuiltinOptions_HashtableSizeOptions; |
| 1899 | }; |
| 1900 | |
| 1901 | template<> struct BuiltinOptionsTraits<tflite::VarHandleOptions> { |
| 1902 | static const BuiltinOptions enum_value = BuiltinOptions_VarHandleOptions; |
| 1903 | }; |
| 1904 | |
| 1905 | template<> struct BuiltinOptionsTraits<tflite::ReadVariableOptions> { |
| 1906 | static const BuiltinOptions enum_value = BuiltinOptions_ReadVariableOptions; |
| 1907 | }; |
| 1908 | |
| 1909 | template<> struct BuiltinOptionsTraits<tflite::AssignVariableOptions> { |
| 1910 | static const BuiltinOptions enum_value = BuiltinOptions_AssignVariableOptions; |
| 1911 | }; |
| 1912 | |
| 1913 | template<> struct BuiltinOptionsTraits<tflite::RandomOptions> { |
| 1914 | static const BuiltinOptions enum_value = BuiltinOptions_RandomOptions; |
| 1915 | }; |
| 1916 | |
| 1917 | template<> struct BuiltinOptionsTraits<tflite::BucketizeOptions> { |
| 1918 | static const BuiltinOptions enum_value = BuiltinOptions_BucketizeOptions; |
| 1919 | }; |
| 1920 | |
| 1921 | template<> struct BuiltinOptionsTraits<tflite::GeluOptions> { |
| 1922 | static const BuiltinOptions enum_value = BuiltinOptions_GeluOptions; |
| 1923 | }; |
| 1924 | |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 1925 | bool VerifyBuiltinOptions(flatbuffers::Verifier &verifier, const void *obj, BuiltinOptions type); |
| 1926 | bool VerifyBuiltinOptionsVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector<flatbuffers::Offset<void>> *values, const flatbuffers::Vector<uint8_t> *types); |
| 1927 | |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 1928 | enum Padding : int8_t { |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 1929 | Padding_SAME = 0, |
| 1930 | Padding_VALID = 1, |
| 1931 | Padding_MIN = Padding_SAME, |
| 1932 | Padding_MAX = Padding_VALID |
| 1933 | }; |
| 1934 | |
| 1935 | inline const Padding (&EnumValuesPadding())[2] { |
| 1936 | static const Padding values[] = { |
| 1937 | Padding_SAME, |
| 1938 | Padding_VALID |
| 1939 | }; |
| 1940 | return values; |
| 1941 | } |
| 1942 | |
| 1943 | inline const char * const *EnumNamesPadding() { |
| 1944 | static const char * const names[3] = { |
| 1945 | "SAME", |
| 1946 | "VALID", |
| 1947 | nullptr |
| 1948 | }; |
| 1949 | return names; |
| 1950 | } |
| 1951 | |
| 1952 | inline const char *EnumNamePadding(Padding e) { |
| 1953 | if (flatbuffers::IsOutRange(e, Padding_SAME, Padding_VALID)) return ""; |
| 1954 | const size_t index = static_cast<size_t>(e); |
| 1955 | return EnumNamesPadding()[index]; |
| 1956 | } |
| 1957 | |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 1958 | enum ActivationFunctionType : int8_t { |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 1959 | ActivationFunctionType_NONE = 0, |
| 1960 | ActivationFunctionType_RELU = 1, |
| 1961 | ActivationFunctionType_RELU_N1_TO_1 = 2, |
| 1962 | ActivationFunctionType_RELU6 = 3, |
| 1963 | ActivationFunctionType_TANH = 4, |
| 1964 | ActivationFunctionType_SIGN_BIT = 5, |
| 1965 | ActivationFunctionType_MIN = ActivationFunctionType_NONE, |
| 1966 | ActivationFunctionType_MAX = ActivationFunctionType_SIGN_BIT |
| 1967 | }; |
| 1968 | |
| 1969 | inline const ActivationFunctionType (&EnumValuesActivationFunctionType())[6] { |
| 1970 | static const ActivationFunctionType values[] = { |
| 1971 | ActivationFunctionType_NONE, |
| 1972 | ActivationFunctionType_RELU, |
| 1973 | ActivationFunctionType_RELU_N1_TO_1, |
| 1974 | ActivationFunctionType_RELU6, |
| 1975 | ActivationFunctionType_TANH, |
| 1976 | ActivationFunctionType_SIGN_BIT |
| 1977 | }; |
| 1978 | return values; |
| 1979 | } |
| 1980 | |
| 1981 | inline const char * const *EnumNamesActivationFunctionType() { |
| 1982 | static const char * const names[7] = { |
| 1983 | "NONE", |
| 1984 | "RELU", |
| 1985 | "RELU_N1_TO_1", |
| 1986 | "RELU6", |
| 1987 | "TANH", |
| 1988 | "SIGN_BIT", |
| 1989 | nullptr |
| 1990 | }; |
| 1991 | return names; |
| 1992 | } |
| 1993 | |
| 1994 | inline const char *EnumNameActivationFunctionType(ActivationFunctionType e) { |
| 1995 | if (flatbuffers::IsOutRange(e, ActivationFunctionType_NONE, ActivationFunctionType_SIGN_BIT)) return ""; |
| 1996 | const size_t index = static_cast<size_t>(e); |
| 1997 | return EnumNamesActivationFunctionType()[index]; |
| 1998 | } |
| 1999 | |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 2000 | enum LSHProjectionType : int8_t { |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 2001 | LSHProjectionType_UNKNOWN = 0, |
| 2002 | LSHProjectionType_SPARSE = 1, |
| 2003 | LSHProjectionType_DENSE = 2, |
| 2004 | LSHProjectionType_MIN = LSHProjectionType_UNKNOWN, |
| 2005 | LSHProjectionType_MAX = LSHProjectionType_DENSE |
| 2006 | }; |
| 2007 | |
| 2008 | inline const LSHProjectionType (&EnumValuesLSHProjectionType())[3] { |
| 2009 | static const LSHProjectionType values[] = { |
| 2010 | LSHProjectionType_UNKNOWN, |
| 2011 | LSHProjectionType_SPARSE, |
| 2012 | LSHProjectionType_DENSE |
| 2013 | }; |
| 2014 | return values; |
| 2015 | } |
| 2016 | |
| 2017 | inline const char * const *EnumNamesLSHProjectionType() { |
| 2018 | static const char * const names[4] = { |
| 2019 | "UNKNOWN", |
| 2020 | "SPARSE", |
| 2021 | "DENSE", |
| 2022 | nullptr |
| 2023 | }; |
| 2024 | return names; |
| 2025 | } |
| 2026 | |
| 2027 | inline const char *EnumNameLSHProjectionType(LSHProjectionType e) { |
| 2028 | if (flatbuffers::IsOutRange(e, LSHProjectionType_UNKNOWN, LSHProjectionType_DENSE)) return ""; |
| 2029 | const size_t index = static_cast<size_t>(e); |
| 2030 | return EnumNamesLSHProjectionType()[index]; |
| 2031 | } |
| 2032 | |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 2033 | enum FullyConnectedOptionsWeightsFormat : int8_t { |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 2034 | FullyConnectedOptionsWeightsFormat_DEFAULT = 0, |
| 2035 | FullyConnectedOptionsWeightsFormat_SHUFFLED4x16INT8 = 1, |
| 2036 | FullyConnectedOptionsWeightsFormat_MIN = FullyConnectedOptionsWeightsFormat_DEFAULT, |
| 2037 | FullyConnectedOptionsWeightsFormat_MAX = FullyConnectedOptionsWeightsFormat_SHUFFLED4x16INT8 |
| 2038 | }; |
| 2039 | |
| 2040 | inline const FullyConnectedOptionsWeightsFormat (&EnumValuesFullyConnectedOptionsWeightsFormat())[2] { |
| 2041 | static const FullyConnectedOptionsWeightsFormat values[] = { |
| 2042 | FullyConnectedOptionsWeightsFormat_DEFAULT, |
| 2043 | FullyConnectedOptionsWeightsFormat_SHUFFLED4x16INT8 |
| 2044 | }; |
| 2045 | return values; |
| 2046 | } |
| 2047 | |
| 2048 | inline const char * const *EnumNamesFullyConnectedOptionsWeightsFormat() { |
| 2049 | static const char * const names[3] = { |
| 2050 | "DEFAULT", |
| 2051 | "SHUFFLED4x16INT8", |
| 2052 | nullptr |
| 2053 | }; |
| 2054 | return names; |
| 2055 | } |
| 2056 | |
| 2057 | inline const char *EnumNameFullyConnectedOptionsWeightsFormat(FullyConnectedOptionsWeightsFormat e) { |
| 2058 | if (flatbuffers::IsOutRange(e, FullyConnectedOptionsWeightsFormat_DEFAULT, FullyConnectedOptionsWeightsFormat_SHUFFLED4x16INT8)) return ""; |
| 2059 | const size_t index = static_cast<size_t>(e); |
| 2060 | return EnumNamesFullyConnectedOptionsWeightsFormat()[index]; |
| 2061 | } |
| 2062 | |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 2063 | enum LSTMKernelType : int8_t { |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 2064 | LSTMKernelType_FULL = 0, |
| 2065 | LSTMKernelType_BASIC = 1, |
| 2066 | LSTMKernelType_MIN = LSTMKernelType_FULL, |
| 2067 | LSTMKernelType_MAX = LSTMKernelType_BASIC |
| 2068 | }; |
| 2069 | |
| 2070 | inline const LSTMKernelType (&EnumValuesLSTMKernelType())[2] { |
| 2071 | static const LSTMKernelType values[] = { |
| 2072 | LSTMKernelType_FULL, |
| 2073 | LSTMKernelType_BASIC |
| 2074 | }; |
| 2075 | return values; |
| 2076 | } |
| 2077 | |
| 2078 | inline const char * const *EnumNamesLSTMKernelType() { |
| 2079 | static const char * const names[3] = { |
| 2080 | "FULL", |
| 2081 | "BASIC", |
| 2082 | nullptr |
| 2083 | }; |
| 2084 | return names; |
| 2085 | } |
| 2086 | |
| 2087 | inline const char *EnumNameLSTMKernelType(LSTMKernelType e) { |
| 2088 | if (flatbuffers::IsOutRange(e, LSTMKernelType_FULL, LSTMKernelType_BASIC)) return ""; |
| 2089 | const size_t index = static_cast<size_t>(e); |
| 2090 | return EnumNamesLSTMKernelType()[index]; |
| 2091 | } |
| 2092 | |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 2093 | enum CombinerType : int8_t { |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 2094 | CombinerType_SUM = 0, |
| 2095 | CombinerType_MEAN = 1, |
| 2096 | CombinerType_SQRTN = 2, |
| 2097 | CombinerType_MIN = CombinerType_SUM, |
| 2098 | CombinerType_MAX = CombinerType_SQRTN |
| 2099 | }; |
| 2100 | |
| 2101 | inline const CombinerType (&EnumValuesCombinerType())[3] { |
| 2102 | static const CombinerType values[] = { |
| 2103 | CombinerType_SUM, |
| 2104 | CombinerType_MEAN, |
| 2105 | CombinerType_SQRTN |
| 2106 | }; |
| 2107 | return values; |
| 2108 | } |
| 2109 | |
| 2110 | inline const char * const *EnumNamesCombinerType() { |
| 2111 | static const char * const names[4] = { |
| 2112 | "SUM", |
| 2113 | "MEAN", |
| 2114 | "SQRTN", |
| 2115 | nullptr |
| 2116 | }; |
| 2117 | return names; |
| 2118 | } |
| 2119 | |
| 2120 | inline const char *EnumNameCombinerType(CombinerType e) { |
| 2121 | if (flatbuffers::IsOutRange(e, CombinerType_SUM, CombinerType_SQRTN)) return ""; |
| 2122 | const size_t index = static_cast<size_t>(e); |
| 2123 | return EnumNamesCombinerType()[index]; |
| 2124 | } |
| 2125 | |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 2126 | enum MirrorPadMode : int8_t { |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 2127 | MirrorPadMode_REFLECT = 0, |
| 2128 | MirrorPadMode_SYMMETRIC = 1, |
| 2129 | MirrorPadMode_MIN = MirrorPadMode_REFLECT, |
| 2130 | MirrorPadMode_MAX = MirrorPadMode_SYMMETRIC |
| 2131 | }; |
| 2132 | |
| 2133 | inline const MirrorPadMode (&EnumValuesMirrorPadMode())[2] { |
| 2134 | static const MirrorPadMode values[] = { |
| 2135 | MirrorPadMode_REFLECT, |
| 2136 | MirrorPadMode_SYMMETRIC |
| 2137 | }; |
| 2138 | return values; |
| 2139 | } |
| 2140 | |
| 2141 | inline const char * const *EnumNamesMirrorPadMode() { |
| 2142 | static const char * const names[3] = { |
| 2143 | "REFLECT", |
| 2144 | "SYMMETRIC", |
| 2145 | nullptr |
| 2146 | }; |
| 2147 | return names; |
| 2148 | } |
| 2149 | |
| 2150 | inline const char *EnumNameMirrorPadMode(MirrorPadMode e) { |
| 2151 | if (flatbuffers::IsOutRange(e, MirrorPadMode_REFLECT, MirrorPadMode_SYMMETRIC)) return ""; |
| 2152 | const size_t index = static_cast<size_t>(e); |
| 2153 | return EnumNamesMirrorPadMode()[index]; |
| 2154 | } |
| 2155 | |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 2156 | enum CustomOptionsFormat : int8_t { |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 2157 | CustomOptionsFormat_FLEXBUFFERS = 0, |
| 2158 | CustomOptionsFormat_MIN = CustomOptionsFormat_FLEXBUFFERS, |
| 2159 | CustomOptionsFormat_MAX = CustomOptionsFormat_FLEXBUFFERS |
| 2160 | }; |
| 2161 | |
| 2162 | inline const CustomOptionsFormat (&EnumValuesCustomOptionsFormat())[1] { |
| 2163 | static const CustomOptionsFormat values[] = { |
| 2164 | CustomOptionsFormat_FLEXBUFFERS |
| 2165 | }; |
| 2166 | return values; |
| 2167 | } |
| 2168 | |
| 2169 | inline const char * const *EnumNamesCustomOptionsFormat() { |
| 2170 | static const char * const names[2] = { |
| 2171 | "FLEXBUFFERS", |
| 2172 | nullptr |
| 2173 | }; |
| 2174 | return names; |
| 2175 | } |
| 2176 | |
| 2177 | inline const char *EnumNameCustomOptionsFormat(CustomOptionsFormat e) { |
| 2178 | if (flatbuffers::IsOutRange(e, CustomOptionsFormat_FLEXBUFFERS, CustomOptionsFormat_FLEXBUFFERS)) return ""; |
| 2179 | const size_t index = static_cast<size_t>(e); |
| 2180 | return EnumNamesCustomOptionsFormat()[index]; |
| 2181 | } |
| 2182 | |
| 2183 | struct CustomQuantization FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 2184 | typedef CustomQuantizationBuilder Builder; |
| 2185 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 2186 | VT_CUSTOM = 4 |
| 2187 | }; |
| 2188 | const flatbuffers::Vector<uint8_t> *custom() const { |
| 2189 | return GetPointer<const flatbuffers::Vector<uint8_t> *>(VT_CUSTOM); |
| 2190 | } |
| 2191 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 2192 | return VerifyTableStart(verifier) && |
| 2193 | VerifyOffset(verifier, VT_CUSTOM) && |
| 2194 | verifier.VerifyVector(custom()) && |
| 2195 | verifier.EndTable(); |
| 2196 | } |
| 2197 | }; |
| 2198 | |
| 2199 | struct CustomQuantizationBuilder { |
| 2200 | typedef CustomQuantization Table; |
| 2201 | flatbuffers::FlatBufferBuilder &fbb_; |
| 2202 | flatbuffers::uoffset_t start_; |
| 2203 | void add_custom(flatbuffers::Offset<flatbuffers::Vector<uint8_t>> custom) { |
| 2204 | fbb_.AddOffset(CustomQuantization::VT_CUSTOM, custom); |
| 2205 | } |
| 2206 | explicit CustomQuantizationBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 2207 | : fbb_(_fbb) { |
| 2208 | start_ = fbb_.StartTable(); |
| 2209 | } |
| 2210 | flatbuffers::Offset<CustomQuantization> Finish() { |
| 2211 | const auto end = fbb_.EndTable(start_); |
| 2212 | auto o = flatbuffers::Offset<CustomQuantization>(end); |
| 2213 | return o; |
| 2214 | } |
| 2215 | }; |
| 2216 | |
| 2217 | inline flatbuffers::Offset<CustomQuantization> CreateCustomQuantization( |
| 2218 | flatbuffers::FlatBufferBuilder &_fbb, |
| 2219 | flatbuffers::Offset<flatbuffers::Vector<uint8_t>> custom = 0) { |
| 2220 | CustomQuantizationBuilder builder_(_fbb); |
| 2221 | builder_.add_custom(custom); |
| 2222 | return builder_.Finish(); |
| 2223 | } |
| 2224 | |
| 2225 | inline flatbuffers::Offset<CustomQuantization> CreateCustomQuantizationDirect( |
| 2226 | flatbuffers::FlatBufferBuilder &_fbb, |
| 2227 | const std::vector<uint8_t> *custom = nullptr) { |
| 2228 | if (custom) { _fbb.ForceVectorAlignment(custom->size(), sizeof(uint8_t), 16); } |
| 2229 | auto custom__ = custom ? _fbb.CreateVector<uint8_t>(*custom) : 0; |
| 2230 | return tflite::CreateCustomQuantization( |
| 2231 | _fbb, |
| 2232 | custom__); |
| 2233 | } |
| 2234 | |
| 2235 | struct QuantizationParameters FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 2236 | typedef QuantizationParametersBuilder Builder; |
| 2237 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 2238 | VT_MIN = 4, |
| 2239 | VT_MAX = 6, |
| 2240 | VT_SCALE = 8, |
| 2241 | VT_ZERO_POINT = 10, |
| 2242 | VT_DETAILS_TYPE = 12, |
| 2243 | VT_DETAILS = 14, |
| 2244 | VT_QUANTIZED_DIMENSION = 16 |
| 2245 | }; |
| 2246 | const flatbuffers::Vector<float> *min() const { |
| 2247 | return GetPointer<const flatbuffers::Vector<float> *>(VT_MIN); |
| 2248 | } |
| 2249 | const flatbuffers::Vector<float> *max() const { |
| 2250 | return GetPointer<const flatbuffers::Vector<float> *>(VT_MAX); |
| 2251 | } |
| 2252 | const flatbuffers::Vector<float> *scale() const { |
| 2253 | return GetPointer<const flatbuffers::Vector<float> *>(VT_SCALE); |
| 2254 | } |
| 2255 | const flatbuffers::Vector<int64_t> *zero_point() const { |
| 2256 | return GetPointer<const flatbuffers::Vector<int64_t> *>(VT_ZERO_POINT); |
| 2257 | } |
| 2258 | tflite::QuantizationDetails details_type() const { |
| 2259 | return static_cast<tflite::QuantizationDetails>(GetField<uint8_t>(VT_DETAILS_TYPE, 0)); |
| 2260 | } |
| 2261 | const void *details() const { |
| 2262 | return GetPointer<const void *>(VT_DETAILS); |
| 2263 | } |
| 2264 | template<typename T> const T *details_as() const; |
| 2265 | const tflite::CustomQuantization *details_as_CustomQuantization() const { |
| 2266 | return details_type() == tflite::QuantizationDetails_CustomQuantization ? static_cast<const tflite::CustomQuantization *>(details()) : nullptr; |
| 2267 | } |
| 2268 | int32_t quantized_dimension() const { |
| 2269 | return GetField<int32_t>(VT_QUANTIZED_DIMENSION, 0); |
| 2270 | } |
| 2271 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 2272 | return VerifyTableStart(verifier) && |
| 2273 | VerifyOffset(verifier, VT_MIN) && |
| 2274 | verifier.VerifyVector(min()) && |
| 2275 | VerifyOffset(verifier, VT_MAX) && |
| 2276 | verifier.VerifyVector(max()) && |
| 2277 | VerifyOffset(verifier, VT_SCALE) && |
| 2278 | verifier.VerifyVector(scale()) && |
| 2279 | VerifyOffset(verifier, VT_ZERO_POINT) && |
| 2280 | verifier.VerifyVector(zero_point()) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 2281 | VerifyField<uint8_t>(verifier, VT_DETAILS_TYPE, 1) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 2282 | VerifyOffset(verifier, VT_DETAILS) && |
| 2283 | VerifyQuantizationDetails(verifier, details(), details_type()) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 2284 | VerifyField<int32_t>(verifier, VT_QUANTIZED_DIMENSION, 4) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 2285 | verifier.EndTable(); |
| 2286 | } |
| 2287 | }; |
| 2288 | |
| 2289 | template<> inline const tflite::CustomQuantization *QuantizationParameters::details_as<tflite::CustomQuantization>() const { |
| 2290 | return details_as_CustomQuantization(); |
| 2291 | } |
| 2292 | |
| 2293 | struct QuantizationParametersBuilder { |
| 2294 | typedef QuantizationParameters Table; |
| 2295 | flatbuffers::FlatBufferBuilder &fbb_; |
| 2296 | flatbuffers::uoffset_t start_; |
| 2297 | void add_min(flatbuffers::Offset<flatbuffers::Vector<float>> min) { |
| 2298 | fbb_.AddOffset(QuantizationParameters::VT_MIN, min); |
| 2299 | } |
| 2300 | void add_max(flatbuffers::Offset<flatbuffers::Vector<float>> max) { |
| 2301 | fbb_.AddOffset(QuantizationParameters::VT_MAX, max); |
| 2302 | } |
| 2303 | void add_scale(flatbuffers::Offset<flatbuffers::Vector<float>> scale) { |
| 2304 | fbb_.AddOffset(QuantizationParameters::VT_SCALE, scale); |
| 2305 | } |
| 2306 | void add_zero_point(flatbuffers::Offset<flatbuffers::Vector<int64_t>> zero_point) { |
| 2307 | fbb_.AddOffset(QuantizationParameters::VT_ZERO_POINT, zero_point); |
| 2308 | } |
| 2309 | void add_details_type(tflite::QuantizationDetails details_type) { |
| 2310 | fbb_.AddElement<uint8_t>(QuantizationParameters::VT_DETAILS_TYPE, static_cast<uint8_t>(details_type), 0); |
| 2311 | } |
| 2312 | void add_details(flatbuffers::Offset<void> details) { |
| 2313 | fbb_.AddOffset(QuantizationParameters::VT_DETAILS, details); |
| 2314 | } |
| 2315 | void add_quantized_dimension(int32_t quantized_dimension) { |
| 2316 | fbb_.AddElement<int32_t>(QuantizationParameters::VT_QUANTIZED_DIMENSION, quantized_dimension, 0); |
| 2317 | } |
| 2318 | explicit QuantizationParametersBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 2319 | : fbb_(_fbb) { |
| 2320 | start_ = fbb_.StartTable(); |
| 2321 | } |
| 2322 | flatbuffers::Offset<QuantizationParameters> Finish() { |
| 2323 | const auto end = fbb_.EndTable(start_); |
| 2324 | auto o = flatbuffers::Offset<QuantizationParameters>(end); |
| 2325 | return o; |
| 2326 | } |
| 2327 | }; |
| 2328 | |
| 2329 | inline flatbuffers::Offset<QuantizationParameters> CreateQuantizationParameters( |
| 2330 | flatbuffers::FlatBufferBuilder &_fbb, |
| 2331 | flatbuffers::Offset<flatbuffers::Vector<float>> min = 0, |
| 2332 | flatbuffers::Offset<flatbuffers::Vector<float>> max = 0, |
| 2333 | flatbuffers::Offset<flatbuffers::Vector<float>> scale = 0, |
| 2334 | flatbuffers::Offset<flatbuffers::Vector<int64_t>> zero_point = 0, |
| 2335 | tflite::QuantizationDetails details_type = tflite::QuantizationDetails_NONE, |
| 2336 | flatbuffers::Offset<void> details = 0, |
| 2337 | int32_t quantized_dimension = 0) { |
| 2338 | QuantizationParametersBuilder builder_(_fbb); |
| 2339 | builder_.add_quantized_dimension(quantized_dimension); |
| 2340 | builder_.add_details(details); |
| 2341 | builder_.add_zero_point(zero_point); |
| 2342 | builder_.add_scale(scale); |
| 2343 | builder_.add_max(max); |
| 2344 | builder_.add_min(min); |
| 2345 | builder_.add_details_type(details_type); |
| 2346 | return builder_.Finish(); |
| 2347 | } |
| 2348 | |
| 2349 | inline flatbuffers::Offset<QuantizationParameters> CreateQuantizationParametersDirect( |
| 2350 | flatbuffers::FlatBufferBuilder &_fbb, |
| 2351 | const std::vector<float> *min = nullptr, |
| 2352 | const std::vector<float> *max = nullptr, |
| 2353 | const std::vector<float> *scale = nullptr, |
| 2354 | const std::vector<int64_t> *zero_point = nullptr, |
| 2355 | tflite::QuantizationDetails details_type = tflite::QuantizationDetails_NONE, |
| 2356 | flatbuffers::Offset<void> details = 0, |
| 2357 | int32_t quantized_dimension = 0) { |
| 2358 | auto min__ = min ? _fbb.CreateVector<float>(*min) : 0; |
| 2359 | auto max__ = max ? _fbb.CreateVector<float>(*max) : 0; |
| 2360 | auto scale__ = scale ? _fbb.CreateVector<float>(*scale) : 0; |
| 2361 | auto zero_point__ = zero_point ? _fbb.CreateVector<int64_t>(*zero_point) : 0; |
| 2362 | return tflite::CreateQuantizationParameters( |
| 2363 | _fbb, |
| 2364 | min__, |
| 2365 | max__, |
| 2366 | scale__, |
| 2367 | zero_point__, |
| 2368 | details_type, |
| 2369 | details, |
| 2370 | quantized_dimension); |
| 2371 | } |
| 2372 | |
| 2373 | struct Int32Vector FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 2374 | typedef Int32VectorBuilder Builder; |
| 2375 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 2376 | VT_VALUES = 4 |
| 2377 | }; |
| 2378 | const flatbuffers::Vector<int32_t> *values() const { |
| 2379 | return GetPointer<const flatbuffers::Vector<int32_t> *>(VT_VALUES); |
| 2380 | } |
| 2381 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 2382 | return VerifyTableStart(verifier) && |
| 2383 | VerifyOffset(verifier, VT_VALUES) && |
| 2384 | verifier.VerifyVector(values()) && |
| 2385 | verifier.EndTable(); |
| 2386 | } |
| 2387 | }; |
| 2388 | |
| 2389 | struct Int32VectorBuilder { |
| 2390 | typedef Int32Vector Table; |
| 2391 | flatbuffers::FlatBufferBuilder &fbb_; |
| 2392 | flatbuffers::uoffset_t start_; |
| 2393 | void add_values(flatbuffers::Offset<flatbuffers::Vector<int32_t>> values) { |
| 2394 | fbb_.AddOffset(Int32Vector::VT_VALUES, values); |
| 2395 | } |
| 2396 | explicit Int32VectorBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 2397 | : fbb_(_fbb) { |
| 2398 | start_ = fbb_.StartTable(); |
| 2399 | } |
| 2400 | flatbuffers::Offset<Int32Vector> Finish() { |
| 2401 | const auto end = fbb_.EndTable(start_); |
| 2402 | auto o = flatbuffers::Offset<Int32Vector>(end); |
| 2403 | return o; |
| 2404 | } |
| 2405 | }; |
| 2406 | |
| 2407 | inline flatbuffers::Offset<Int32Vector> CreateInt32Vector( |
| 2408 | flatbuffers::FlatBufferBuilder &_fbb, |
| 2409 | flatbuffers::Offset<flatbuffers::Vector<int32_t>> values = 0) { |
| 2410 | Int32VectorBuilder builder_(_fbb); |
| 2411 | builder_.add_values(values); |
| 2412 | return builder_.Finish(); |
| 2413 | } |
| 2414 | |
| 2415 | inline flatbuffers::Offset<Int32Vector> CreateInt32VectorDirect( |
| 2416 | flatbuffers::FlatBufferBuilder &_fbb, |
| 2417 | const std::vector<int32_t> *values = nullptr) { |
| 2418 | auto values__ = values ? _fbb.CreateVector<int32_t>(*values) : 0; |
| 2419 | return tflite::CreateInt32Vector( |
| 2420 | _fbb, |
| 2421 | values__); |
| 2422 | } |
| 2423 | |
| 2424 | struct Uint16Vector FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 2425 | typedef Uint16VectorBuilder Builder; |
| 2426 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 2427 | VT_VALUES = 4 |
| 2428 | }; |
| 2429 | const flatbuffers::Vector<uint16_t> *values() const { |
| 2430 | return GetPointer<const flatbuffers::Vector<uint16_t> *>(VT_VALUES); |
| 2431 | } |
| 2432 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 2433 | return VerifyTableStart(verifier) && |
| 2434 | VerifyOffset(verifier, VT_VALUES) && |
| 2435 | verifier.VerifyVector(values()) && |
| 2436 | verifier.EndTable(); |
| 2437 | } |
| 2438 | }; |
| 2439 | |
| 2440 | struct Uint16VectorBuilder { |
| 2441 | typedef Uint16Vector Table; |
| 2442 | flatbuffers::FlatBufferBuilder &fbb_; |
| 2443 | flatbuffers::uoffset_t start_; |
| 2444 | void add_values(flatbuffers::Offset<flatbuffers::Vector<uint16_t>> values) { |
| 2445 | fbb_.AddOffset(Uint16Vector::VT_VALUES, values); |
| 2446 | } |
| 2447 | explicit Uint16VectorBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 2448 | : fbb_(_fbb) { |
| 2449 | start_ = fbb_.StartTable(); |
| 2450 | } |
| 2451 | flatbuffers::Offset<Uint16Vector> Finish() { |
| 2452 | const auto end = fbb_.EndTable(start_); |
| 2453 | auto o = flatbuffers::Offset<Uint16Vector>(end); |
| 2454 | return o; |
| 2455 | } |
| 2456 | }; |
| 2457 | |
| 2458 | inline flatbuffers::Offset<Uint16Vector> CreateUint16Vector( |
| 2459 | flatbuffers::FlatBufferBuilder &_fbb, |
| 2460 | flatbuffers::Offset<flatbuffers::Vector<uint16_t>> values = 0) { |
| 2461 | Uint16VectorBuilder builder_(_fbb); |
| 2462 | builder_.add_values(values); |
| 2463 | return builder_.Finish(); |
| 2464 | } |
| 2465 | |
| 2466 | inline flatbuffers::Offset<Uint16Vector> CreateUint16VectorDirect( |
| 2467 | flatbuffers::FlatBufferBuilder &_fbb, |
| 2468 | const std::vector<uint16_t> *values = nullptr) { |
| 2469 | if (values) { _fbb.ForceVectorAlignment(values->size(), sizeof(uint16_t), 4); } |
| 2470 | auto values__ = values ? _fbb.CreateVector<uint16_t>(*values) : 0; |
| 2471 | return tflite::CreateUint16Vector( |
| 2472 | _fbb, |
| 2473 | values__); |
| 2474 | } |
| 2475 | |
| 2476 | struct Uint8Vector FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 2477 | typedef Uint8VectorBuilder Builder; |
| 2478 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 2479 | VT_VALUES = 4 |
| 2480 | }; |
| 2481 | const flatbuffers::Vector<uint8_t> *values() const { |
| 2482 | return GetPointer<const flatbuffers::Vector<uint8_t> *>(VT_VALUES); |
| 2483 | } |
| 2484 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 2485 | return VerifyTableStart(verifier) && |
| 2486 | VerifyOffset(verifier, VT_VALUES) && |
| 2487 | verifier.VerifyVector(values()) && |
| 2488 | verifier.EndTable(); |
| 2489 | } |
| 2490 | }; |
| 2491 | |
| 2492 | struct Uint8VectorBuilder { |
| 2493 | typedef Uint8Vector Table; |
| 2494 | flatbuffers::FlatBufferBuilder &fbb_; |
| 2495 | flatbuffers::uoffset_t start_; |
| 2496 | void add_values(flatbuffers::Offset<flatbuffers::Vector<uint8_t>> values) { |
| 2497 | fbb_.AddOffset(Uint8Vector::VT_VALUES, values); |
| 2498 | } |
| 2499 | explicit Uint8VectorBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 2500 | : fbb_(_fbb) { |
| 2501 | start_ = fbb_.StartTable(); |
| 2502 | } |
| 2503 | flatbuffers::Offset<Uint8Vector> Finish() { |
| 2504 | const auto end = fbb_.EndTable(start_); |
| 2505 | auto o = flatbuffers::Offset<Uint8Vector>(end); |
| 2506 | return o; |
| 2507 | } |
| 2508 | }; |
| 2509 | |
| 2510 | inline flatbuffers::Offset<Uint8Vector> CreateUint8Vector( |
| 2511 | flatbuffers::FlatBufferBuilder &_fbb, |
| 2512 | flatbuffers::Offset<flatbuffers::Vector<uint8_t>> values = 0) { |
| 2513 | Uint8VectorBuilder builder_(_fbb); |
| 2514 | builder_.add_values(values); |
| 2515 | return builder_.Finish(); |
| 2516 | } |
| 2517 | |
| 2518 | inline flatbuffers::Offset<Uint8Vector> CreateUint8VectorDirect( |
| 2519 | flatbuffers::FlatBufferBuilder &_fbb, |
| 2520 | const std::vector<uint8_t> *values = nullptr) { |
| 2521 | if (values) { _fbb.ForceVectorAlignment(values->size(), sizeof(uint8_t), 4); } |
| 2522 | auto values__ = values ? _fbb.CreateVector<uint8_t>(*values) : 0; |
| 2523 | return tflite::CreateUint8Vector( |
| 2524 | _fbb, |
| 2525 | values__); |
| 2526 | } |
| 2527 | |
| 2528 | struct DimensionMetadata FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 2529 | typedef DimensionMetadataBuilder Builder; |
| 2530 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 2531 | VT_FORMAT = 4, |
| 2532 | VT_DENSE_SIZE = 6, |
| 2533 | VT_ARRAY_SEGMENTS_TYPE = 8, |
| 2534 | VT_ARRAY_SEGMENTS = 10, |
| 2535 | VT_ARRAY_INDICES_TYPE = 12, |
| 2536 | VT_ARRAY_INDICES = 14 |
| 2537 | }; |
| 2538 | tflite::DimensionType format() const { |
| 2539 | return static_cast<tflite::DimensionType>(GetField<int8_t>(VT_FORMAT, 0)); |
| 2540 | } |
| 2541 | int32_t dense_size() const { |
| 2542 | return GetField<int32_t>(VT_DENSE_SIZE, 0); |
| 2543 | } |
| 2544 | tflite::SparseIndexVector array_segments_type() const { |
| 2545 | return static_cast<tflite::SparseIndexVector>(GetField<uint8_t>(VT_ARRAY_SEGMENTS_TYPE, 0)); |
| 2546 | } |
| 2547 | const void *array_segments() const { |
| 2548 | return GetPointer<const void *>(VT_ARRAY_SEGMENTS); |
| 2549 | } |
| 2550 | template<typename T> const T *array_segments_as() const; |
| 2551 | const tflite::Int32Vector *array_segments_as_Int32Vector() const { |
| 2552 | return array_segments_type() == tflite::SparseIndexVector_Int32Vector ? static_cast<const tflite::Int32Vector *>(array_segments()) : nullptr; |
| 2553 | } |
| 2554 | const tflite::Uint16Vector *array_segments_as_Uint16Vector() const { |
| 2555 | return array_segments_type() == tflite::SparseIndexVector_Uint16Vector ? static_cast<const tflite::Uint16Vector *>(array_segments()) : nullptr; |
| 2556 | } |
| 2557 | const tflite::Uint8Vector *array_segments_as_Uint8Vector() const { |
| 2558 | return array_segments_type() == tflite::SparseIndexVector_Uint8Vector ? static_cast<const tflite::Uint8Vector *>(array_segments()) : nullptr; |
| 2559 | } |
| 2560 | tflite::SparseIndexVector array_indices_type() const { |
| 2561 | return static_cast<tflite::SparseIndexVector>(GetField<uint8_t>(VT_ARRAY_INDICES_TYPE, 0)); |
| 2562 | } |
| 2563 | const void *array_indices() const { |
| 2564 | return GetPointer<const void *>(VT_ARRAY_INDICES); |
| 2565 | } |
| 2566 | template<typename T> const T *array_indices_as() const; |
| 2567 | const tflite::Int32Vector *array_indices_as_Int32Vector() const { |
| 2568 | return array_indices_type() == tflite::SparseIndexVector_Int32Vector ? static_cast<const tflite::Int32Vector *>(array_indices()) : nullptr; |
| 2569 | } |
| 2570 | const tflite::Uint16Vector *array_indices_as_Uint16Vector() const { |
| 2571 | return array_indices_type() == tflite::SparseIndexVector_Uint16Vector ? static_cast<const tflite::Uint16Vector *>(array_indices()) : nullptr; |
| 2572 | } |
| 2573 | const tflite::Uint8Vector *array_indices_as_Uint8Vector() const { |
| 2574 | return array_indices_type() == tflite::SparseIndexVector_Uint8Vector ? static_cast<const tflite::Uint8Vector *>(array_indices()) : nullptr; |
| 2575 | } |
| 2576 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 2577 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 2578 | VerifyField<int8_t>(verifier, VT_FORMAT, 1) && |
| 2579 | VerifyField<int32_t>(verifier, VT_DENSE_SIZE, 4) && |
| 2580 | VerifyField<uint8_t>(verifier, VT_ARRAY_SEGMENTS_TYPE, 1) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 2581 | VerifyOffset(verifier, VT_ARRAY_SEGMENTS) && |
| 2582 | VerifySparseIndexVector(verifier, array_segments(), array_segments_type()) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 2583 | VerifyField<uint8_t>(verifier, VT_ARRAY_INDICES_TYPE, 1) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 2584 | VerifyOffset(verifier, VT_ARRAY_INDICES) && |
| 2585 | VerifySparseIndexVector(verifier, array_indices(), array_indices_type()) && |
| 2586 | verifier.EndTable(); |
| 2587 | } |
| 2588 | }; |
| 2589 | |
| 2590 | template<> inline const tflite::Int32Vector *DimensionMetadata::array_segments_as<tflite::Int32Vector>() const { |
| 2591 | return array_segments_as_Int32Vector(); |
| 2592 | } |
| 2593 | |
| 2594 | template<> inline const tflite::Uint16Vector *DimensionMetadata::array_segments_as<tflite::Uint16Vector>() const { |
| 2595 | return array_segments_as_Uint16Vector(); |
| 2596 | } |
| 2597 | |
| 2598 | template<> inline const tflite::Uint8Vector *DimensionMetadata::array_segments_as<tflite::Uint8Vector>() const { |
| 2599 | return array_segments_as_Uint8Vector(); |
| 2600 | } |
| 2601 | |
| 2602 | template<> inline const tflite::Int32Vector *DimensionMetadata::array_indices_as<tflite::Int32Vector>() const { |
| 2603 | return array_indices_as_Int32Vector(); |
| 2604 | } |
| 2605 | |
| 2606 | template<> inline const tflite::Uint16Vector *DimensionMetadata::array_indices_as<tflite::Uint16Vector>() const { |
| 2607 | return array_indices_as_Uint16Vector(); |
| 2608 | } |
| 2609 | |
| 2610 | template<> inline const tflite::Uint8Vector *DimensionMetadata::array_indices_as<tflite::Uint8Vector>() const { |
| 2611 | return array_indices_as_Uint8Vector(); |
| 2612 | } |
| 2613 | |
| 2614 | struct DimensionMetadataBuilder { |
| 2615 | typedef DimensionMetadata Table; |
| 2616 | flatbuffers::FlatBufferBuilder &fbb_; |
| 2617 | flatbuffers::uoffset_t start_; |
| 2618 | void add_format(tflite::DimensionType format) { |
| 2619 | fbb_.AddElement<int8_t>(DimensionMetadata::VT_FORMAT, static_cast<int8_t>(format), 0); |
| 2620 | } |
| 2621 | void add_dense_size(int32_t dense_size) { |
| 2622 | fbb_.AddElement<int32_t>(DimensionMetadata::VT_DENSE_SIZE, dense_size, 0); |
| 2623 | } |
| 2624 | void add_array_segments_type(tflite::SparseIndexVector array_segments_type) { |
| 2625 | fbb_.AddElement<uint8_t>(DimensionMetadata::VT_ARRAY_SEGMENTS_TYPE, static_cast<uint8_t>(array_segments_type), 0); |
| 2626 | } |
| 2627 | void add_array_segments(flatbuffers::Offset<void> array_segments) { |
| 2628 | fbb_.AddOffset(DimensionMetadata::VT_ARRAY_SEGMENTS, array_segments); |
| 2629 | } |
| 2630 | void add_array_indices_type(tflite::SparseIndexVector array_indices_type) { |
| 2631 | fbb_.AddElement<uint8_t>(DimensionMetadata::VT_ARRAY_INDICES_TYPE, static_cast<uint8_t>(array_indices_type), 0); |
| 2632 | } |
| 2633 | void add_array_indices(flatbuffers::Offset<void> array_indices) { |
| 2634 | fbb_.AddOffset(DimensionMetadata::VT_ARRAY_INDICES, array_indices); |
| 2635 | } |
| 2636 | explicit DimensionMetadataBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 2637 | : fbb_(_fbb) { |
| 2638 | start_ = fbb_.StartTable(); |
| 2639 | } |
| 2640 | flatbuffers::Offset<DimensionMetadata> Finish() { |
| 2641 | const auto end = fbb_.EndTable(start_); |
| 2642 | auto o = flatbuffers::Offset<DimensionMetadata>(end); |
| 2643 | return o; |
| 2644 | } |
| 2645 | }; |
| 2646 | |
| 2647 | inline flatbuffers::Offset<DimensionMetadata> CreateDimensionMetadata( |
| 2648 | flatbuffers::FlatBufferBuilder &_fbb, |
| 2649 | tflite::DimensionType format = tflite::DimensionType_DENSE, |
| 2650 | int32_t dense_size = 0, |
| 2651 | tflite::SparseIndexVector array_segments_type = tflite::SparseIndexVector_NONE, |
| 2652 | flatbuffers::Offset<void> array_segments = 0, |
| 2653 | tflite::SparseIndexVector array_indices_type = tflite::SparseIndexVector_NONE, |
| 2654 | flatbuffers::Offset<void> array_indices = 0) { |
| 2655 | DimensionMetadataBuilder builder_(_fbb); |
| 2656 | builder_.add_array_indices(array_indices); |
| 2657 | builder_.add_array_segments(array_segments); |
| 2658 | builder_.add_dense_size(dense_size); |
| 2659 | builder_.add_array_indices_type(array_indices_type); |
| 2660 | builder_.add_array_segments_type(array_segments_type); |
| 2661 | builder_.add_format(format); |
| 2662 | return builder_.Finish(); |
| 2663 | } |
| 2664 | |
| 2665 | struct SparsityParameters FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 2666 | typedef SparsityParametersBuilder Builder; |
| 2667 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 2668 | VT_TRAVERSAL_ORDER = 4, |
| 2669 | VT_BLOCK_MAP = 6, |
| 2670 | VT_DIM_METADATA = 8 |
| 2671 | }; |
| 2672 | const flatbuffers::Vector<int32_t> *traversal_order() const { |
| 2673 | return GetPointer<const flatbuffers::Vector<int32_t> *>(VT_TRAVERSAL_ORDER); |
| 2674 | } |
| 2675 | const flatbuffers::Vector<int32_t> *block_map() const { |
| 2676 | return GetPointer<const flatbuffers::Vector<int32_t> *>(VT_BLOCK_MAP); |
| 2677 | } |
| 2678 | const flatbuffers::Vector<flatbuffers::Offset<tflite::DimensionMetadata>> *dim_metadata() const { |
| 2679 | return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<tflite::DimensionMetadata>> *>(VT_DIM_METADATA); |
| 2680 | } |
| 2681 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 2682 | return VerifyTableStart(verifier) && |
| 2683 | VerifyOffset(verifier, VT_TRAVERSAL_ORDER) && |
| 2684 | verifier.VerifyVector(traversal_order()) && |
| 2685 | VerifyOffset(verifier, VT_BLOCK_MAP) && |
| 2686 | verifier.VerifyVector(block_map()) && |
| 2687 | VerifyOffset(verifier, VT_DIM_METADATA) && |
| 2688 | verifier.VerifyVector(dim_metadata()) && |
| 2689 | verifier.VerifyVectorOfTables(dim_metadata()) && |
| 2690 | verifier.EndTable(); |
| 2691 | } |
| 2692 | }; |
| 2693 | |
| 2694 | struct SparsityParametersBuilder { |
| 2695 | typedef SparsityParameters Table; |
| 2696 | flatbuffers::FlatBufferBuilder &fbb_; |
| 2697 | flatbuffers::uoffset_t start_; |
| 2698 | void add_traversal_order(flatbuffers::Offset<flatbuffers::Vector<int32_t>> traversal_order) { |
| 2699 | fbb_.AddOffset(SparsityParameters::VT_TRAVERSAL_ORDER, traversal_order); |
| 2700 | } |
| 2701 | void add_block_map(flatbuffers::Offset<flatbuffers::Vector<int32_t>> block_map) { |
| 2702 | fbb_.AddOffset(SparsityParameters::VT_BLOCK_MAP, block_map); |
| 2703 | } |
| 2704 | void add_dim_metadata(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::DimensionMetadata>>> dim_metadata) { |
| 2705 | fbb_.AddOffset(SparsityParameters::VT_DIM_METADATA, dim_metadata); |
| 2706 | } |
| 2707 | explicit SparsityParametersBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 2708 | : fbb_(_fbb) { |
| 2709 | start_ = fbb_.StartTable(); |
| 2710 | } |
| 2711 | flatbuffers::Offset<SparsityParameters> Finish() { |
| 2712 | const auto end = fbb_.EndTable(start_); |
| 2713 | auto o = flatbuffers::Offset<SparsityParameters>(end); |
| 2714 | return o; |
| 2715 | } |
| 2716 | }; |
| 2717 | |
| 2718 | inline flatbuffers::Offset<SparsityParameters> CreateSparsityParameters( |
| 2719 | flatbuffers::FlatBufferBuilder &_fbb, |
| 2720 | flatbuffers::Offset<flatbuffers::Vector<int32_t>> traversal_order = 0, |
| 2721 | flatbuffers::Offset<flatbuffers::Vector<int32_t>> block_map = 0, |
| 2722 | flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::DimensionMetadata>>> dim_metadata = 0) { |
| 2723 | SparsityParametersBuilder builder_(_fbb); |
| 2724 | builder_.add_dim_metadata(dim_metadata); |
| 2725 | builder_.add_block_map(block_map); |
| 2726 | builder_.add_traversal_order(traversal_order); |
| 2727 | return builder_.Finish(); |
| 2728 | } |
| 2729 | |
| 2730 | inline flatbuffers::Offset<SparsityParameters> CreateSparsityParametersDirect( |
| 2731 | flatbuffers::FlatBufferBuilder &_fbb, |
| 2732 | const std::vector<int32_t> *traversal_order = nullptr, |
| 2733 | const std::vector<int32_t> *block_map = nullptr, |
| 2734 | const std::vector<flatbuffers::Offset<tflite::DimensionMetadata>> *dim_metadata = nullptr) { |
| 2735 | auto traversal_order__ = traversal_order ? _fbb.CreateVector<int32_t>(*traversal_order) : 0; |
| 2736 | auto block_map__ = block_map ? _fbb.CreateVector<int32_t>(*block_map) : 0; |
| 2737 | auto dim_metadata__ = dim_metadata ? _fbb.CreateVector<flatbuffers::Offset<tflite::DimensionMetadata>>(*dim_metadata) : 0; |
| 2738 | return tflite::CreateSparsityParameters( |
| 2739 | _fbb, |
| 2740 | traversal_order__, |
| 2741 | block_map__, |
| 2742 | dim_metadata__); |
| 2743 | } |
| 2744 | |
| 2745 | struct Tensor FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 2746 | typedef TensorBuilder Builder; |
| 2747 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 2748 | VT_SHAPE = 4, |
| 2749 | VT_TYPE = 6, |
| 2750 | VT_BUFFER = 8, |
| 2751 | VT_NAME = 10, |
| 2752 | VT_QUANTIZATION = 12, |
| 2753 | VT_IS_VARIABLE = 14, |
| 2754 | VT_SPARSITY = 16, |
| 2755 | VT_SHAPE_SIGNATURE = 18 |
| 2756 | }; |
| 2757 | const flatbuffers::Vector<int32_t> *shape() const { |
| 2758 | return GetPointer<const flatbuffers::Vector<int32_t> *>(VT_SHAPE); |
| 2759 | } |
| 2760 | tflite::TensorType type() const { |
| 2761 | return static_cast<tflite::TensorType>(GetField<int8_t>(VT_TYPE, 0)); |
| 2762 | } |
| 2763 | uint32_t buffer() const { |
| 2764 | return GetField<uint32_t>(VT_BUFFER, 0); |
| 2765 | } |
| 2766 | const flatbuffers::String *name() const { |
| 2767 | return GetPointer<const flatbuffers::String *>(VT_NAME); |
| 2768 | } |
| 2769 | const tflite::QuantizationParameters *quantization() const { |
| 2770 | return GetPointer<const tflite::QuantizationParameters *>(VT_QUANTIZATION); |
| 2771 | } |
| 2772 | bool is_variable() const { |
| 2773 | return GetField<uint8_t>(VT_IS_VARIABLE, 0) != 0; |
| 2774 | } |
| 2775 | const tflite::SparsityParameters *sparsity() const { |
| 2776 | return GetPointer<const tflite::SparsityParameters *>(VT_SPARSITY); |
| 2777 | } |
| 2778 | const flatbuffers::Vector<int32_t> *shape_signature() const { |
| 2779 | return GetPointer<const flatbuffers::Vector<int32_t> *>(VT_SHAPE_SIGNATURE); |
| 2780 | } |
| 2781 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 2782 | return VerifyTableStart(verifier) && |
| 2783 | VerifyOffset(verifier, VT_SHAPE) && |
| 2784 | verifier.VerifyVector(shape()) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 2785 | VerifyField<int8_t>(verifier, VT_TYPE, 1) && |
| 2786 | VerifyField<uint32_t>(verifier, VT_BUFFER, 4) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 2787 | VerifyOffset(verifier, VT_NAME) && |
| 2788 | verifier.VerifyString(name()) && |
| 2789 | VerifyOffset(verifier, VT_QUANTIZATION) && |
| 2790 | verifier.VerifyTable(quantization()) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 2791 | VerifyField<uint8_t>(verifier, VT_IS_VARIABLE, 1) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 2792 | VerifyOffset(verifier, VT_SPARSITY) && |
| 2793 | verifier.VerifyTable(sparsity()) && |
| 2794 | VerifyOffset(verifier, VT_SHAPE_SIGNATURE) && |
| 2795 | verifier.VerifyVector(shape_signature()) && |
| 2796 | verifier.EndTable(); |
| 2797 | } |
| 2798 | }; |
| 2799 | |
| 2800 | struct TensorBuilder { |
| 2801 | typedef Tensor Table; |
| 2802 | flatbuffers::FlatBufferBuilder &fbb_; |
| 2803 | flatbuffers::uoffset_t start_; |
| 2804 | void add_shape(flatbuffers::Offset<flatbuffers::Vector<int32_t>> shape) { |
| 2805 | fbb_.AddOffset(Tensor::VT_SHAPE, shape); |
| 2806 | } |
| 2807 | void add_type(tflite::TensorType type) { |
| 2808 | fbb_.AddElement<int8_t>(Tensor::VT_TYPE, static_cast<int8_t>(type), 0); |
| 2809 | } |
| 2810 | void add_buffer(uint32_t buffer) { |
| 2811 | fbb_.AddElement<uint32_t>(Tensor::VT_BUFFER, buffer, 0); |
| 2812 | } |
| 2813 | void add_name(flatbuffers::Offset<flatbuffers::String> name) { |
| 2814 | fbb_.AddOffset(Tensor::VT_NAME, name); |
| 2815 | } |
| 2816 | void add_quantization(flatbuffers::Offset<tflite::QuantizationParameters> quantization) { |
| 2817 | fbb_.AddOffset(Tensor::VT_QUANTIZATION, quantization); |
| 2818 | } |
| 2819 | void add_is_variable(bool is_variable) { |
| 2820 | fbb_.AddElement<uint8_t>(Tensor::VT_IS_VARIABLE, static_cast<uint8_t>(is_variable), 0); |
| 2821 | } |
| 2822 | void add_sparsity(flatbuffers::Offset<tflite::SparsityParameters> sparsity) { |
| 2823 | fbb_.AddOffset(Tensor::VT_SPARSITY, sparsity); |
| 2824 | } |
| 2825 | void add_shape_signature(flatbuffers::Offset<flatbuffers::Vector<int32_t>> shape_signature) { |
| 2826 | fbb_.AddOffset(Tensor::VT_SHAPE_SIGNATURE, shape_signature); |
| 2827 | } |
| 2828 | explicit TensorBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 2829 | : fbb_(_fbb) { |
| 2830 | start_ = fbb_.StartTable(); |
| 2831 | } |
| 2832 | flatbuffers::Offset<Tensor> Finish() { |
| 2833 | const auto end = fbb_.EndTable(start_); |
| 2834 | auto o = flatbuffers::Offset<Tensor>(end); |
| 2835 | return o; |
| 2836 | } |
| 2837 | }; |
| 2838 | |
| 2839 | inline flatbuffers::Offset<Tensor> CreateTensor( |
| 2840 | flatbuffers::FlatBufferBuilder &_fbb, |
| 2841 | flatbuffers::Offset<flatbuffers::Vector<int32_t>> shape = 0, |
| 2842 | tflite::TensorType type = tflite::TensorType_FLOAT32, |
| 2843 | uint32_t buffer = 0, |
| 2844 | flatbuffers::Offset<flatbuffers::String> name = 0, |
| 2845 | flatbuffers::Offset<tflite::QuantizationParameters> quantization = 0, |
| 2846 | bool is_variable = false, |
| 2847 | flatbuffers::Offset<tflite::SparsityParameters> sparsity = 0, |
| 2848 | flatbuffers::Offset<flatbuffers::Vector<int32_t>> shape_signature = 0) { |
| 2849 | TensorBuilder builder_(_fbb); |
| 2850 | builder_.add_shape_signature(shape_signature); |
| 2851 | builder_.add_sparsity(sparsity); |
| 2852 | builder_.add_quantization(quantization); |
| 2853 | builder_.add_name(name); |
| 2854 | builder_.add_buffer(buffer); |
| 2855 | builder_.add_shape(shape); |
| 2856 | builder_.add_is_variable(is_variable); |
| 2857 | builder_.add_type(type); |
| 2858 | return builder_.Finish(); |
| 2859 | } |
| 2860 | |
| 2861 | inline flatbuffers::Offset<Tensor> CreateTensorDirect( |
| 2862 | flatbuffers::FlatBufferBuilder &_fbb, |
| 2863 | const std::vector<int32_t> *shape = nullptr, |
| 2864 | tflite::TensorType type = tflite::TensorType_FLOAT32, |
| 2865 | uint32_t buffer = 0, |
| 2866 | const char *name = nullptr, |
| 2867 | flatbuffers::Offset<tflite::QuantizationParameters> quantization = 0, |
| 2868 | bool is_variable = false, |
| 2869 | flatbuffers::Offset<tflite::SparsityParameters> sparsity = 0, |
| 2870 | const std::vector<int32_t> *shape_signature = nullptr) { |
| 2871 | auto shape__ = shape ? _fbb.CreateVector<int32_t>(*shape) : 0; |
| 2872 | auto name__ = name ? _fbb.CreateString(name) : 0; |
| 2873 | auto shape_signature__ = shape_signature ? _fbb.CreateVector<int32_t>(*shape_signature) : 0; |
| 2874 | return tflite::CreateTensor( |
| 2875 | _fbb, |
| 2876 | shape__, |
| 2877 | type, |
| 2878 | buffer, |
| 2879 | name__, |
| 2880 | quantization, |
| 2881 | is_variable, |
| 2882 | sparsity, |
| 2883 | shape_signature__); |
| 2884 | } |
| 2885 | |
| 2886 | struct Conv2DOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 2887 | typedef Conv2DOptionsBuilder Builder; |
| 2888 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 2889 | VT_PADDING = 4, |
| 2890 | VT_STRIDE_W = 6, |
| 2891 | VT_STRIDE_H = 8, |
| 2892 | VT_FUSED_ACTIVATION_FUNCTION = 10, |
| 2893 | VT_DILATION_W_FACTOR = 12, |
| 2894 | VT_DILATION_H_FACTOR = 14 |
| 2895 | }; |
| 2896 | tflite::Padding padding() const { |
| 2897 | return static_cast<tflite::Padding>(GetField<int8_t>(VT_PADDING, 0)); |
| 2898 | } |
| 2899 | int32_t stride_w() const { |
| 2900 | return GetField<int32_t>(VT_STRIDE_W, 0); |
| 2901 | } |
| 2902 | int32_t stride_h() const { |
| 2903 | return GetField<int32_t>(VT_STRIDE_H, 0); |
| 2904 | } |
| 2905 | tflite::ActivationFunctionType fused_activation_function() const { |
| 2906 | return static_cast<tflite::ActivationFunctionType>(GetField<int8_t>(VT_FUSED_ACTIVATION_FUNCTION, 0)); |
| 2907 | } |
| 2908 | int32_t dilation_w_factor() const { |
| 2909 | return GetField<int32_t>(VT_DILATION_W_FACTOR, 1); |
| 2910 | } |
| 2911 | int32_t dilation_h_factor() const { |
| 2912 | return GetField<int32_t>(VT_DILATION_H_FACTOR, 1); |
| 2913 | } |
| 2914 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 2915 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 2916 | VerifyField<int8_t>(verifier, VT_PADDING, 1) && |
| 2917 | VerifyField<int32_t>(verifier, VT_STRIDE_W, 4) && |
| 2918 | VerifyField<int32_t>(verifier, VT_STRIDE_H, 4) && |
| 2919 | VerifyField<int8_t>(verifier, VT_FUSED_ACTIVATION_FUNCTION, 1) && |
| 2920 | VerifyField<int32_t>(verifier, VT_DILATION_W_FACTOR, 4) && |
| 2921 | VerifyField<int32_t>(verifier, VT_DILATION_H_FACTOR, 4) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 2922 | verifier.EndTable(); |
| 2923 | } |
| 2924 | }; |
| 2925 | |
| 2926 | struct Conv2DOptionsBuilder { |
| 2927 | typedef Conv2DOptions Table; |
| 2928 | flatbuffers::FlatBufferBuilder &fbb_; |
| 2929 | flatbuffers::uoffset_t start_; |
| 2930 | void add_padding(tflite::Padding padding) { |
| 2931 | fbb_.AddElement<int8_t>(Conv2DOptions::VT_PADDING, static_cast<int8_t>(padding), 0); |
| 2932 | } |
| 2933 | void add_stride_w(int32_t stride_w) { |
| 2934 | fbb_.AddElement<int32_t>(Conv2DOptions::VT_STRIDE_W, stride_w, 0); |
| 2935 | } |
| 2936 | void add_stride_h(int32_t stride_h) { |
| 2937 | fbb_.AddElement<int32_t>(Conv2DOptions::VT_STRIDE_H, stride_h, 0); |
| 2938 | } |
| 2939 | void add_fused_activation_function(tflite::ActivationFunctionType fused_activation_function) { |
| 2940 | fbb_.AddElement<int8_t>(Conv2DOptions::VT_FUSED_ACTIVATION_FUNCTION, static_cast<int8_t>(fused_activation_function), 0); |
| 2941 | } |
| 2942 | void add_dilation_w_factor(int32_t dilation_w_factor) { |
| 2943 | fbb_.AddElement<int32_t>(Conv2DOptions::VT_DILATION_W_FACTOR, dilation_w_factor, 1); |
| 2944 | } |
| 2945 | void add_dilation_h_factor(int32_t dilation_h_factor) { |
| 2946 | fbb_.AddElement<int32_t>(Conv2DOptions::VT_DILATION_H_FACTOR, dilation_h_factor, 1); |
| 2947 | } |
| 2948 | explicit Conv2DOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 2949 | : fbb_(_fbb) { |
| 2950 | start_ = fbb_.StartTable(); |
| 2951 | } |
| 2952 | flatbuffers::Offset<Conv2DOptions> Finish() { |
| 2953 | const auto end = fbb_.EndTable(start_); |
| 2954 | auto o = flatbuffers::Offset<Conv2DOptions>(end); |
| 2955 | return o; |
| 2956 | } |
| 2957 | }; |
| 2958 | |
| 2959 | inline flatbuffers::Offset<Conv2DOptions> CreateConv2DOptions( |
| 2960 | flatbuffers::FlatBufferBuilder &_fbb, |
| 2961 | tflite::Padding padding = tflite::Padding_SAME, |
| 2962 | int32_t stride_w = 0, |
| 2963 | int32_t stride_h = 0, |
| 2964 | tflite::ActivationFunctionType fused_activation_function = tflite::ActivationFunctionType_NONE, |
| 2965 | int32_t dilation_w_factor = 1, |
| 2966 | int32_t dilation_h_factor = 1) { |
| 2967 | Conv2DOptionsBuilder builder_(_fbb); |
| 2968 | builder_.add_dilation_h_factor(dilation_h_factor); |
| 2969 | builder_.add_dilation_w_factor(dilation_w_factor); |
| 2970 | builder_.add_stride_h(stride_h); |
| 2971 | builder_.add_stride_w(stride_w); |
| 2972 | builder_.add_fused_activation_function(fused_activation_function); |
| 2973 | builder_.add_padding(padding); |
| 2974 | return builder_.Finish(); |
| 2975 | } |
| 2976 | |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 2977 | struct Conv3DOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 2978 | typedef Conv3DOptionsBuilder Builder; |
| 2979 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 2980 | VT_PADDING = 4, |
| 2981 | VT_STRIDE_D = 6, |
| 2982 | VT_STRIDE_W = 8, |
| 2983 | VT_STRIDE_H = 10, |
| 2984 | VT_FUSED_ACTIVATION_FUNCTION = 12, |
| 2985 | VT_DILATION_D_FACTOR = 14, |
| 2986 | VT_DILATION_W_FACTOR = 16, |
| 2987 | VT_DILATION_H_FACTOR = 18 |
| 2988 | }; |
| 2989 | tflite::Padding padding() const { |
| 2990 | return static_cast<tflite::Padding>(GetField<int8_t>(VT_PADDING, 0)); |
| 2991 | } |
| 2992 | int32_t stride_d() const { |
| 2993 | return GetField<int32_t>(VT_STRIDE_D, 0); |
| 2994 | } |
| 2995 | int32_t stride_w() const { |
| 2996 | return GetField<int32_t>(VT_STRIDE_W, 0); |
| 2997 | } |
| 2998 | int32_t stride_h() const { |
| 2999 | return GetField<int32_t>(VT_STRIDE_H, 0); |
| 3000 | } |
| 3001 | tflite::ActivationFunctionType fused_activation_function() const { |
| 3002 | return static_cast<tflite::ActivationFunctionType>(GetField<int8_t>(VT_FUSED_ACTIVATION_FUNCTION, 0)); |
| 3003 | } |
| 3004 | int32_t dilation_d_factor() const { |
| 3005 | return GetField<int32_t>(VT_DILATION_D_FACTOR, 1); |
| 3006 | } |
| 3007 | int32_t dilation_w_factor() const { |
| 3008 | return GetField<int32_t>(VT_DILATION_W_FACTOR, 1); |
| 3009 | } |
| 3010 | int32_t dilation_h_factor() const { |
| 3011 | return GetField<int32_t>(VT_DILATION_H_FACTOR, 1); |
| 3012 | } |
| 3013 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 3014 | return VerifyTableStart(verifier) && |
| 3015 | VerifyField<int8_t>(verifier, VT_PADDING, 1) && |
| 3016 | VerifyField<int32_t>(verifier, VT_STRIDE_D, 4) && |
| 3017 | VerifyField<int32_t>(verifier, VT_STRIDE_W, 4) && |
| 3018 | VerifyField<int32_t>(verifier, VT_STRIDE_H, 4) && |
| 3019 | VerifyField<int8_t>(verifier, VT_FUSED_ACTIVATION_FUNCTION, 1) && |
| 3020 | VerifyField<int32_t>(verifier, VT_DILATION_D_FACTOR, 4) && |
| 3021 | VerifyField<int32_t>(verifier, VT_DILATION_W_FACTOR, 4) && |
| 3022 | VerifyField<int32_t>(verifier, VT_DILATION_H_FACTOR, 4) && |
| 3023 | verifier.EndTable(); |
| 3024 | } |
| 3025 | }; |
| 3026 | |
| 3027 | struct Conv3DOptionsBuilder { |
| 3028 | typedef Conv3DOptions Table; |
| 3029 | flatbuffers::FlatBufferBuilder &fbb_; |
| 3030 | flatbuffers::uoffset_t start_; |
| 3031 | void add_padding(tflite::Padding padding) { |
| 3032 | fbb_.AddElement<int8_t>(Conv3DOptions::VT_PADDING, static_cast<int8_t>(padding), 0); |
| 3033 | } |
| 3034 | void add_stride_d(int32_t stride_d) { |
| 3035 | fbb_.AddElement<int32_t>(Conv3DOptions::VT_STRIDE_D, stride_d, 0); |
| 3036 | } |
| 3037 | void add_stride_w(int32_t stride_w) { |
| 3038 | fbb_.AddElement<int32_t>(Conv3DOptions::VT_STRIDE_W, stride_w, 0); |
| 3039 | } |
| 3040 | void add_stride_h(int32_t stride_h) { |
| 3041 | fbb_.AddElement<int32_t>(Conv3DOptions::VT_STRIDE_H, stride_h, 0); |
| 3042 | } |
| 3043 | void add_fused_activation_function(tflite::ActivationFunctionType fused_activation_function) { |
| 3044 | fbb_.AddElement<int8_t>(Conv3DOptions::VT_FUSED_ACTIVATION_FUNCTION, static_cast<int8_t>(fused_activation_function), 0); |
| 3045 | } |
| 3046 | void add_dilation_d_factor(int32_t dilation_d_factor) { |
| 3047 | fbb_.AddElement<int32_t>(Conv3DOptions::VT_DILATION_D_FACTOR, dilation_d_factor, 1); |
| 3048 | } |
| 3049 | void add_dilation_w_factor(int32_t dilation_w_factor) { |
| 3050 | fbb_.AddElement<int32_t>(Conv3DOptions::VT_DILATION_W_FACTOR, dilation_w_factor, 1); |
| 3051 | } |
| 3052 | void add_dilation_h_factor(int32_t dilation_h_factor) { |
| 3053 | fbb_.AddElement<int32_t>(Conv3DOptions::VT_DILATION_H_FACTOR, dilation_h_factor, 1); |
| 3054 | } |
| 3055 | explicit Conv3DOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 3056 | : fbb_(_fbb) { |
| 3057 | start_ = fbb_.StartTable(); |
| 3058 | } |
| 3059 | flatbuffers::Offset<Conv3DOptions> Finish() { |
| 3060 | const auto end = fbb_.EndTable(start_); |
| 3061 | auto o = flatbuffers::Offset<Conv3DOptions>(end); |
| 3062 | return o; |
| 3063 | } |
| 3064 | }; |
| 3065 | |
| 3066 | inline flatbuffers::Offset<Conv3DOptions> CreateConv3DOptions( |
| 3067 | flatbuffers::FlatBufferBuilder &_fbb, |
| 3068 | tflite::Padding padding = tflite::Padding_SAME, |
| 3069 | int32_t stride_d = 0, |
| 3070 | int32_t stride_w = 0, |
| 3071 | int32_t stride_h = 0, |
| 3072 | tflite::ActivationFunctionType fused_activation_function = tflite::ActivationFunctionType_NONE, |
| 3073 | int32_t dilation_d_factor = 1, |
| 3074 | int32_t dilation_w_factor = 1, |
| 3075 | int32_t dilation_h_factor = 1) { |
| 3076 | Conv3DOptionsBuilder builder_(_fbb); |
| 3077 | builder_.add_dilation_h_factor(dilation_h_factor); |
| 3078 | builder_.add_dilation_w_factor(dilation_w_factor); |
| 3079 | builder_.add_dilation_d_factor(dilation_d_factor); |
| 3080 | builder_.add_stride_h(stride_h); |
| 3081 | builder_.add_stride_w(stride_w); |
| 3082 | builder_.add_stride_d(stride_d); |
| 3083 | builder_.add_fused_activation_function(fused_activation_function); |
| 3084 | builder_.add_padding(padding); |
| 3085 | return builder_.Finish(); |
| 3086 | } |
| 3087 | |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 3088 | struct Pool2DOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 3089 | typedef Pool2DOptionsBuilder Builder; |
| 3090 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 3091 | VT_PADDING = 4, |
| 3092 | VT_STRIDE_W = 6, |
| 3093 | VT_STRIDE_H = 8, |
| 3094 | VT_FILTER_WIDTH = 10, |
| 3095 | VT_FILTER_HEIGHT = 12, |
| 3096 | VT_FUSED_ACTIVATION_FUNCTION = 14 |
| 3097 | }; |
| 3098 | tflite::Padding padding() const { |
| 3099 | return static_cast<tflite::Padding>(GetField<int8_t>(VT_PADDING, 0)); |
| 3100 | } |
| 3101 | int32_t stride_w() const { |
| 3102 | return GetField<int32_t>(VT_STRIDE_W, 0); |
| 3103 | } |
| 3104 | int32_t stride_h() const { |
| 3105 | return GetField<int32_t>(VT_STRIDE_H, 0); |
| 3106 | } |
| 3107 | int32_t filter_width() const { |
| 3108 | return GetField<int32_t>(VT_FILTER_WIDTH, 0); |
| 3109 | } |
| 3110 | int32_t filter_height() const { |
| 3111 | return GetField<int32_t>(VT_FILTER_HEIGHT, 0); |
| 3112 | } |
| 3113 | tflite::ActivationFunctionType fused_activation_function() const { |
| 3114 | return static_cast<tflite::ActivationFunctionType>(GetField<int8_t>(VT_FUSED_ACTIVATION_FUNCTION, 0)); |
| 3115 | } |
| 3116 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 3117 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 3118 | VerifyField<int8_t>(verifier, VT_PADDING, 1) && |
| 3119 | VerifyField<int32_t>(verifier, VT_STRIDE_W, 4) && |
| 3120 | VerifyField<int32_t>(verifier, VT_STRIDE_H, 4) && |
| 3121 | VerifyField<int32_t>(verifier, VT_FILTER_WIDTH, 4) && |
| 3122 | VerifyField<int32_t>(verifier, VT_FILTER_HEIGHT, 4) && |
| 3123 | VerifyField<int8_t>(verifier, VT_FUSED_ACTIVATION_FUNCTION, 1) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 3124 | verifier.EndTable(); |
| 3125 | } |
| 3126 | }; |
| 3127 | |
| 3128 | struct Pool2DOptionsBuilder { |
| 3129 | typedef Pool2DOptions Table; |
| 3130 | flatbuffers::FlatBufferBuilder &fbb_; |
| 3131 | flatbuffers::uoffset_t start_; |
| 3132 | void add_padding(tflite::Padding padding) { |
| 3133 | fbb_.AddElement<int8_t>(Pool2DOptions::VT_PADDING, static_cast<int8_t>(padding), 0); |
| 3134 | } |
| 3135 | void add_stride_w(int32_t stride_w) { |
| 3136 | fbb_.AddElement<int32_t>(Pool2DOptions::VT_STRIDE_W, stride_w, 0); |
| 3137 | } |
| 3138 | void add_stride_h(int32_t stride_h) { |
| 3139 | fbb_.AddElement<int32_t>(Pool2DOptions::VT_STRIDE_H, stride_h, 0); |
| 3140 | } |
| 3141 | void add_filter_width(int32_t filter_width) { |
| 3142 | fbb_.AddElement<int32_t>(Pool2DOptions::VT_FILTER_WIDTH, filter_width, 0); |
| 3143 | } |
| 3144 | void add_filter_height(int32_t filter_height) { |
| 3145 | fbb_.AddElement<int32_t>(Pool2DOptions::VT_FILTER_HEIGHT, filter_height, 0); |
| 3146 | } |
| 3147 | void add_fused_activation_function(tflite::ActivationFunctionType fused_activation_function) { |
| 3148 | fbb_.AddElement<int8_t>(Pool2DOptions::VT_FUSED_ACTIVATION_FUNCTION, static_cast<int8_t>(fused_activation_function), 0); |
| 3149 | } |
| 3150 | explicit Pool2DOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 3151 | : fbb_(_fbb) { |
| 3152 | start_ = fbb_.StartTable(); |
| 3153 | } |
| 3154 | flatbuffers::Offset<Pool2DOptions> Finish() { |
| 3155 | const auto end = fbb_.EndTable(start_); |
| 3156 | auto o = flatbuffers::Offset<Pool2DOptions>(end); |
| 3157 | return o; |
| 3158 | } |
| 3159 | }; |
| 3160 | |
| 3161 | inline flatbuffers::Offset<Pool2DOptions> CreatePool2DOptions( |
| 3162 | flatbuffers::FlatBufferBuilder &_fbb, |
| 3163 | tflite::Padding padding = tflite::Padding_SAME, |
| 3164 | int32_t stride_w = 0, |
| 3165 | int32_t stride_h = 0, |
| 3166 | int32_t filter_width = 0, |
| 3167 | int32_t filter_height = 0, |
| 3168 | tflite::ActivationFunctionType fused_activation_function = tflite::ActivationFunctionType_NONE) { |
| 3169 | Pool2DOptionsBuilder builder_(_fbb); |
| 3170 | builder_.add_filter_height(filter_height); |
| 3171 | builder_.add_filter_width(filter_width); |
| 3172 | builder_.add_stride_h(stride_h); |
| 3173 | builder_.add_stride_w(stride_w); |
| 3174 | builder_.add_fused_activation_function(fused_activation_function); |
| 3175 | builder_.add_padding(padding); |
| 3176 | return builder_.Finish(); |
| 3177 | } |
| 3178 | |
| 3179 | struct DepthwiseConv2DOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 3180 | typedef DepthwiseConv2DOptionsBuilder Builder; |
| 3181 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 3182 | VT_PADDING = 4, |
| 3183 | VT_STRIDE_W = 6, |
| 3184 | VT_STRIDE_H = 8, |
| 3185 | VT_DEPTH_MULTIPLIER = 10, |
| 3186 | VT_FUSED_ACTIVATION_FUNCTION = 12, |
| 3187 | VT_DILATION_W_FACTOR = 14, |
| 3188 | VT_DILATION_H_FACTOR = 16 |
| 3189 | }; |
| 3190 | tflite::Padding padding() const { |
| 3191 | return static_cast<tflite::Padding>(GetField<int8_t>(VT_PADDING, 0)); |
| 3192 | } |
| 3193 | int32_t stride_w() const { |
| 3194 | return GetField<int32_t>(VT_STRIDE_W, 0); |
| 3195 | } |
| 3196 | int32_t stride_h() const { |
| 3197 | return GetField<int32_t>(VT_STRIDE_H, 0); |
| 3198 | } |
| 3199 | int32_t depth_multiplier() const { |
| 3200 | return GetField<int32_t>(VT_DEPTH_MULTIPLIER, 0); |
| 3201 | } |
| 3202 | tflite::ActivationFunctionType fused_activation_function() const { |
| 3203 | return static_cast<tflite::ActivationFunctionType>(GetField<int8_t>(VT_FUSED_ACTIVATION_FUNCTION, 0)); |
| 3204 | } |
| 3205 | int32_t dilation_w_factor() const { |
| 3206 | return GetField<int32_t>(VT_DILATION_W_FACTOR, 1); |
| 3207 | } |
| 3208 | int32_t dilation_h_factor() const { |
| 3209 | return GetField<int32_t>(VT_DILATION_H_FACTOR, 1); |
| 3210 | } |
| 3211 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 3212 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 3213 | VerifyField<int8_t>(verifier, VT_PADDING, 1) && |
| 3214 | VerifyField<int32_t>(verifier, VT_STRIDE_W, 4) && |
| 3215 | VerifyField<int32_t>(verifier, VT_STRIDE_H, 4) && |
| 3216 | VerifyField<int32_t>(verifier, VT_DEPTH_MULTIPLIER, 4) && |
| 3217 | VerifyField<int8_t>(verifier, VT_FUSED_ACTIVATION_FUNCTION, 1) && |
| 3218 | VerifyField<int32_t>(verifier, VT_DILATION_W_FACTOR, 4) && |
| 3219 | VerifyField<int32_t>(verifier, VT_DILATION_H_FACTOR, 4) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 3220 | verifier.EndTable(); |
| 3221 | } |
| 3222 | }; |
| 3223 | |
| 3224 | struct DepthwiseConv2DOptionsBuilder { |
| 3225 | typedef DepthwiseConv2DOptions Table; |
| 3226 | flatbuffers::FlatBufferBuilder &fbb_; |
| 3227 | flatbuffers::uoffset_t start_; |
| 3228 | void add_padding(tflite::Padding padding) { |
| 3229 | fbb_.AddElement<int8_t>(DepthwiseConv2DOptions::VT_PADDING, static_cast<int8_t>(padding), 0); |
| 3230 | } |
| 3231 | void add_stride_w(int32_t stride_w) { |
| 3232 | fbb_.AddElement<int32_t>(DepthwiseConv2DOptions::VT_STRIDE_W, stride_w, 0); |
| 3233 | } |
| 3234 | void add_stride_h(int32_t stride_h) { |
| 3235 | fbb_.AddElement<int32_t>(DepthwiseConv2DOptions::VT_STRIDE_H, stride_h, 0); |
| 3236 | } |
| 3237 | void add_depth_multiplier(int32_t depth_multiplier) { |
| 3238 | fbb_.AddElement<int32_t>(DepthwiseConv2DOptions::VT_DEPTH_MULTIPLIER, depth_multiplier, 0); |
| 3239 | } |
| 3240 | void add_fused_activation_function(tflite::ActivationFunctionType fused_activation_function) { |
| 3241 | fbb_.AddElement<int8_t>(DepthwiseConv2DOptions::VT_FUSED_ACTIVATION_FUNCTION, static_cast<int8_t>(fused_activation_function), 0); |
| 3242 | } |
| 3243 | void add_dilation_w_factor(int32_t dilation_w_factor) { |
| 3244 | fbb_.AddElement<int32_t>(DepthwiseConv2DOptions::VT_DILATION_W_FACTOR, dilation_w_factor, 1); |
| 3245 | } |
| 3246 | void add_dilation_h_factor(int32_t dilation_h_factor) { |
| 3247 | fbb_.AddElement<int32_t>(DepthwiseConv2DOptions::VT_DILATION_H_FACTOR, dilation_h_factor, 1); |
| 3248 | } |
| 3249 | explicit DepthwiseConv2DOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 3250 | : fbb_(_fbb) { |
| 3251 | start_ = fbb_.StartTable(); |
| 3252 | } |
| 3253 | flatbuffers::Offset<DepthwiseConv2DOptions> Finish() { |
| 3254 | const auto end = fbb_.EndTable(start_); |
| 3255 | auto o = flatbuffers::Offset<DepthwiseConv2DOptions>(end); |
| 3256 | return o; |
| 3257 | } |
| 3258 | }; |
| 3259 | |
| 3260 | inline flatbuffers::Offset<DepthwiseConv2DOptions> CreateDepthwiseConv2DOptions( |
| 3261 | flatbuffers::FlatBufferBuilder &_fbb, |
| 3262 | tflite::Padding padding = tflite::Padding_SAME, |
| 3263 | int32_t stride_w = 0, |
| 3264 | int32_t stride_h = 0, |
| 3265 | int32_t depth_multiplier = 0, |
| 3266 | tflite::ActivationFunctionType fused_activation_function = tflite::ActivationFunctionType_NONE, |
| 3267 | int32_t dilation_w_factor = 1, |
| 3268 | int32_t dilation_h_factor = 1) { |
| 3269 | DepthwiseConv2DOptionsBuilder builder_(_fbb); |
| 3270 | builder_.add_dilation_h_factor(dilation_h_factor); |
| 3271 | builder_.add_dilation_w_factor(dilation_w_factor); |
| 3272 | builder_.add_depth_multiplier(depth_multiplier); |
| 3273 | builder_.add_stride_h(stride_h); |
| 3274 | builder_.add_stride_w(stride_w); |
| 3275 | builder_.add_fused_activation_function(fused_activation_function); |
| 3276 | builder_.add_padding(padding); |
| 3277 | return builder_.Finish(); |
| 3278 | } |
| 3279 | |
| 3280 | struct ConcatEmbeddingsOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 3281 | typedef ConcatEmbeddingsOptionsBuilder Builder; |
| 3282 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 3283 | VT_NUM_CHANNELS = 4, |
| 3284 | VT_NUM_COLUMNS_PER_CHANNEL = 6, |
| 3285 | VT_EMBEDDING_DIM_PER_CHANNEL = 8 |
| 3286 | }; |
| 3287 | int32_t num_channels() const { |
| 3288 | return GetField<int32_t>(VT_NUM_CHANNELS, 0); |
| 3289 | } |
| 3290 | const flatbuffers::Vector<int32_t> *num_columns_per_channel() const { |
| 3291 | return GetPointer<const flatbuffers::Vector<int32_t> *>(VT_NUM_COLUMNS_PER_CHANNEL); |
| 3292 | } |
| 3293 | const flatbuffers::Vector<int32_t> *embedding_dim_per_channel() const { |
| 3294 | return GetPointer<const flatbuffers::Vector<int32_t> *>(VT_EMBEDDING_DIM_PER_CHANNEL); |
| 3295 | } |
| 3296 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 3297 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 3298 | VerifyField<int32_t>(verifier, VT_NUM_CHANNELS, 4) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 3299 | VerifyOffset(verifier, VT_NUM_COLUMNS_PER_CHANNEL) && |
| 3300 | verifier.VerifyVector(num_columns_per_channel()) && |
| 3301 | VerifyOffset(verifier, VT_EMBEDDING_DIM_PER_CHANNEL) && |
| 3302 | verifier.VerifyVector(embedding_dim_per_channel()) && |
| 3303 | verifier.EndTable(); |
| 3304 | } |
| 3305 | }; |
| 3306 | |
| 3307 | struct ConcatEmbeddingsOptionsBuilder { |
| 3308 | typedef ConcatEmbeddingsOptions Table; |
| 3309 | flatbuffers::FlatBufferBuilder &fbb_; |
| 3310 | flatbuffers::uoffset_t start_; |
| 3311 | void add_num_channels(int32_t num_channels) { |
| 3312 | fbb_.AddElement<int32_t>(ConcatEmbeddingsOptions::VT_NUM_CHANNELS, num_channels, 0); |
| 3313 | } |
| 3314 | void add_num_columns_per_channel(flatbuffers::Offset<flatbuffers::Vector<int32_t>> num_columns_per_channel) { |
| 3315 | fbb_.AddOffset(ConcatEmbeddingsOptions::VT_NUM_COLUMNS_PER_CHANNEL, num_columns_per_channel); |
| 3316 | } |
| 3317 | void add_embedding_dim_per_channel(flatbuffers::Offset<flatbuffers::Vector<int32_t>> embedding_dim_per_channel) { |
| 3318 | fbb_.AddOffset(ConcatEmbeddingsOptions::VT_EMBEDDING_DIM_PER_CHANNEL, embedding_dim_per_channel); |
| 3319 | } |
| 3320 | explicit ConcatEmbeddingsOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 3321 | : fbb_(_fbb) { |
| 3322 | start_ = fbb_.StartTable(); |
| 3323 | } |
| 3324 | flatbuffers::Offset<ConcatEmbeddingsOptions> Finish() { |
| 3325 | const auto end = fbb_.EndTable(start_); |
| 3326 | auto o = flatbuffers::Offset<ConcatEmbeddingsOptions>(end); |
| 3327 | return o; |
| 3328 | } |
| 3329 | }; |
| 3330 | |
| 3331 | inline flatbuffers::Offset<ConcatEmbeddingsOptions> CreateConcatEmbeddingsOptions( |
| 3332 | flatbuffers::FlatBufferBuilder &_fbb, |
| 3333 | int32_t num_channels = 0, |
| 3334 | flatbuffers::Offset<flatbuffers::Vector<int32_t>> num_columns_per_channel = 0, |
| 3335 | flatbuffers::Offset<flatbuffers::Vector<int32_t>> embedding_dim_per_channel = 0) { |
| 3336 | ConcatEmbeddingsOptionsBuilder builder_(_fbb); |
| 3337 | builder_.add_embedding_dim_per_channel(embedding_dim_per_channel); |
| 3338 | builder_.add_num_columns_per_channel(num_columns_per_channel); |
| 3339 | builder_.add_num_channels(num_channels); |
| 3340 | return builder_.Finish(); |
| 3341 | } |
| 3342 | |
| 3343 | inline flatbuffers::Offset<ConcatEmbeddingsOptions> CreateConcatEmbeddingsOptionsDirect( |
| 3344 | flatbuffers::FlatBufferBuilder &_fbb, |
| 3345 | int32_t num_channels = 0, |
| 3346 | const std::vector<int32_t> *num_columns_per_channel = nullptr, |
| 3347 | const std::vector<int32_t> *embedding_dim_per_channel = nullptr) { |
| 3348 | auto num_columns_per_channel__ = num_columns_per_channel ? _fbb.CreateVector<int32_t>(*num_columns_per_channel) : 0; |
| 3349 | auto embedding_dim_per_channel__ = embedding_dim_per_channel ? _fbb.CreateVector<int32_t>(*embedding_dim_per_channel) : 0; |
| 3350 | return tflite::CreateConcatEmbeddingsOptions( |
| 3351 | _fbb, |
| 3352 | num_channels, |
| 3353 | num_columns_per_channel__, |
| 3354 | embedding_dim_per_channel__); |
| 3355 | } |
| 3356 | |
| 3357 | struct LSHProjectionOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 3358 | typedef LSHProjectionOptionsBuilder Builder; |
| 3359 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 3360 | VT_TYPE = 4 |
| 3361 | }; |
| 3362 | tflite::LSHProjectionType type() const { |
| 3363 | return static_cast<tflite::LSHProjectionType>(GetField<int8_t>(VT_TYPE, 0)); |
| 3364 | } |
| 3365 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 3366 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 3367 | VerifyField<int8_t>(verifier, VT_TYPE, 1) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 3368 | verifier.EndTable(); |
| 3369 | } |
| 3370 | }; |
| 3371 | |
| 3372 | struct LSHProjectionOptionsBuilder { |
| 3373 | typedef LSHProjectionOptions Table; |
| 3374 | flatbuffers::FlatBufferBuilder &fbb_; |
| 3375 | flatbuffers::uoffset_t start_; |
| 3376 | void add_type(tflite::LSHProjectionType type) { |
| 3377 | fbb_.AddElement<int8_t>(LSHProjectionOptions::VT_TYPE, static_cast<int8_t>(type), 0); |
| 3378 | } |
| 3379 | explicit LSHProjectionOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 3380 | : fbb_(_fbb) { |
| 3381 | start_ = fbb_.StartTable(); |
| 3382 | } |
| 3383 | flatbuffers::Offset<LSHProjectionOptions> Finish() { |
| 3384 | const auto end = fbb_.EndTable(start_); |
| 3385 | auto o = flatbuffers::Offset<LSHProjectionOptions>(end); |
| 3386 | return o; |
| 3387 | } |
| 3388 | }; |
| 3389 | |
| 3390 | inline flatbuffers::Offset<LSHProjectionOptions> CreateLSHProjectionOptions( |
| 3391 | flatbuffers::FlatBufferBuilder &_fbb, |
| 3392 | tflite::LSHProjectionType type = tflite::LSHProjectionType_UNKNOWN) { |
| 3393 | LSHProjectionOptionsBuilder builder_(_fbb); |
| 3394 | builder_.add_type(type); |
| 3395 | return builder_.Finish(); |
| 3396 | } |
| 3397 | |
| 3398 | struct SVDFOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 3399 | typedef SVDFOptionsBuilder Builder; |
| 3400 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 3401 | VT_RANK = 4, |
| 3402 | VT_FUSED_ACTIVATION_FUNCTION = 6, |
| 3403 | VT_ASYMMETRIC_QUANTIZE_INPUTS = 8 |
| 3404 | }; |
| 3405 | int32_t rank() const { |
| 3406 | return GetField<int32_t>(VT_RANK, 0); |
| 3407 | } |
| 3408 | tflite::ActivationFunctionType fused_activation_function() const { |
| 3409 | return static_cast<tflite::ActivationFunctionType>(GetField<int8_t>(VT_FUSED_ACTIVATION_FUNCTION, 0)); |
| 3410 | } |
| 3411 | bool asymmetric_quantize_inputs() const { |
| 3412 | return GetField<uint8_t>(VT_ASYMMETRIC_QUANTIZE_INPUTS, 0) != 0; |
| 3413 | } |
| 3414 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 3415 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 3416 | VerifyField<int32_t>(verifier, VT_RANK, 4) && |
| 3417 | VerifyField<int8_t>(verifier, VT_FUSED_ACTIVATION_FUNCTION, 1) && |
| 3418 | VerifyField<uint8_t>(verifier, VT_ASYMMETRIC_QUANTIZE_INPUTS, 1) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 3419 | verifier.EndTable(); |
| 3420 | } |
| 3421 | }; |
| 3422 | |
| 3423 | struct SVDFOptionsBuilder { |
| 3424 | typedef SVDFOptions Table; |
| 3425 | flatbuffers::FlatBufferBuilder &fbb_; |
| 3426 | flatbuffers::uoffset_t start_; |
| 3427 | void add_rank(int32_t rank) { |
| 3428 | fbb_.AddElement<int32_t>(SVDFOptions::VT_RANK, rank, 0); |
| 3429 | } |
| 3430 | void add_fused_activation_function(tflite::ActivationFunctionType fused_activation_function) { |
| 3431 | fbb_.AddElement<int8_t>(SVDFOptions::VT_FUSED_ACTIVATION_FUNCTION, static_cast<int8_t>(fused_activation_function), 0); |
| 3432 | } |
| 3433 | void add_asymmetric_quantize_inputs(bool asymmetric_quantize_inputs) { |
| 3434 | fbb_.AddElement<uint8_t>(SVDFOptions::VT_ASYMMETRIC_QUANTIZE_INPUTS, static_cast<uint8_t>(asymmetric_quantize_inputs), 0); |
| 3435 | } |
| 3436 | explicit SVDFOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 3437 | : fbb_(_fbb) { |
| 3438 | start_ = fbb_.StartTable(); |
| 3439 | } |
| 3440 | flatbuffers::Offset<SVDFOptions> Finish() { |
| 3441 | const auto end = fbb_.EndTable(start_); |
| 3442 | auto o = flatbuffers::Offset<SVDFOptions>(end); |
| 3443 | return o; |
| 3444 | } |
| 3445 | }; |
| 3446 | |
| 3447 | inline flatbuffers::Offset<SVDFOptions> CreateSVDFOptions( |
| 3448 | flatbuffers::FlatBufferBuilder &_fbb, |
| 3449 | int32_t rank = 0, |
| 3450 | tflite::ActivationFunctionType fused_activation_function = tflite::ActivationFunctionType_NONE, |
| 3451 | bool asymmetric_quantize_inputs = false) { |
| 3452 | SVDFOptionsBuilder builder_(_fbb); |
| 3453 | builder_.add_rank(rank); |
| 3454 | builder_.add_asymmetric_quantize_inputs(asymmetric_quantize_inputs); |
| 3455 | builder_.add_fused_activation_function(fused_activation_function); |
| 3456 | return builder_.Finish(); |
| 3457 | } |
| 3458 | |
| 3459 | struct RNNOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 3460 | typedef RNNOptionsBuilder Builder; |
| 3461 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 3462 | VT_FUSED_ACTIVATION_FUNCTION = 4, |
| 3463 | VT_ASYMMETRIC_QUANTIZE_INPUTS = 6 |
| 3464 | }; |
| 3465 | tflite::ActivationFunctionType fused_activation_function() const { |
| 3466 | return static_cast<tflite::ActivationFunctionType>(GetField<int8_t>(VT_FUSED_ACTIVATION_FUNCTION, 0)); |
| 3467 | } |
| 3468 | bool asymmetric_quantize_inputs() const { |
| 3469 | return GetField<uint8_t>(VT_ASYMMETRIC_QUANTIZE_INPUTS, 0) != 0; |
| 3470 | } |
| 3471 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 3472 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 3473 | VerifyField<int8_t>(verifier, VT_FUSED_ACTIVATION_FUNCTION, 1) && |
| 3474 | VerifyField<uint8_t>(verifier, VT_ASYMMETRIC_QUANTIZE_INPUTS, 1) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 3475 | verifier.EndTable(); |
| 3476 | } |
| 3477 | }; |
| 3478 | |
| 3479 | struct RNNOptionsBuilder { |
| 3480 | typedef RNNOptions Table; |
| 3481 | flatbuffers::FlatBufferBuilder &fbb_; |
| 3482 | flatbuffers::uoffset_t start_; |
| 3483 | void add_fused_activation_function(tflite::ActivationFunctionType fused_activation_function) { |
| 3484 | fbb_.AddElement<int8_t>(RNNOptions::VT_FUSED_ACTIVATION_FUNCTION, static_cast<int8_t>(fused_activation_function), 0); |
| 3485 | } |
| 3486 | void add_asymmetric_quantize_inputs(bool asymmetric_quantize_inputs) { |
| 3487 | fbb_.AddElement<uint8_t>(RNNOptions::VT_ASYMMETRIC_QUANTIZE_INPUTS, static_cast<uint8_t>(asymmetric_quantize_inputs), 0); |
| 3488 | } |
| 3489 | explicit RNNOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 3490 | : fbb_(_fbb) { |
| 3491 | start_ = fbb_.StartTable(); |
| 3492 | } |
| 3493 | flatbuffers::Offset<RNNOptions> Finish() { |
| 3494 | const auto end = fbb_.EndTable(start_); |
| 3495 | auto o = flatbuffers::Offset<RNNOptions>(end); |
| 3496 | return o; |
| 3497 | } |
| 3498 | }; |
| 3499 | |
| 3500 | inline flatbuffers::Offset<RNNOptions> CreateRNNOptions( |
| 3501 | flatbuffers::FlatBufferBuilder &_fbb, |
| 3502 | tflite::ActivationFunctionType fused_activation_function = tflite::ActivationFunctionType_NONE, |
| 3503 | bool asymmetric_quantize_inputs = false) { |
| 3504 | RNNOptionsBuilder builder_(_fbb); |
| 3505 | builder_.add_asymmetric_quantize_inputs(asymmetric_quantize_inputs); |
| 3506 | builder_.add_fused_activation_function(fused_activation_function); |
| 3507 | return builder_.Finish(); |
| 3508 | } |
| 3509 | |
| 3510 | struct SequenceRNNOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 3511 | typedef SequenceRNNOptionsBuilder Builder; |
| 3512 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 3513 | VT_TIME_MAJOR = 4, |
| 3514 | VT_FUSED_ACTIVATION_FUNCTION = 6, |
| 3515 | VT_ASYMMETRIC_QUANTIZE_INPUTS = 8 |
| 3516 | }; |
| 3517 | bool time_major() const { |
| 3518 | return GetField<uint8_t>(VT_TIME_MAJOR, 0) != 0; |
| 3519 | } |
| 3520 | tflite::ActivationFunctionType fused_activation_function() const { |
| 3521 | return static_cast<tflite::ActivationFunctionType>(GetField<int8_t>(VT_FUSED_ACTIVATION_FUNCTION, 0)); |
| 3522 | } |
| 3523 | bool asymmetric_quantize_inputs() const { |
| 3524 | return GetField<uint8_t>(VT_ASYMMETRIC_QUANTIZE_INPUTS, 0) != 0; |
| 3525 | } |
| 3526 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 3527 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 3528 | VerifyField<uint8_t>(verifier, VT_TIME_MAJOR, 1) && |
| 3529 | VerifyField<int8_t>(verifier, VT_FUSED_ACTIVATION_FUNCTION, 1) && |
| 3530 | VerifyField<uint8_t>(verifier, VT_ASYMMETRIC_QUANTIZE_INPUTS, 1) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 3531 | verifier.EndTable(); |
| 3532 | } |
| 3533 | }; |
| 3534 | |
| 3535 | struct SequenceRNNOptionsBuilder { |
| 3536 | typedef SequenceRNNOptions Table; |
| 3537 | flatbuffers::FlatBufferBuilder &fbb_; |
| 3538 | flatbuffers::uoffset_t start_; |
| 3539 | void add_time_major(bool time_major) { |
| 3540 | fbb_.AddElement<uint8_t>(SequenceRNNOptions::VT_TIME_MAJOR, static_cast<uint8_t>(time_major), 0); |
| 3541 | } |
| 3542 | void add_fused_activation_function(tflite::ActivationFunctionType fused_activation_function) { |
| 3543 | fbb_.AddElement<int8_t>(SequenceRNNOptions::VT_FUSED_ACTIVATION_FUNCTION, static_cast<int8_t>(fused_activation_function), 0); |
| 3544 | } |
| 3545 | void add_asymmetric_quantize_inputs(bool asymmetric_quantize_inputs) { |
| 3546 | fbb_.AddElement<uint8_t>(SequenceRNNOptions::VT_ASYMMETRIC_QUANTIZE_INPUTS, static_cast<uint8_t>(asymmetric_quantize_inputs), 0); |
| 3547 | } |
| 3548 | explicit SequenceRNNOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 3549 | : fbb_(_fbb) { |
| 3550 | start_ = fbb_.StartTable(); |
| 3551 | } |
| 3552 | flatbuffers::Offset<SequenceRNNOptions> Finish() { |
| 3553 | const auto end = fbb_.EndTable(start_); |
| 3554 | auto o = flatbuffers::Offset<SequenceRNNOptions>(end); |
| 3555 | return o; |
| 3556 | } |
| 3557 | }; |
| 3558 | |
| 3559 | inline flatbuffers::Offset<SequenceRNNOptions> CreateSequenceRNNOptions( |
| 3560 | flatbuffers::FlatBufferBuilder &_fbb, |
| 3561 | bool time_major = false, |
| 3562 | tflite::ActivationFunctionType fused_activation_function = tflite::ActivationFunctionType_NONE, |
| 3563 | bool asymmetric_quantize_inputs = false) { |
| 3564 | SequenceRNNOptionsBuilder builder_(_fbb); |
| 3565 | builder_.add_asymmetric_quantize_inputs(asymmetric_quantize_inputs); |
| 3566 | builder_.add_fused_activation_function(fused_activation_function); |
| 3567 | builder_.add_time_major(time_major); |
| 3568 | return builder_.Finish(); |
| 3569 | } |
| 3570 | |
| 3571 | struct BidirectionalSequenceRNNOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 3572 | typedef BidirectionalSequenceRNNOptionsBuilder Builder; |
| 3573 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 3574 | VT_TIME_MAJOR = 4, |
| 3575 | VT_FUSED_ACTIVATION_FUNCTION = 6, |
| 3576 | VT_MERGE_OUTPUTS = 8, |
| 3577 | VT_ASYMMETRIC_QUANTIZE_INPUTS = 10 |
| 3578 | }; |
| 3579 | bool time_major() const { |
| 3580 | return GetField<uint8_t>(VT_TIME_MAJOR, 0) != 0; |
| 3581 | } |
| 3582 | tflite::ActivationFunctionType fused_activation_function() const { |
| 3583 | return static_cast<tflite::ActivationFunctionType>(GetField<int8_t>(VT_FUSED_ACTIVATION_FUNCTION, 0)); |
| 3584 | } |
| 3585 | bool merge_outputs() const { |
| 3586 | return GetField<uint8_t>(VT_MERGE_OUTPUTS, 0) != 0; |
| 3587 | } |
| 3588 | bool asymmetric_quantize_inputs() const { |
| 3589 | return GetField<uint8_t>(VT_ASYMMETRIC_QUANTIZE_INPUTS, 0) != 0; |
| 3590 | } |
| 3591 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 3592 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 3593 | VerifyField<uint8_t>(verifier, VT_TIME_MAJOR, 1) && |
| 3594 | VerifyField<int8_t>(verifier, VT_FUSED_ACTIVATION_FUNCTION, 1) && |
| 3595 | VerifyField<uint8_t>(verifier, VT_MERGE_OUTPUTS, 1) && |
| 3596 | VerifyField<uint8_t>(verifier, VT_ASYMMETRIC_QUANTIZE_INPUTS, 1) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 3597 | verifier.EndTable(); |
| 3598 | } |
| 3599 | }; |
| 3600 | |
| 3601 | struct BidirectionalSequenceRNNOptionsBuilder { |
| 3602 | typedef BidirectionalSequenceRNNOptions Table; |
| 3603 | flatbuffers::FlatBufferBuilder &fbb_; |
| 3604 | flatbuffers::uoffset_t start_; |
| 3605 | void add_time_major(bool time_major) { |
| 3606 | fbb_.AddElement<uint8_t>(BidirectionalSequenceRNNOptions::VT_TIME_MAJOR, static_cast<uint8_t>(time_major), 0); |
| 3607 | } |
| 3608 | void add_fused_activation_function(tflite::ActivationFunctionType fused_activation_function) { |
| 3609 | fbb_.AddElement<int8_t>(BidirectionalSequenceRNNOptions::VT_FUSED_ACTIVATION_FUNCTION, static_cast<int8_t>(fused_activation_function), 0); |
| 3610 | } |
| 3611 | void add_merge_outputs(bool merge_outputs) { |
| 3612 | fbb_.AddElement<uint8_t>(BidirectionalSequenceRNNOptions::VT_MERGE_OUTPUTS, static_cast<uint8_t>(merge_outputs), 0); |
| 3613 | } |
| 3614 | void add_asymmetric_quantize_inputs(bool asymmetric_quantize_inputs) { |
| 3615 | fbb_.AddElement<uint8_t>(BidirectionalSequenceRNNOptions::VT_ASYMMETRIC_QUANTIZE_INPUTS, static_cast<uint8_t>(asymmetric_quantize_inputs), 0); |
| 3616 | } |
| 3617 | explicit BidirectionalSequenceRNNOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 3618 | : fbb_(_fbb) { |
| 3619 | start_ = fbb_.StartTable(); |
| 3620 | } |
| 3621 | flatbuffers::Offset<BidirectionalSequenceRNNOptions> Finish() { |
| 3622 | const auto end = fbb_.EndTable(start_); |
| 3623 | auto o = flatbuffers::Offset<BidirectionalSequenceRNNOptions>(end); |
| 3624 | return o; |
| 3625 | } |
| 3626 | }; |
| 3627 | |
| 3628 | inline flatbuffers::Offset<BidirectionalSequenceRNNOptions> CreateBidirectionalSequenceRNNOptions( |
| 3629 | flatbuffers::FlatBufferBuilder &_fbb, |
| 3630 | bool time_major = false, |
| 3631 | tflite::ActivationFunctionType fused_activation_function = tflite::ActivationFunctionType_NONE, |
| 3632 | bool merge_outputs = false, |
| 3633 | bool asymmetric_quantize_inputs = false) { |
| 3634 | BidirectionalSequenceRNNOptionsBuilder builder_(_fbb); |
| 3635 | builder_.add_asymmetric_quantize_inputs(asymmetric_quantize_inputs); |
| 3636 | builder_.add_merge_outputs(merge_outputs); |
| 3637 | builder_.add_fused_activation_function(fused_activation_function); |
| 3638 | builder_.add_time_major(time_major); |
| 3639 | return builder_.Finish(); |
| 3640 | } |
| 3641 | |
| 3642 | struct FullyConnectedOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 3643 | typedef FullyConnectedOptionsBuilder Builder; |
| 3644 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 3645 | VT_FUSED_ACTIVATION_FUNCTION = 4, |
| 3646 | VT_WEIGHTS_FORMAT = 6, |
| 3647 | VT_KEEP_NUM_DIMS = 8, |
| 3648 | VT_ASYMMETRIC_QUANTIZE_INPUTS = 10 |
| 3649 | }; |
| 3650 | tflite::ActivationFunctionType fused_activation_function() const { |
| 3651 | return static_cast<tflite::ActivationFunctionType>(GetField<int8_t>(VT_FUSED_ACTIVATION_FUNCTION, 0)); |
| 3652 | } |
| 3653 | tflite::FullyConnectedOptionsWeightsFormat weights_format() const { |
| 3654 | return static_cast<tflite::FullyConnectedOptionsWeightsFormat>(GetField<int8_t>(VT_WEIGHTS_FORMAT, 0)); |
| 3655 | } |
| 3656 | bool keep_num_dims() const { |
| 3657 | return GetField<uint8_t>(VT_KEEP_NUM_DIMS, 0) != 0; |
| 3658 | } |
| 3659 | bool asymmetric_quantize_inputs() const { |
| 3660 | return GetField<uint8_t>(VT_ASYMMETRIC_QUANTIZE_INPUTS, 0) != 0; |
| 3661 | } |
| 3662 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 3663 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 3664 | VerifyField<int8_t>(verifier, VT_FUSED_ACTIVATION_FUNCTION, 1) && |
| 3665 | VerifyField<int8_t>(verifier, VT_WEIGHTS_FORMAT, 1) && |
| 3666 | VerifyField<uint8_t>(verifier, VT_KEEP_NUM_DIMS, 1) && |
| 3667 | VerifyField<uint8_t>(verifier, VT_ASYMMETRIC_QUANTIZE_INPUTS, 1) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 3668 | verifier.EndTable(); |
| 3669 | } |
| 3670 | }; |
| 3671 | |
| 3672 | struct FullyConnectedOptionsBuilder { |
| 3673 | typedef FullyConnectedOptions Table; |
| 3674 | flatbuffers::FlatBufferBuilder &fbb_; |
| 3675 | flatbuffers::uoffset_t start_; |
| 3676 | void add_fused_activation_function(tflite::ActivationFunctionType fused_activation_function) { |
| 3677 | fbb_.AddElement<int8_t>(FullyConnectedOptions::VT_FUSED_ACTIVATION_FUNCTION, static_cast<int8_t>(fused_activation_function), 0); |
| 3678 | } |
| 3679 | void add_weights_format(tflite::FullyConnectedOptionsWeightsFormat weights_format) { |
| 3680 | fbb_.AddElement<int8_t>(FullyConnectedOptions::VT_WEIGHTS_FORMAT, static_cast<int8_t>(weights_format), 0); |
| 3681 | } |
| 3682 | void add_keep_num_dims(bool keep_num_dims) { |
| 3683 | fbb_.AddElement<uint8_t>(FullyConnectedOptions::VT_KEEP_NUM_DIMS, static_cast<uint8_t>(keep_num_dims), 0); |
| 3684 | } |
| 3685 | void add_asymmetric_quantize_inputs(bool asymmetric_quantize_inputs) { |
| 3686 | fbb_.AddElement<uint8_t>(FullyConnectedOptions::VT_ASYMMETRIC_QUANTIZE_INPUTS, static_cast<uint8_t>(asymmetric_quantize_inputs), 0); |
| 3687 | } |
| 3688 | explicit FullyConnectedOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 3689 | : fbb_(_fbb) { |
| 3690 | start_ = fbb_.StartTable(); |
| 3691 | } |
| 3692 | flatbuffers::Offset<FullyConnectedOptions> Finish() { |
| 3693 | const auto end = fbb_.EndTable(start_); |
| 3694 | auto o = flatbuffers::Offset<FullyConnectedOptions>(end); |
| 3695 | return o; |
| 3696 | } |
| 3697 | }; |
| 3698 | |
| 3699 | inline flatbuffers::Offset<FullyConnectedOptions> CreateFullyConnectedOptions( |
| 3700 | flatbuffers::FlatBufferBuilder &_fbb, |
| 3701 | tflite::ActivationFunctionType fused_activation_function = tflite::ActivationFunctionType_NONE, |
| 3702 | tflite::FullyConnectedOptionsWeightsFormat weights_format = tflite::FullyConnectedOptionsWeightsFormat_DEFAULT, |
| 3703 | bool keep_num_dims = false, |
| 3704 | bool asymmetric_quantize_inputs = false) { |
| 3705 | FullyConnectedOptionsBuilder builder_(_fbb); |
| 3706 | builder_.add_asymmetric_quantize_inputs(asymmetric_quantize_inputs); |
| 3707 | builder_.add_keep_num_dims(keep_num_dims); |
| 3708 | builder_.add_weights_format(weights_format); |
| 3709 | builder_.add_fused_activation_function(fused_activation_function); |
| 3710 | return builder_.Finish(); |
| 3711 | } |
| 3712 | |
| 3713 | struct SoftmaxOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 3714 | typedef SoftmaxOptionsBuilder Builder; |
| 3715 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 3716 | VT_BETA = 4 |
| 3717 | }; |
| 3718 | float beta() const { |
| 3719 | return GetField<float>(VT_BETA, 0.0f); |
| 3720 | } |
| 3721 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 3722 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 3723 | VerifyField<float>(verifier, VT_BETA, 4) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 3724 | verifier.EndTable(); |
| 3725 | } |
| 3726 | }; |
| 3727 | |
| 3728 | struct SoftmaxOptionsBuilder { |
| 3729 | typedef SoftmaxOptions Table; |
| 3730 | flatbuffers::FlatBufferBuilder &fbb_; |
| 3731 | flatbuffers::uoffset_t start_; |
| 3732 | void add_beta(float beta) { |
| 3733 | fbb_.AddElement<float>(SoftmaxOptions::VT_BETA, beta, 0.0f); |
| 3734 | } |
| 3735 | explicit SoftmaxOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 3736 | : fbb_(_fbb) { |
| 3737 | start_ = fbb_.StartTable(); |
| 3738 | } |
| 3739 | flatbuffers::Offset<SoftmaxOptions> Finish() { |
| 3740 | const auto end = fbb_.EndTable(start_); |
| 3741 | auto o = flatbuffers::Offset<SoftmaxOptions>(end); |
| 3742 | return o; |
| 3743 | } |
| 3744 | }; |
| 3745 | |
| 3746 | inline flatbuffers::Offset<SoftmaxOptions> CreateSoftmaxOptions( |
| 3747 | flatbuffers::FlatBufferBuilder &_fbb, |
| 3748 | float beta = 0.0f) { |
| 3749 | SoftmaxOptionsBuilder builder_(_fbb); |
| 3750 | builder_.add_beta(beta); |
| 3751 | return builder_.Finish(); |
| 3752 | } |
| 3753 | |
| 3754 | struct ConcatenationOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 3755 | typedef ConcatenationOptionsBuilder Builder; |
| 3756 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 3757 | VT_AXIS = 4, |
| 3758 | VT_FUSED_ACTIVATION_FUNCTION = 6 |
| 3759 | }; |
| 3760 | int32_t axis() const { |
| 3761 | return GetField<int32_t>(VT_AXIS, 0); |
| 3762 | } |
| 3763 | tflite::ActivationFunctionType fused_activation_function() const { |
| 3764 | return static_cast<tflite::ActivationFunctionType>(GetField<int8_t>(VT_FUSED_ACTIVATION_FUNCTION, 0)); |
| 3765 | } |
| 3766 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 3767 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 3768 | VerifyField<int32_t>(verifier, VT_AXIS, 4) && |
| 3769 | VerifyField<int8_t>(verifier, VT_FUSED_ACTIVATION_FUNCTION, 1) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 3770 | verifier.EndTable(); |
| 3771 | } |
| 3772 | }; |
| 3773 | |
| 3774 | struct ConcatenationOptionsBuilder { |
| 3775 | typedef ConcatenationOptions Table; |
| 3776 | flatbuffers::FlatBufferBuilder &fbb_; |
| 3777 | flatbuffers::uoffset_t start_; |
| 3778 | void add_axis(int32_t axis) { |
| 3779 | fbb_.AddElement<int32_t>(ConcatenationOptions::VT_AXIS, axis, 0); |
| 3780 | } |
| 3781 | void add_fused_activation_function(tflite::ActivationFunctionType fused_activation_function) { |
| 3782 | fbb_.AddElement<int8_t>(ConcatenationOptions::VT_FUSED_ACTIVATION_FUNCTION, static_cast<int8_t>(fused_activation_function), 0); |
| 3783 | } |
| 3784 | explicit ConcatenationOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 3785 | : fbb_(_fbb) { |
| 3786 | start_ = fbb_.StartTable(); |
| 3787 | } |
| 3788 | flatbuffers::Offset<ConcatenationOptions> Finish() { |
| 3789 | const auto end = fbb_.EndTable(start_); |
| 3790 | auto o = flatbuffers::Offset<ConcatenationOptions>(end); |
| 3791 | return o; |
| 3792 | } |
| 3793 | }; |
| 3794 | |
| 3795 | inline flatbuffers::Offset<ConcatenationOptions> CreateConcatenationOptions( |
| 3796 | flatbuffers::FlatBufferBuilder &_fbb, |
| 3797 | int32_t axis = 0, |
| 3798 | tflite::ActivationFunctionType fused_activation_function = tflite::ActivationFunctionType_NONE) { |
| 3799 | ConcatenationOptionsBuilder builder_(_fbb); |
| 3800 | builder_.add_axis(axis); |
| 3801 | builder_.add_fused_activation_function(fused_activation_function); |
| 3802 | return builder_.Finish(); |
| 3803 | } |
| 3804 | |
| 3805 | struct AddOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 3806 | typedef AddOptionsBuilder Builder; |
| 3807 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 3808 | VT_FUSED_ACTIVATION_FUNCTION = 4, |
| 3809 | VT_POT_SCALE_INT16 = 6 |
| 3810 | }; |
| 3811 | tflite::ActivationFunctionType fused_activation_function() const { |
| 3812 | return static_cast<tflite::ActivationFunctionType>(GetField<int8_t>(VT_FUSED_ACTIVATION_FUNCTION, 0)); |
| 3813 | } |
| 3814 | bool pot_scale_int16() const { |
| 3815 | return GetField<uint8_t>(VT_POT_SCALE_INT16, 1) != 0; |
| 3816 | } |
| 3817 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 3818 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 3819 | VerifyField<int8_t>(verifier, VT_FUSED_ACTIVATION_FUNCTION, 1) && |
| 3820 | VerifyField<uint8_t>(verifier, VT_POT_SCALE_INT16, 1) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 3821 | verifier.EndTable(); |
| 3822 | } |
| 3823 | }; |
| 3824 | |
| 3825 | struct AddOptionsBuilder { |
| 3826 | typedef AddOptions Table; |
| 3827 | flatbuffers::FlatBufferBuilder &fbb_; |
| 3828 | flatbuffers::uoffset_t start_; |
| 3829 | void add_fused_activation_function(tflite::ActivationFunctionType fused_activation_function) { |
| 3830 | fbb_.AddElement<int8_t>(AddOptions::VT_FUSED_ACTIVATION_FUNCTION, static_cast<int8_t>(fused_activation_function), 0); |
| 3831 | } |
| 3832 | void add_pot_scale_int16(bool pot_scale_int16) { |
| 3833 | fbb_.AddElement<uint8_t>(AddOptions::VT_POT_SCALE_INT16, static_cast<uint8_t>(pot_scale_int16), 1); |
| 3834 | } |
| 3835 | explicit AddOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 3836 | : fbb_(_fbb) { |
| 3837 | start_ = fbb_.StartTable(); |
| 3838 | } |
| 3839 | flatbuffers::Offset<AddOptions> Finish() { |
| 3840 | const auto end = fbb_.EndTable(start_); |
| 3841 | auto o = flatbuffers::Offset<AddOptions>(end); |
| 3842 | return o; |
| 3843 | } |
| 3844 | }; |
| 3845 | |
| 3846 | inline flatbuffers::Offset<AddOptions> CreateAddOptions( |
| 3847 | flatbuffers::FlatBufferBuilder &_fbb, |
| 3848 | tflite::ActivationFunctionType fused_activation_function = tflite::ActivationFunctionType_NONE, |
| 3849 | bool pot_scale_int16 = true) { |
| 3850 | AddOptionsBuilder builder_(_fbb); |
| 3851 | builder_.add_pot_scale_int16(pot_scale_int16); |
| 3852 | builder_.add_fused_activation_function(fused_activation_function); |
| 3853 | return builder_.Finish(); |
| 3854 | } |
| 3855 | |
| 3856 | struct MulOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 3857 | typedef MulOptionsBuilder Builder; |
| 3858 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 3859 | VT_FUSED_ACTIVATION_FUNCTION = 4 |
| 3860 | }; |
| 3861 | tflite::ActivationFunctionType fused_activation_function() const { |
| 3862 | return static_cast<tflite::ActivationFunctionType>(GetField<int8_t>(VT_FUSED_ACTIVATION_FUNCTION, 0)); |
| 3863 | } |
| 3864 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 3865 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 3866 | VerifyField<int8_t>(verifier, VT_FUSED_ACTIVATION_FUNCTION, 1) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 3867 | verifier.EndTable(); |
| 3868 | } |
| 3869 | }; |
| 3870 | |
| 3871 | struct MulOptionsBuilder { |
| 3872 | typedef MulOptions Table; |
| 3873 | flatbuffers::FlatBufferBuilder &fbb_; |
| 3874 | flatbuffers::uoffset_t start_; |
| 3875 | void add_fused_activation_function(tflite::ActivationFunctionType fused_activation_function) { |
| 3876 | fbb_.AddElement<int8_t>(MulOptions::VT_FUSED_ACTIVATION_FUNCTION, static_cast<int8_t>(fused_activation_function), 0); |
| 3877 | } |
| 3878 | explicit MulOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 3879 | : fbb_(_fbb) { |
| 3880 | start_ = fbb_.StartTable(); |
| 3881 | } |
| 3882 | flatbuffers::Offset<MulOptions> Finish() { |
| 3883 | const auto end = fbb_.EndTable(start_); |
| 3884 | auto o = flatbuffers::Offset<MulOptions>(end); |
| 3885 | return o; |
| 3886 | } |
| 3887 | }; |
| 3888 | |
| 3889 | inline flatbuffers::Offset<MulOptions> CreateMulOptions( |
| 3890 | flatbuffers::FlatBufferBuilder &_fbb, |
| 3891 | tflite::ActivationFunctionType fused_activation_function = tflite::ActivationFunctionType_NONE) { |
| 3892 | MulOptionsBuilder builder_(_fbb); |
| 3893 | builder_.add_fused_activation_function(fused_activation_function); |
| 3894 | return builder_.Finish(); |
| 3895 | } |
| 3896 | |
| 3897 | struct L2NormOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 3898 | typedef L2NormOptionsBuilder Builder; |
| 3899 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 3900 | VT_FUSED_ACTIVATION_FUNCTION = 4 |
| 3901 | }; |
| 3902 | tflite::ActivationFunctionType fused_activation_function() const { |
| 3903 | return static_cast<tflite::ActivationFunctionType>(GetField<int8_t>(VT_FUSED_ACTIVATION_FUNCTION, 0)); |
| 3904 | } |
| 3905 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 3906 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 3907 | VerifyField<int8_t>(verifier, VT_FUSED_ACTIVATION_FUNCTION, 1) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 3908 | verifier.EndTable(); |
| 3909 | } |
| 3910 | }; |
| 3911 | |
| 3912 | struct L2NormOptionsBuilder { |
| 3913 | typedef L2NormOptions Table; |
| 3914 | flatbuffers::FlatBufferBuilder &fbb_; |
| 3915 | flatbuffers::uoffset_t start_; |
| 3916 | void add_fused_activation_function(tflite::ActivationFunctionType fused_activation_function) { |
| 3917 | fbb_.AddElement<int8_t>(L2NormOptions::VT_FUSED_ACTIVATION_FUNCTION, static_cast<int8_t>(fused_activation_function), 0); |
| 3918 | } |
| 3919 | explicit L2NormOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 3920 | : fbb_(_fbb) { |
| 3921 | start_ = fbb_.StartTable(); |
| 3922 | } |
| 3923 | flatbuffers::Offset<L2NormOptions> Finish() { |
| 3924 | const auto end = fbb_.EndTable(start_); |
| 3925 | auto o = flatbuffers::Offset<L2NormOptions>(end); |
| 3926 | return o; |
| 3927 | } |
| 3928 | }; |
| 3929 | |
| 3930 | inline flatbuffers::Offset<L2NormOptions> CreateL2NormOptions( |
| 3931 | flatbuffers::FlatBufferBuilder &_fbb, |
| 3932 | tflite::ActivationFunctionType fused_activation_function = tflite::ActivationFunctionType_NONE) { |
| 3933 | L2NormOptionsBuilder builder_(_fbb); |
| 3934 | builder_.add_fused_activation_function(fused_activation_function); |
| 3935 | return builder_.Finish(); |
| 3936 | } |
| 3937 | |
| 3938 | struct LocalResponseNormalizationOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 3939 | typedef LocalResponseNormalizationOptionsBuilder Builder; |
| 3940 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 3941 | VT_RADIUS = 4, |
| 3942 | VT_BIAS = 6, |
| 3943 | VT_ALPHA = 8, |
| 3944 | VT_BETA = 10 |
| 3945 | }; |
| 3946 | int32_t radius() const { |
| 3947 | return GetField<int32_t>(VT_RADIUS, 0); |
| 3948 | } |
| 3949 | float bias() const { |
| 3950 | return GetField<float>(VT_BIAS, 0.0f); |
| 3951 | } |
| 3952 | float alpha() const { |
| 3953 | return GetField<float>(VT_ALPHA, 0.0f); |
| 3954 | } |
| 3955 | float beta() const { |
| 3956 | return GetField<float>(VT_BETA, 0.0f); |
| 3957 | } |
| 3958 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 3959 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 3960 | VerifyField<int32_t>(verifier, VT_RADIUS, 4) && |
| 3961 | VerifyField<float>(verifier, VT_BIAS, 4) && |
| 3962 | VerifyField<float>(verifier, VT_ALPHA, 4) && |
| 3963 | VerifyField<float>(verifier, VT_BETA, 4) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 3964 | verifier.EndTable(); |
| 3965 | } |
| 3966 | }; |
| 3967 | |
| 3968 | struct LocalResponseNormalizationOptionsBuilder { |
| 3969 | typedef LocalResponseNormalizationOptions Table; |
| 3970 | flatbuffers::FlatBufferBuilder &fbb_; |
| 3971 | flatbuffers::uoffset_t start_; |
| 3972 | void add_radius(int32_t radius) { |
| 3973 | fbb_.AddElement<int32_t>(LocalResponseNormalizationOptions::VT_RADIUS, radius, 0); |
| 3974 | } |
| 3975 | void add_bias(float bias) { |
| 3976 | fbb_.AddElement<float>(LocalResponseNormalizationOptions::VT_BIAS, bias, 0.0f); |
| 3977 | } |
| 3978 | void add_alpha(float alpha) { |
| 3979 | fbb_.AddElement<float>(LocalResponseNormalizationOptions::VT_ALPHA, alpha, 0.0f); |
| 3980 | } |
| 3981 | void add_beta(float beta) { |
| 3982 | fbb_.AddElement<float>(LocalResponseNormalizationOptions::VT_BETA, beta, 0.0f); |
| 3983 | } |
| 3984 | explicit LocalResponseNormalizationOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 3985 | : fbb_(_fbb) { |
| 3986 | start_ = fbb_.StartTable(); |
| 3987 | } |
| 3988 | flatbuffers::Offset<LocalResponseNormalizationOptions> Finish() { |
| 3989 | const auto end = fbb_.EndTable(start_); |
| 3990 | auto o = flatbuffers::Offset<LocalResponseNormalizationOptions>(end); |
| 3991 | return o; |
| 3992 | } |
| 3993 | }; |
| 3994 | |
| 3995 | inline flatbuffers::Offset<LocalResponseNormalizationOptions> CreateLocalResponseNormalizationOptions( |
| 3996 | flatbuffers::FlatBufferBuilder &_fbb, |
| 3997 | int32_t radius = 0, |
| 3998 | float bias = 0.0f, |
| 3999 | float alpha = 0.0f, |
| 4000 | float beta = 0.0f) { |
| 4001 | LocalResponseNormalizationOptionsBuilder builder_(_fbb); |
| 4002 | builder_.add_beta(beta); |
| 4003 | builder_.add_alpha(alpha); |
| 4004 | builder_.add_bias(bias); |
| 4005 | builder_.add_radius(radius); |
| 4006 | return builder_.Finish(); |
| 4007 | } |
| 4008 | |
| 4009 | struct LSTMOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 4010 | typedef LSTMOptionsBuilder Builder; |
| 4011 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 4012 | VT_FUSED_ACTIVATION_FUNCTION = 4, |
| 4013 | VT_CELL_CLIP = 6, |
| 4014 | VT_PROJ_CLIP = 8, |
| 4015 | VT_KERNEL_TYPE = 10, |
| 4016 | VT_ASYMMETRIC_QUANTIZE_INPUTS = 12 |
| 4017 | }; |
| 4018 | tflite::ActivationFunctionType fused_activation_function() const { |
| 4019 | return static_cast<tflite::ActivationFunctionType>(GetField<int8_t>(VT_FUSED_ACTIVATION_FUNCTION, 0)); |
| 4020 | } |
| 4021 | float cell_clip() const { |
| 4022 | return GetField<float>(VT_CELL_CLIP, 0.0f); |
| 4023 | } |
| 4024 | float proj_clip() const { |
| 4025 | return GetField<float>(VT_PROJ_CLIP, 0.0f); |
| 4026 | } |
| 4027 | tflite::LSTMKernelType kernel_type() const { |
| 4028 | return static_cast<tflite::LSTMKernelType>(GetField<int8_t>(VT_KERNEL_TYPE, 0)); |
| 4029 | } |
| 4030 | bool asymmetric_quantize_inputs() const { |
| 4031 | return GetField<uint8_t>(VT_ASYMMETRIC_QUANTIZE_INPUTS, 0) != 0; |
| 4032 | } |
| 4033 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 4034 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 4035 | VerifyField<int8_t>(verifier, VT_FUSED_ACTIVATION_FUNCTION, 1) && |
| 4036 | VerifyField<float>(verifier, VT_CELL_CLIP, 4) && |
| 4037 | VerifyField<float>(verifier, VT_PROJ_CLIP, 4) && |
| 4038 | VerifyField<int8_t>(verifier, VT_KERNEL_TYPE, 1) && |
| 4039 | VerifyField<uint8_t>(verifier, VT_ASYMMETRIC_QUANTIZE_INPUTS, 1) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 4040 | verifier.EndTable(); |
| 4041 | } |
| 4042 | }; |
| 4043 | |
| 4044 | struct LSTMOptionsBuilder { |
| 4045 | typedef LSTMOptions Table; |
| 4046 | flatbuffers::FlatBufferBuilder &fbb_; |
| 4047 | flatbuffers::uoffset_t start_; |
| 4048 | void add_fused_activation_function(tflite::ActivationFunctionType fused_activation_function) { |
| 4049 | fbb_.AddElement<int8_t>(LSTMOptions::VT_FUSED_ACTIVATION_FUNCTION, static_cast<int8_t>(fused_activation_function), 0); |
| 4050 | } |
| 4051 | void add_cell_clip(float cell_clip) { |
| 4052 | fbb_.AddElement<float>(LSTMOptions::VT_CELL_CLIP, cell_clip, 0.0f); |
| 4053 | } |
| 4054 | void add_proj_clip(float proj_clip) { |
| 4055 | fbb_.AddElement<float>(LSTMOptions::VT_PROJ_CLIP, proj_clip, 0.0f); |
| 4056 | } |
| 4057 | void add_kernel_type(tflite::LSTMKernelType kernel_type) { |
| 4058 | fbb_.AddElement<int8_t>(LSTMOptions::VT_KERNEL_TYPE, static_cast<int8_t>(kernel_type), 0); |
| 4059 | } |
| 4060 | void add_asymmetric_quantize_inputs(bool asymmetric_quantize_inputs) { |
| 4061 | fbb_.AddElement<uint8_t>(LSTMOptions::VT_ASYMMETRIC_QUANTIZE_INPUTS, static_cast<uint8_t>(asymmetric_quantize_inputs), 0); |
| 4062 | } |
| 4063 | explicit LSTMOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 4064 | : fbb_(_fbb) { |
| 4065 | start_ = fbb_.StartTable(); |
| 4066 | } |
| 4067 | flatbuffers::Offset<LSTMOptions> Finish() { |
| 4068 | const auto end = fbb_.EndTable(start_); |
| 4069 | auto o = flatbuffers::Offset<LSTMOptions>(end); |
| 4070 | return o; |
| 4071 | } |
| 4072 | }; |
| 4073 | |
| 4074 | inline flatbuffers::Offset<LSTMOptions> CreateLSTMOptions( |
| 4075 | flatbuffers::FlatBufferBuilder &_fbb, |
| 4076 | tflite::ActivationFunctionType fused_activation_function = tflite::ActivationFunctionType_NONE, |
| 4077 | float cell_clip = 0.0f, |
| 4078 | float proj_clip = 0.0f, |
| 4079 | tflite::LSTMKernelType kernel_type = tflite::LSTMKernelType_FULL, |
| 4080 | bool asymmetric_quantize_inputs = false) { |
| 4081 | LSTMOptionsBuilder builder_(_fbb); |
| 4082 | builder_.add_proj_clip(proj_clip); |
| 4083 | builder_.add_cell_clip(cell_clip); |
| 4084 | builder_.add_asymmetric_quantize_inputs(asymmetric_quantize_inputs); |
| 4085 | builder_.add_kernel_type(kernel_type); |
| 4086 | builder_.add_fused_activation_function(fused_activation_function); |
| 4087 | return builder_.Finish(); |
| 4088 | } |
| 4089 | |
| 4090 | struct UnidirectionalSequenceLSTMOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 4091 | typedef UnidirectionalSequenceLSTMOptionsBuilder Builder; |
| 4092 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 4093 | VT_FUSED_ACTIVATION_FUNCTION = 4, |
| 4094 | VT_CELL_CLIP = 6, |
| 4095 | VT_PROJ_CLIP = 8, |
| 4096 | VT_TIME_MAJOR = 10, |
| 4097 | VT_ASYMMETRIC_QUANTIZE_INPUTS = 12 |
| 4098 | }; |
| 4099 | tflite::ActivationFunctionType fused_activation_function() const { |
| 4100 | return static_cast<tflite::ActivationFunctionType>(GetField<int8_t>(VT_FUSED_ACTIVATION_FUNCTION, 0)); |
| 4101 | } |
| 4102 | float cell_clip() const { |
| 4103 | return GetField<float>(VT_CELL_CLIP, 0.0f); |
| 4104 | } |
| 4105 | float proj_clip() const { |
| 4106 | return GetField<float>(VT_PROJ_CLIP, 0.0f); |
| 4107 | } |
| 4108 | bool time_major() const { |
| 4109 | return GetField<uint8_t>(VT_TIME_MAJOR, 0) != 0; |
| 4110 | } |
| 4111 | bool asymmetric_quantize_inputs() const { |
| 4112 | return GetField<uint8_t>(VT_ASYMMETRIC_QUANTIZE_INPUTS, 0) != 0; |
| 4113 | } |
| 4114 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 4115 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 4116 | VerifyField<int8_t>(verifier, VT_FUSED_ACTIVATION_FUNCTION, 1) && |
| 4117 | VerifyField<float>(verifier, VT_CELL_CLIP, 4) && |
| 4118 | VerifyField<float>(verifier, VT_PROJ_CLIP, 4) && |
| 4119 | VerifyField<uint8_t>(verifier, VT_TIME_MAJOR, 1) && |
| 4120 | VerifyField<uint8_t>(verifier, VT_ASYMMETRIC_QUANTIZE_INPUTS, 1) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 4121 | verifier.EndTable(); |
| 4122 | } |
| 4123 | }; |
| 4124 | |
| 4125 | struct UnidirectionalSequenceLSTMOptionsBuilder { |
| 4126 | typedef UnidirectionalSequenceLSTMOptions Table; |
| 4127 | flatbuffers::FlatBufferBuilder &fbb_; |
| 4128 | flatbuffers::uoffset_t start_; |
| 4129 | void add_fused_activation_function(tflite::ActivationFunctionType fused_activation_function) { |
| 4130 | fbb_.AddElement<int8_t>(UnidirectionalSequenceLSTMOptions::VT_FUSED_ACTIVATION_FUNCTION, static_cast<int8_t>(fused_activation_function), 0); |
| 4131 | } |
| 4132 | void add_cell_clip(float cell_clip) { |
| 4133 | fbb_.AddElement<float>(UnidirectionalSequenceLSTMOptions::VT_CELL_CLIP, cell_clip, 0.0f); |
| 4134 | } |
| 4135 | void add_proj_clip(float proj_clip) { |
| 4136 | fbb_.AddElement<float>(UnidirectionalSequenceLSTMOptions::VT_PROJ_CLIP, proj_clip, 0.0f); |
| 4137 | } |
| 4138 | void add_time_major(bool time_major) { |
| 4139 | fbb_.AddElement<uint8_t>(UnidirectionalSequenceLSTMOptions::VT_TIME_MAJOR, static_cast<uint8_t>(time_major), 0); |
| 4140 | } |
| 4141 | void add_asymmetric_quantize_inputs(bool asymmetric_quantize_inputs) { |
| 4142 | fbb_.AddElement<uint8_t>(UnidirectionalSequenceLSTMOptions::VT_ASYMMETRIC_QUANTIZE_INPUTS, static_cast<uint8_t>(asymmetric_quantize_inputs), 0); |
| 4143 | } |
| 4144 | explicit UnidirectionalSequenceLSTMOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 4145 | : fbb_(_fbb) { |
| 4146 | start_ = fbb_.StartTable(); |
| 4147 | } |
| 4148 | flatbuffers::Offset<UnidirectionalSequenceLSTMOptions> Finish() { |
| 4149 | const auto end = fbb_.EndTable(start_); |
| 4150 | auto o = flatbuffers::Offset<UnidirectionalSequenceLSTMOptions>(end); |
| 4151 | return o; |
| 4152 | } |
| 4153 | }; |
| 4154 | |
| 4155 | inline flatbuffers::Offset<UnidirectionalSequenceLSTMOptions> CreateUnidirectionalSequenceLSTMOptions( |
| 4156 | flatbuffers::FlatBufferBuilder &_fbb, |
| 4157 | tflite::ActivationFunctionType fused_activation_function = tflite::ActivationFunctionType_NONE, |
| 4158 | float cell_clip = 0.0f, |
| 4159 | float proj_clip = 0.0f, |
| 4160 | bool time_major = false, |
| 4161 | bool asymmetric_quantize_inputs = false) { |
| 4162 | UnidirectionalSequenceLSTMOptionsBuilder builder_(_fbb); |
| 4163 | builder_.add_proj_clip(proj_clip); |
| 4164 | builder_.add_cell_clip(cell_clip); |
| 4165 | builder_.add_asymmetric_quantize_inputs(asymmetric_quantize_inputs); |
| 4166 | builder_.add_time_major(time_major); |
| 4167 | builder_.add_fused_activation_function(fused_activation_function); |
| 4168 | return builder_.Finish(); |
| 4169 | } |
| 4170 | |
| 4171 | struct BidirectionalSequenceLSTMOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 4172 | typedef BidirectionalSequenceLSTMOptionsBuilder Builder; |
| 4173 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 4174 | VT_FUSED_ACTIVATION_FUNCTION = 4, |
| 4175 | VT_CELL_CLIP = 6, |
| 4176 | VT_PROJ_CLIP = 8, |
| 4177 | VT_MERGE_OUTPUTS = 10, |
| 4178 | VT_TIME_MAJOR = 12, |
| 4179 | VT_ASYMMETRIC_QUANTIZE_INPUTS = 14 |
| 4180 | }; |
| 4181 | tflite::ActivationFunctionType fused_activation_function() const { |
| 4182 | return static_cast<tflite::ActivationFunctionType>(GetField<int8_t>(VT_FUSED_ACTIVATION_FUNCTION, 0)); |
| 4183 | } |
| 4184 | float cell_clip() const { |
| 4185 | return GetField<float>(VT_CELL_CLIP, 0.0f); |
| 4186 | } |
| 4187 | float proj_clip() const { |
| 4188 | return GetField<float>(VT_PROJ_CLIP, 0.0f); |
| 4189 | } |
| 4190 | bool merge_outputs() const { |
| 4191 | return GetField<uint8_t>(VT_MERGE_OUTPUTS, 0) != 0; |
| 4192 | } |
| 4193 | bool time_major() const { |
| 4194 | return GetField<uint8_t>(VT_TIME_MAJOR, 1) != 0; |
| 4195 | } |
| 4196 | bool asymmetric_quantize_inputs() const { |
| 4197 | return GetField<uint8_t>(VT_ASYMMETRIC_QUANTIZE_INPUTS, 0) != 0; |
| 4198 | } |
| 4199 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 4200 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 4201 | VerifyField<int8_t>(verifier, VT_FUSED_ACTIVATION_FUNCTION, 1) && |
| 4202 | VerifyField<float>(verifier, VT_CELL_CLIP, 4) && |
| 4203 | VerifyField<float>(verifier, VT_PROJ_CLIP, 4) && |
| 4204 | VerifyField<uint8_t>(verifier, VT_MERGE_OUTPUTS, 1) && |
| 4205 | VerifyField<uint8_t>(verifier, VT_TIME_MAJOR, 1) && |
| 4206 | VerifyField<uint8_t>(verifier, VT_ASYMMETRIC_QUANTIZE_INPUTS, 1) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 4207 | verifier.EndTable(); |
| 4208 | } |
| 4209 | }; |
| 4210 | |
| 4211 | struct BidirectionalSequenceLSTMOptionsBuilder { |
| 4212 | typedef BidirectionalSequenceLSTMOptions Table; |
| 4213 | flatbuffers::FlatBufferBuilder &fbb_; |
| 4214 | flatbuffers::uoffset_t start_; |
| 4215 | void add_fused_activation_function(tflite::ActivationFunctionType fused_activation_function) { |
| 4216 | fbb_.AddElement<int8_t>(BidirectionalSequenceLSTMOptions::VT_FUSED_ACTIVATION_FUNCTION, static_cast<int8_t>(fused_activation_function), 0); |
| 4217 | } |
| 4218 | void add_cell_clip(float cell_clip) { |
| 4219 | fbb_.AddElement<float>(BidirectionalSequenceLSTMOptions::VT_CELL_CLIP, cell_clip, 0.0f); |
| 4220 | } |
| 4221 | void add_proj_clip(float proj_clip) { |
| 4222 | fbb_.AddElement<float>(BidirectionalSequenceLSTMOptions::VT_PROJ_CLIP, proj_clip, 0.0f); |
| 4223 | } |
| 4224 | void add_merge_outputs(bool merge_outputs) { |
| 4225 | fbb_.AddElement<uint8_t>(BidirectionalSequenceLSTMOptions::VT_MERGE_OUTPUTS, static_cast<uint8_t>(merge_outputs), 0); |
| 4226 | } |
| 4227 | void add_time_major(bool time_major) { |
| 4228 | fbb_.AddElement<uint8_t>(BidirectionalSequenceLSTMOptions::VT_TIME_MAJOR, static_cast<uint8_t>(time_major), 1); |
| 4229 | } |
| 4230 | void add_asymmetric_quantize_inputs(bool asymmetric_quantize_inputs) { |
| 4231 | fbb_.AddElement<uint8_t>(BidirectionalSequenceLSTMOptions::VT_ASYMMETRIC_QUANTIZE_INPUTS, static_cast<uint8_t>(asymmetric_quantize_inputs), 0); |
| 4232 | } |
| 4233 | explicit BidirectionalSequenceLSTMOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 4234 | : fbb_(_fbb) { |
| 4235 | start_ = fbb_.StartTable(); |
| 4236 | } |
| 4237 | flatbuffers::Offset<BidirectionalSequenceLSTMOptions> Finish() { |
| 4238 | const auto end = fbb_.EndTable(start_); |
| 4239 | auto o = flatbuffers::Offset<BidirectionalSequenceLSTMOptions>(end); |
| 4240 | return o; |
| 4241 | } |
| 4242 | }; |
| 4243 | |
| 4244 | inline flatbuffers::Offset<BidirectionalSequenceLSTMOptions> CreateBidirectionalSequenceLSTMOptions( |
| 4245 | flatbuffers::FlatBufferBuilder &_fbb, |
| 4246 | tflite::ActivationFunctionType fused_activation_function = tflite::ActivationFunctionType_NONE, |
| 4247 | float cell_clip = 0.0f, |
| 4248 | float proj_clip = 0.0f, |
| 4249 | bool merge_outputs = false, |
| 4250 | bool time_major = true, |
| 4251 | bool asymmetric_quantize_inputs = false) { |
| 4252 | BidirectionalSequenceLSTMOptionsBuilder builder_(_fbb); |
| 4253 | builder_.add_proj_clip(proj_clip); |
| 4254 | builder_.add_cell_clip(cell_clip); |
| 4255 | builder_.add_asymmetric_quantize_inputs(asymmetric_quantize_inputs); |
| 4256 | builder_.add_time_major(time_major); |
| 4257 | builder_.add_merge_outputs(merge_outputs); |
| 4258 | builder_.add_fused_activation_function(fused_activation_function); |
| 4259 | return builder_.Finish(); |
| 4260 | } |
| 4261 | |
| 4262 | struct ResizeBilinearOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 4263 | typedef ResizeBilinearOptionsBuilder Builder; |
| 4264 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 4265 | VT_ALIGN_CORNERS = 8, |
| 4266 | VT_HALF_PIXEL_CENTERS = 10 |
| 4267 | }; |
| 4268 | bool align_corners() const { |
| 4269 | return GetField<uint8_t>(VT_ALIGN_CORNERS, 0) != 0; |
| 4270 | } |
| 4271 | bool half_pixel_centers() const { |
| 4272 | return GetField<uint8_t>(VT_HALF_PIXEL_CENTERS, 0) != 0; |
| 4273 | } |
| 4274 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 4275 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 4276 | VerifyField<uint8_t>(verifier, VT_ALIGN_CORNERS, 1) && |
| 4277 | VerifyField<uint8_t>(verifier, VT_HALF_PIXEL_CENTERS, 1) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 4278 | verifier.EndTable(); |
| 4279 | } |
| 4280 | }; |
| 4281 | |
| 4282 | struct ResizeBilinearOptionsBuilder { |
| 4283 | typedef ResizeBilinearOptions Table; |
| 4284 | flatbuffers::FlatBufferBuilder &fbb_; |
| 4285 | flatbuffers::uoffset_t start_; |
| 4286 | void add_align_corners(bool align_corners) { |
| 4287 | fbb_.AddElement<uint8_t>(ResizeBilinearOptions::VT_ALIGN_CORNERS, static_cast<uint8_t>(align_corners), 0); |
| 4288 | } |
| 4289 | void add_half_pixel_centers(bool half_pixel_centers) { |
| 4290 | fbb_.AddElement<uint8_t>(ResizeBilinearOptions::VT_HALF_PIXEL_CENTERS, static_cast<uint8_t>(half_pixel_centers), 0); |
| 4291 | } |
| 4292 | explicit ResizeBilinearOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 4293 | : fbb_(_fbb) { |
| 4294 | start_ = fbb_.StartTable(); |
| 4295 | } |
| 4296 | flatbuffers::Offset<ResizeBilinearOptions> Finish() { |
| 4297 | const auto end = fbb_.EndTable(start_); |
| 4298 | auto o = flatbuffers::Offset<ResizeBilinearOptions>(end); |
| 4299 | return o; |
| 4300 | } |
| 4301 | }; |
| 4302 | |
| 4303 | inline flatbuffers::Offset<ResizeBilinearOptions> CreateResizeBilinearOptions( |
| 4304 | flatbuffers::FlatBufferBuilder &_fbb, |
| 4305 | bool align_corners = false, |
| 4306 | bool half_pixel_centers = false) { |
| 4307 | ResizeBilinearOptionsBuilder builder_(_fbb); |
| 4308 | builder_.add_half_pixel_centers(half_pixel_centers); |
| 4309 | builder_.add_align_corners(align_corners); |
| 4310 | return builder_.Finish(); |
| 4311 | } |
| 4312 | |
| 4313 | struct ResizeNearestNeighborOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 4314 | typedef ResizeNearestNeighborOptionsBuilder Builder; |
| 4315 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 4316 | VT_ALIGN_CORNERS = 4, |
| 4317 | VT_HALF_PIXEL_CENTERS = 6 |
| 4318 | }; |
| 4319 | bool align_corners() const { |
| 4320 | return GetField<uint8_t>(VT_ALIGN_CORNERS, 0) != 0; |
| 4321 | } |
| 4322 | bool half_pixel_centers() const { |
| 4323 | return GetField<uint8_t>(VT_HALF_PIXEL_CENTERS, 0) != 0; |
| 4324 | } |
| 4325 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 4326 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 4327 | VerifyField<uint8_t>(verifier, VT_ALIGN_CORNERS, 1) && |
| 4328 | VerifyField<uint8_t>(verifier, VT_HALF_PIXEL_CENTERS, 1) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 4329 | verifier.EndTable(); |
| 4330 | } |
| 4331 | }; |
| 4332 | |
| 4333 | struct ResizeNearestNeighborOptionsBuilder { |
| 4334 | typedef ResizeNearestNeighborOptions Table; |
| 4335 | flatbuffers::FlatBufferBuilder &fbb_; |
| 4336 | flatbuffers::uoffset_t start_; |
| 4337 | void add_align_corners(bool align_corners) { |
| 4338 | fbb_.AddElement<uint8_t>(ResizeNearestNeighborOptions::VT_ALIGN_CORNERS, static_cast<uint8_t>(align_corners), 0); |
| 4339 | } |
| 4340 | void add_half_pixel_centers(bool half_pixel_centers) { |
| 4341 | fbb_.AddElement<uint8_t>(ResizeNearestNeighborOptions::VT_HALF_PIXEL_CENTERS, static_cast<uint8_t>(half_pixel_centers), 0); |
| 4342 | } |
| 4343 | explicit ResizeNearestNeighborOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 4344 | : fbb_(_fbb) { |
| 4345 | start_ = fbb_.StartTable(); |
| 4346 | } |
| 4347 | flatbuffers::Offset<ResizeNearestNeighborOptions> Finish() { |
| 4348 | const auto end = fbb_.EndTable(start_); |
| 4349 | auto o = flatbuffers::Offset<ResizeNearestNeighborOptions>(end); |
| 4350 | return o; |
| 4351 | } |
| 4352 | }; |
| 4353 | |
| 4354 | inline flatbuffers::Offset<ResizeNearestNeighborOptions> CreateResizeNearestNeighborOptions( |
| 4355 | flatbuffers::FlatBufferBuilder &_fbb, |
| 4356 | bool align_corners = false, |
| 4357 | bool half_pixel_centers = false) { |
| 4358 | ResizeNearestNeighborOptionsBuilder builder_(_fbb); |
| 4359 | builder_.add_half_pixel_centers(half_pixel_centers); |
| 4360 | builder_.add_align_corners(align_corners); |
| 4361 | return builder_.Finish(); |
| 4362 | } |
| 4363 | |
| 4364 | struct CallOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 4365 | typedef CallOptionsBuilder Builder; |
| 4366 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 4367 | VT_SUBGRAPH = 4 |
| 4368 | }; |
| 4369 | uint32_t subgraph() const { |
| 4370 | return GetField<uint32_t>(VT_SUBGRAPH, 0); |
| 4371 | } |
| 4372 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 4373 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 4374 | VerifyField<uint32_t>(verifier, VT_SUBGRAPH, 4) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 4375 | verifier.EndTable(); |
| 4376 | } |
| 4377 | }; |
| 4378 | |
| 4379 | struct CallOptionsBuilder { |
| 4380 | typedef CallOptions Table; |
| 4381 | flatbuffers::FlatBufferBuilder &fbb_; |
| 4382 | flatbuffers::uoffset_t start_; |
| 4383 | void add_subgraph(uint32_t subgraph) { |
| 4384 | fbb_.AddElement<uint32_t>(CallOptions::VT_SUBGRAPH, subgraph, 0); |
| 4385 | } |
| 4386 | explicit CallOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 4387 | : fbb_(_fbb) { |
| 4388 | start_ = fbb_.StartTable(); |
| 4389 | } |
| 4390 | flatbuffers::Offset<CallOptions> Finish() { |
| 4391 | const auto end = fbb_.EndTable(start_); |
| 4392 | auto o = flatbuffers::Offset<CallOptions>(end); |
| 4393 | return o; |
| 4394 | } |
| 4395 | }; |
| 4396 | |
| 4397 | inline flatbuffers::Offset<CallOptions> CreateCallOptions( |
| 4398 | flatbuffers::FlatBufferBuilder &_fbb, |
| 4399 | uint32_t subgraph = 0) { |
| 4400 | CallOptionsBuilder builder_(_fbb); |
| 4401 | builder_.add_subgraph(subgraph); |
| 4402 | return builder_.Finish(); |
| 4403 | } |
| 4404 | |
| 4405 | struct PadOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 4406 | typedef PadOptionsBuilder Builder; |
| 4407 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 4408 | return VerifyTableStart(verifier) && |
| 4409 | verifier.EndTable(); |
| 4410 | } |
| 4411 | }; |
| 4412 | |
| 4413 | struct PadOptionsBuilder { |
| 4414 | typedef PadOptions Table; |
| 4415 | flatbuffers::FlatBufferBuilder &fbb_; |
| 4416 | flatbuffers::uoffset_t start_; |
| 4417 | explicit PadOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 4418 | : fbb_(_fbb) { |
| 4419 | start_ = fbb_.StartTable(); |
| 4420 | } |
| 4421 | flatbuffers::Offset<PadOptions> Finish() { |
| 4422 | const auto end = fbb_.EndTable(start_); |
| 4423 | auto o = flatbuffers::Offset<PadOptions>(end); |
| 4424 | return o; |
| 4425 | } |
| 4426 | }; |
| 4427 | |
| 4428 | inline flatbuffers::Offset<PadOptions> CreatePadOptions( |
| 4429 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 4430 | PadOptionsBuilder builder_(_fbb); |
| 4431 | return builder_.Finish(); |
| 4432 | } |
| 4433 | |
| 4434 | struct PadV2Options FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 4435 | typedef PadV2OptionsBuilder Builder; |
| 4436 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 4437 | return VerifyTableStart(verifier) && |
| 4438 | verifier.EndTable(); |
| 4439 | } |
| 4440 | }; |
| 4441 | |
| 4442 | struct PadV2OptionsBuilder { |
| 4443 | typedef PadV2Options Table; |
| 4444 | flatbuffers::FlatBufferBuilder &fbb_; |
| 4445 | flatbuffers::uoffset_t start_; |
| 4446 | explicit PadV2OptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 4447 | : fbb_(_fbb) { |
| 4448 | start_ = fbb_.StartTable(); |
| 4449 | } |
| 4450 | flatbuffers::Offset<PadV2Options> Finish() { |
| 4451 | const auto end = fbb_.EndTable(start_); |
| 4452 | auto o = flatbuffers::Offset<PadV2Options>(end); |
| 4453 | return o; |
| 4454 | } |
| 4455 | }; |
| 4456 | |
| 4457 | inline flatbuffers::Offset<PadV2Options> CreatePadV2Options( |
| 4458 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 4459 | PadV2OptionsBuilder builder_(_fbb); |
| 4460 | return builder_.Finish(); |
| 4461 | } |
| 4462 | |
| 4463 | struct ReshapeOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 4464 | typedef ReshapeOptionsBuilder Builder; |
| 4465 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 4466 | VT_NEW_SHAPE = 4 |
| 4467 | }; |
| 4468 | const flatbuffers::Vector<int32_t> *new_shape() const { |
| 4469 | return GetPointer<const flatbuffers::Vector<int32_t> *>(VT_NEW_SHAPE); |
| 4470 | } |
| 4471 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 4472 | return VerifyTableStart(verifier) && |
| 4473 | VerifyOffset(verifier, VT_NEW_SHAPE) && |
| 4474 | verifier.VerifyVector(new_shape()) && |
| 4475 | verifier.EndTable(); |
| 4476 | } |
| 4477 | }; |
| 4478 | |
| 4479 | struct ReshapeOptionsBuilder { |
| 4480 | typedef ReshapeOptions Table; |
| 4481 | flatbuffers::FlatBufferBuilder &fbb_; |
| 4482 | flatbuffers::uoffset_t start_; |
| 4483 | void add_new_shape(flatbuffers::Offset<flatbuffers::Vector<int32_t>> new_shape) { |
| 4484 | fbb_.AddOffset(ReshapeOptions::VT_NEW_SHAPE, new_shape); |
| 4485 | } |
| 4486 | explicit ReshapeOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 4487 | : fbb_(_fbb) { |
| 4488 | start_ = fbb_.StartTable(); |
| 4489 | } |
| 4490 | flatbuffers::Offset<ReshapeOptions> Finish() { |
| 4491 | const auto end = fbb_.EndTable(start_); |
| 4492 | auto o = flatbuffers::Offset<ReshapeOptions>(end); |
| 4493 | return o; |
| 4494 | } |
| 4495 | }; |
| 4496 | |
| 4497 | inline flatbuffers::Offset<ReshapeOptions> CreateReshapeOptions( |
| 4498 | flatbuffers::FlatBufferBuilder &_fbb, |
| 4499 | flatbuffers::Offset<flatbuffers::Vector<int32_t>> new_shape = 0) { |
| 4500 | ReshapeOptionsBuilder builder_(_fbb); |
| 4501 | builder_.add_new_shape(new_shape); |
| 4502 | return builder_.Finish(); |
| 4503 | } |
| 4504 | |
| 4505 | inline flatbuffers::Offset<ReshapeOptions> CreateReshapeOptionsDirect( |
| 4506 | flatbuffers::FlatBufferBuilder &_fbb, |
| 4507 | const std::vector<int32_t> *new_shape = nullptr) { |
| 4508 | auto new_shape__ = new_shape ? _fbb.CreateVector<int32_t>(*new_shape) : 0; |
| 4509 | return tflite::CreateReshapeOptions( |
| 4510 | _fbb, |
| 4511 | new_shape__); |
| 4512 | } |
| 4513 | |
| 4514 | struct SpaceToBatchNDOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 4515 | typedef SpaceToBatchNDOptionsBuilder Builder; |
| 4516 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 4517 | return VerifyTableStart(verifier) && |
| 4518 | verifier.EndTable(); |
| 4519 | } |
| 4520 | }; |
| 4521 | |
| 4522 | struct SpaceToBatchNDOptionsBuilder { |
| 4523 | typedef SpaceToBatchNDOptions Table; |
| 4524 | flatbuffers::FlatBufferBuilder &fbb_; |
| 4525 | flatbuffers::uoffset_t start_; |
| 4526 | explicit SpaceToBatchNDOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 4527 | : fbb_(_fbb) { |
| 4528 | start_ = fbb_.StartTable(); |
| 4529 | } |
| 4530 | flatbuffers::Offset<SpaceToBatchNDOptions> Finish() { |
| 4531 | const auto end = fbb_.EndTable(start_); |
| 4532 | auto o = flatbuffers::Offset<SpaceToBatchNDOptions>(end); |
| 4533 | return o; |
| 4534 | } |
| 4535 | }; |
| 4536 | |
| 4537 | inline flatbuffers::Offset<SpaceToBatchNDOptions> CreateSpaceToBatchNDOptions( |
| 4538 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 4539 | SpaceToBatchNDOptionsBuilder builder_(_fbb); |
| 4540 | return builder_.Finish(); |
| 4541 | } |
| 4542 | |
| 4543 | struct BatchToSpaceNDOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 4544 | typedef BatchToSpaceNDOptionsBuilder Builder; |
| 4545 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 4546 | return VerifyTableStart(verifier) && |
| 4547 | verifier.EndTable(); |
| 4548 | } |
| 4549 | }; |
| 4550 | |
| 4551 | struct BatchToSpaceNDOptionsBuilder { |
| 4552 | typedef BatchToSpaceNDOptions Table; |
| 4553 | flatbuffers::FlatBufferBuilder &fbb_; |
| 4554 | flatbuffers::uoffset_t start_; |
| 4555 | explicit BatchToSpaceNDOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 4556 | : fbb_(_fbb) { |
| 4557 | start_ = fbb_.StartTable(); |
| 4558 | } |
| 4559 | flatbuffers::Offset<BatchToSpaceNDOptions> Finish() { |
| 4560 | const auto end = fbb_.EndTable(start_); |
| 4561 | auto o = flatbuffers::Offset<BatchToSpaceNDOptions>(end); |
| 4562 | return o; |
| 4563 | } |
| 4564 | }; |
| 4565 | |
| 4566 | inline flatbuffers::Offset<BatchToSpaceNDOptions> CreateBatchToSpaceNDOptions( |
| 4567 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 4568 | BatchToSpaceNDOptionsBuilder builder_(_fbb); |
| 4569 | return builder_.Finish(); |
| 4570 | } |
| 4571 | |
| 4572 | struct SkipGramOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 4573 | typedef SkipGramOptionsBuilder Builder; |
| 4574 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 4575 | VT_NGRAM_SIZE = 4, |
| 4576 | VT_MAX_SKIP_SIZE = 6, |
| 4577 | VT_INCLUDE_ALL_NGRAMS = 8 |
| 4578 | }; |
| 4579 | int32_t ngram_size() const { |
| 4580 | return GetField<int32_t>(VT_NGRAM_SIZE, 0); |
| 4581 | } |
| 4582 | int32_t max_skip_size() const { |
| 4583 | return GetField<int32_t>(VT_MAX_SKIP_SIZE, 0); |
| 4584 | } |
| 4585 | bool include_all_ngrams() const { |
| 4586 | return GetField<uint8_t>(VT_INCLUDE_ALL_NGRAMS, 0) != 0; |
| 4587 | } |
| 4588 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 4589 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 4590 | VerifyField<int32_t>(verifier, VT_NGRAM_SIZE, 4) && |
| 4591 | VerifyField<int32_t>(verifier, VT_MAX_SKIP_SIZE, 4) && |
| 4592 | VerifyField<uint8_t>(verifier, VT_INCLUDE_ALL_NGRAMS, 1) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 4593 | verifier.EndTable(); |
| 4594 | } |
| 4595 | }; |
| 4596 | |
| 4597 | struct SkipGramOptionsBuilder { |
| 4598 | typedef SkipGramOptions Table; |
| 4599 | flatbuffers::FlatBufferBuilder &fbb_; |
| 4600 | flatbuffers::uoffset_t start_; |
| 4601 | void add_ngram_size(int32_t ngram_size) { |
| 4602 | fbb_.AddElement<int32_t>(SkipGramOptions::VT_NGRAM_SIZE, ngram_size, 0); |
| 4603 | } |
| 4604 | void add_max_skip_size(int32_t max_skip_size) { |
| 4605 | fbb_.AddElement<int32_t>(SkipGramOptions::VT_MAX_SKIP_SIZE, max_skip_size, 0); |
| 4606 | } |
| 4607 | void add_include_all_ngrams(bool include_all_ngrams) { |
| 4608 | fbb_.AddElement<uint8_t>(SkipGramOptions::VT_INCLUDE_ALL_NGRAMS, static_cast<uint8_t>(include_all_ngrams), 0); |
| 4609 | } |
| 4610 | explicit SkipGramOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 4611 | : fbb_(_fbb) { |
| 4612 | start_ = fbb_.StartTable(); |
| 4613 | } |
| 4614 | flatbuffers::Offset<SkipGramOptions> Finish() { |
| 4615 | const auto end = fbb_.EndTable(start_); |
| 4616 | auto o = flatbuffers::Offset<SkipGramOptions>(end); |
| 4617 | return o; |
| 4618 | } |
| 4619 | }; |
| 4620 | |
| 4621 | inline flatbuffers::Offset<SkipGramOptions> CreateSkipGramOptions( |
| 4622 | flatbuffers::FlatBufferBuilder &_fbb, |
| 4623 | int32_t ngram_size = 0, |
| 4624 | int32_t max_skip_size = 0, |
| 4625 | bool include_all_ngrams = false) { |
| 4626 | SkipGramOptionsBuilder builder_(_fbb); |
| 4627 | builder_.add_max_skip_size(max_skip_size); |
| 4628 | builder_.add_ngram_size(ngram_size); |
| 4629 | builder_.add_include_all_ngrams(include_all_ngrams); |
| 4630 | return builder_.Finish(); |
| 4631 | } |
| 4632 | |
| 4633 | struct SpaceToDepthOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 4634 | typedef SpaceToDepthOptionsBuilder Builder; |
| 4635 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 4636 | VT_BLOCK_SIZE = 4 |
| 4637 | }; |
| 4638 | int32_t block_size() const { |
| 4639 | return GetField<int32_t>(VT_BLOCK_SIZE, 0); |
| 4640 | } |
| 4641 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 4642 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 4643 | VerifyField<int32_t>(verifier, VT_BLOCK_SIZE, 4) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 4644 | verifier.EndTable(); |
| 4645 | } |
| 4646 | }; |
| 4647 | |
| 4648 | struct SpaceToDepthOptionsBuilder { |
| 4649 | typedef SpaceToDepthOptions Table; |
| 4650 | flatbuffers::FlatBufferBuilder &fbb_; |
| 4651 | flatbuffers::uoffset_t start_; |
| 4652 | void add_block_size(int32_t block_size) { |
| 4653 | fbb_.AddElement<int32_t>(SpaceToDepthOptions::VT_BLOCK_SIZE, block_size, 0); |
| 4654 | } |
| 4655 | explicit SpaceToDepthOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 4656 | : fbb_(_fbb) { |
| 4657 | start_ = fbb_.StartTable(); |
| 4658 | } |
| 4659 | flatbuffers::Offset<SpaceToDepthOptions> Finish() { |
| 4660 | const auto end = fbb_.EndTable(start_); |
| 4661 | auto o = flatbuffers::Offset<SpaceToDepthOptions>(end); |
| 4662 | return o; |
| 4663 | } |
| 4664 | }; |
| 4665 | |
| 4666 | inline flatbuffers::Offset<SpaceToDepthOptions> CreateSpaceToDepthOptions( |
| 4667 | flatbuffers::FlatBufferBuilder &_fbb, |
| 4668 | int32_t block_size = 0) { |
| 4669 | SpaceToDepthOptionsBuilder builder_(_fbb); |
| 4670 | builder_.add_block_size(block_size); |
| 4671 | return builder_.Finish(); |
| 4672 | } |
| 4673 | |
| 4674 | struct DepthToSpaceOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 4675 | typedef DepthToSpaceOptionsBuilder Builder; |
| 4676 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 4677 | VT_BLOCK_SIZE = 4 |
| 4678 | }; |
| 4679 | int32_t block_size() const { |
| 4680 | return GetField<int32_t>(VT_BLOCK_SIZE, 0); |
| 4681 | } |
| 4682 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 4683 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 4684 | VerifyField<int32_t>(verifier, VT_BLOCK_SIZE, 4) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 4685 | verifier.EndTable(); |
| 4686 | } |
| 4687 | }; |
| 4688 | |
| 4689 | struct DepthToSpaceOptionsBuilder { |
| 4690 | typedef DepthToSpaceOptions Table; |
| 4691 | flatbuffers::FlatBufferBuilder &fbb_; |
| 4692 | flatbuffers::uoffset_t start_; |
| 4693 | void add_block_size(int32_t block_size) { |
| 4694 | fbb_.AddElement<int32_t>(DepthToSpaceOptions::VT_BLOCK_SIZE, block_size, 0); |
| 4695 | } |
| 4696 | explicit DepthToSpaceOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 4697 | : fbb_(_fbb) { |
| 4698 | start_ = fbb_.StartTable(); |
| 4699 | } |
| 4700 | flatbuffers::Offset<DepthToSpaceOptions> Finish() { |
| 4701 | const auto end = fbb_.EndTable(start_); |
| 4702 | auto o = flatbuffers::Offset<DepthToSpaceOptions>(end); |
| 4703 | return o; |
| 4704 | } |
| 4705 | }; |
| 4706 | |
| 4707 | inline flatbuffers::Offset<DepthToSpaceOptions> CreateDepthToSpaceOptions( |
| 4708 | flatbuffers::FlatBufferBuilder &_fbb, |
| 4709 | int32_t block_size = 0) { |
| 4710 | DepthToSpaceOptionsBuilder builder_(_fbb); |
| 4711 | builder_.add_block_size(block_size); |
| 4712 | return builder_.Finish(); |
| 4713 | } |
| 4714 | |
| 4715 | struct SubOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 4716 | typedef SubOptionsBuilder Builder; |
| 4717 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 4718 | VT_FUSED_ACTIVATION_FUNCTION = 4, |
| 4719 | VT_POT_SCALE_INT16 = 6 |
| 4720 | }; |
| 4721 | tflite::ActivationFunctionType fused_activation_function() const { |
| 4722 | return static_cast<tflite::ActivationFunctionType>(GetField<int8_t>(VT_FUSED_ACTIVATION_FUNCTION, 0)); |
| 4723 | } |
| 4724 | bool pot_scale_int16() const { |
| 4725 | return GetField<uint8_t>(VT_POT_SCALE_INT16, 1) != 0; |
| 4726 | } |
| 4727 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 4728 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 4729 | VerifyField<int8_t>(verifier, VT_FUSED_ACTIVATION_FUNCTION, 1) && |
| 4730 | VerifyField<uint8_t>(verifier, VT_POT_SCALE_INT16, 1) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 4731 | verifier.EndTable(); |
| 4732 | } |
| 4733 | }; |
| 4734 | |
| 4735 | struct SubOptionsBuilder { |
| 4736 | typedef SubOptions Table; |
| 4737 | flatbuffers::FlatBufferBuilder &fbb_; |
| 4738 | flatbuffers::uoffset_t start_; |
| 4739 | void add_fused_activation_function(tflite::ActivationFunctionType fused_activation_function) { |
| 4740 | fbb_.AddElement<int8_t>(SubOptions::VT_FUSED_ACTIVATION_FUNCTION, static_cast<int8_t>(fused_activation_function), 0); |
| 4741 | } |
| 4742 | void add_pot_scale_int16(bool pot_scale_int16) { |
| 4743 | fbb_.AddElement<uint8_t>(SubOptions::VT_POT_SCALE_INT16, static_cast<uint8_t>(pot_scale_int16), 1); |
| 4744 | } |
| 4745 | explicit SubOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 4746 | : fbb_(_fbb) { |
| 4747 | start_ = fbb_.StartTable(); |
| 4748 | } |
| 4749 | flatbuffers::Offset<SubOptions> Finish() { |
| 4750 | const auto end = fbb_.EndTable(start_); |
| 4751 | auto o = flatbuffers::Offset<SubOptions>(end); |
| 4752 | return o; |
| 4753 | } |
| 4754 | }; |
| 4755 | |
| 4756 | inline flatbuffers::Offset<SubOptions> CreateSubOptions( |
| 4757 | flatbuffers::FlatBufferBuilder &_fbb, |
| 4758 | tflite::ActivationFunctionType fused_activation_function = tflite::ActivationFunctionType_NONE, |
| 4759 | bool pot_scale_int16 = true) { |
| 4760 | SubOptionsBuilder builder_(_fbb); |
| 4761 | builder_.add_pot_scale_int16(pot_scale_int16); |
| 4762 | builder_.add_fused_activation_function(fused_activation_function); |
| 4763 | return builder_.Finish(); |
| 4764 | } |
| 4765 | |
| 4766 | struct DivOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 4767 | typedef DivOptionsBuilder Builder; |
| 4768 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 4769 | VT_FUSED_ACTIVATION_FUNCTION = 4 |
| 4770 | }; |
| 4771 | tflite::ActivationFunctionType fused_activation_function() const { |
| 4772 | return static_cast<tflite::ActivationFunctionType>(GetField<int8_t>(VT_FUSED_ACTIVATION_FUNCTION, 0)); |
| 4773 | } |
| 4774 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 4775 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 4776 | VerifyField<int8_t>(verifier, VT_FUSED_ACTIVATION_FUNCTION, 1) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 4777 | verifier.EndTable(); |
| 4778 | } |
| 4779 | }; |
| 4780 | |
| 4781 | struct DivOptionsBuilder { |
| 4782 | typedef DivOptions Table; |
| 4783 | flatbuffers::FlatBufferBuilder &fbb_; |
| 4784 | flatbuffers::uoffset_t start_; |
| 4785 | void add_fused_activation_function(tflite::ActivationFunctionType fused_activation_function) { |
| 4786 | fbb_.AddElement<int8_t>(DivOptions::VT_FUSED_ACTIVATION_FUNCTION, static_cast<int8_t>(fused_activation_function), 0); |
| 4787 | } |
| 4788 | explicit DivOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 4789 | : fbb_(_fbb) { |
| 4790 | start_ = fbb_.StartTable(); |
| 4791 | } |
| 4792 | flatbuffers::Offset<DivOptions> Finish() { |
| 4793 | const auto end = fbb_.EndTable(start_); |
| 4794 | auto o = flatbuffers::Offset<DivOptions>(end); |
| 4795 | return o; |
| 4796 | } |
| 4797 | }; |
| 4798 | |
| 4799 | inline flatbuffers::Offset<DivOptions> CreateDivOptions( |
| 4800 | flatbuffers::FlatBufferBuilder &_fbb, |
| 4801 | tflite::ActivationFunctionType fused_activation_function = tflite::ActivationFunctionType_NONE) { |
| 4802 | DivOptionsBuilder builder_(_fbb); |
| 4803 | builder_.add_fused_activation_function(fused_activation_function); |
| 4804 | return builder_.Finish(); |
| 4805 | } |
| 4806 | |
| 4807 | struct TopKV2Options FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 4808 | typedef TopKV2OptionsBuilder Builder; |
| 4809 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 4810 | return VerifyTableStart(verifier) && |
| 4811 | verifier.EndTable(); |
| 4812 | } |
| 4813 | }; |
| 4814 | |
| 4815 | struct TopKV2OptionsBuilder { |
| 4816 | typedef TopKV2Options Table; |
| 4817 | flatbuffers::FlatBufferBuilder &fbb_; |
| 4818 | flatbuffers::uoffset_t start_; |
| 4819 | explicit TopKV2OptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 4820 | : fbb_(_fbb) { |
| 4821 | start_ = fbb_.StartTable(); |
| 4822 | } |
| 4823 | flatbuffers::Offset<TopKV2Options> Finish() { |
| 4824 | const auto end = fbb_.EndTable(start_); |
| 4825 | auto o = flatbuffers::Offset<TopKV2Options>(end); |
| 4826 | return o; |
| 4827 | } |
| 4828 | }; |
| 4829 | |
| 4830 | inline flatbuffers::Offset<TopKV2Options> CreateTopKV2Options( |
| 4831 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 4832 | TopKV2OptionsBuilder builder_(_fbb); |
| 4833 | return builder_.Finish(); |
| 4834 | } |
| 4835 | |
| 4836 | struct EmbeddingLookupSparseOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 4837 | typedef EmbeddingLookupSparseOptionsBuilder Builder; |
| 4838 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 4839 | VT_COMBINER = 4 |
| 4840 | }; |
| 4841 | tflite::CombinerType combiner() const { |
| 4842 | return static_cast<tflite::CombinerType>(GetField<int8_t>(VT_COMBINER, 0)); |
| 4843 | } |
| 4844 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 4845 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 4846 | VerifyField<int8_t>(verifier, VT_COMBINER, 1) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 4847 | verifier.EndTable(); |
| 4848 | } |
| 4849 | }; |
| 4850 | |
| 4851 | struct EmbeddingLookupSparseOptionsBuilder { |
| 4852 | typedef EmbeddingLookupSparseOptions Table; |
| 4853 | flatbuffers::FlatBufferBuilder &fbb_; |
| 4854 | flatbuffers::uoffset_t start_; |
| 4855 | void add_combiner(tflite::CombinerType combiner) { |
| 4856 | fbb_.AddElement<int8_t>(EmbeddingLookupSparseOptions::VT_COMBINER, static_cast<int8_t>(combiner), 0); |
| 4857 | } |
| 4858 | explicit EmbeddingLookupSparseOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 4859 | : fbb_(_fbb) { |
| 4860 | start_ = fbb_.StartTable(); |
| 4861 | } |
| 4862 | flatbuffers::Offset<EmbeddingLookupSparseOptions> Finish() { |
| 4863 | const auto end = fbb_.EndTable(start_); |
| 4864 | auto o = flatbuffers::Offset<EmbeddingLookupSparseOptions>(end); |
| 4865 | return o; |
| 4866 | } |
| 4867 | }; |
| 4868 | |
| 4869 | inline flatbuffers::Offset<EmbeddingLookupSparseOptions> CreateEmbeddingLookupSparseOptions( |
| 4870 | flatbuffers::FlatBufferBuilder &_fbb, |
| 4871 | tflite::CombinerType combiner = tflite::CombinerType_SUM) { |
| 4872 | EmbeddingLookupSparseOptionsBuilder builder_(_fbb); |
| 4873 | builder_.add_combiner(combiner); |
| 4874 | return builder_.Finish(); |
| 4875 | } |
| 4876 | |
| 4877 | struct GatherOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 4878 | typedef GatherOptionsBuilder Builder; |
| 4879 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 4880 | VT_AXIS = 4, |
| 4881 | VT_BATCH_DIMS = 6 |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 4882 | }; |
| 4883 | int32_t axis() const { |
| 4884 | return GetField<int32_t>(VT_AXIS, 0); |
| 4885 | } |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 4886 | int32_t batch_dims() const { |
| 4887 | return GetField<int32_t>(VT_BATCH_DIMS, 0); |
| 4888 | } |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 4889 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 4890 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 4891 | VerifyField<int32_t>(verifier, VT_AXIS, 4) && |
| 4892 | VerifyField<int32_t>(verifier, VT_BATCH_DIMS, 4) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 4893 | verifier.EndTable(); |
| 4894 | } |
| 4895 | }; |
| 4896 | |
| 4897 | struct GatherOptionsBuilder { |
| 4898 | typedef GatherOptions Table; |
| 4899 | flatbuffers::FlatBufferBuilder &fbb_; |
| 4900 | flatbuffers::uoffset_t start_; |
| 4901 | void add_axis(int32_t axis) { |
| 4902 | fbb_.AddElement<int32_t>(GatherOptions::VT_AXIS, axis, 0); |
| 4903 | } |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 4904 | void add_batch_dims(int32_t batch_dims) { |
| 4905 | fbb_.AddElement<int32_t>(GatherOptions::VT_BATCH_DIMS, batch_dims, 0); |
| 4906 | } |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 4907 | explicit GatherOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 4908 | : fbb_(_fbb) { |
| 4909 | start_ = fbb_.StartTable(); |
| 4910 | } |
| 4911 | flatbuffers::Offset<GatherOptions> Finish() { |
| 4912 | const auto end = fbb_.EndTable(start_); |
| 4913 | auto o = flatbuffers::Offset<GatherOptions>(end); |
| 4914 | return o; |
| 4915 | } |
| 4916 | }; |
| 4917 | |
| 4918 | inline flatbuffers::Offset<GatherOptions> CreateGatherOptions( |
| 4919 | flatbuffers::FlatBufferBuilder &_fbb, |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 4920 | int32_t axis = 0, |
| 4921 | int32_t batch_dims = 0) { |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 4922 | GatherOptionsBuilder builder_(_fbb); |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 4923 | builder_.add_batch_dims(batch_dims); |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 4924 | builder_.add_axis(axis); |
| 4925 | return builder_.Finish(); |
| 4926 | } |
| 4927 | |
| 4928 | struct TransposeOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 4929 | typedef TransposeOptionsBuilder Builder; |
| 4930 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 4931 | return VerifyTableStart(verifier) && |
| 4932 | verifier.EndTable(); |
| 4933 | } |
| 4934 | }; |
| 4935 | |
| 4936 | struct TransposeOptionsBuilder { |
| 4937 | typedef TransposeOptions Table; |
| 4938 | flatbuffers::FlatBufferBuilder &fbb_; |
| 4939 | flatbuffers::uoffset_t start_; |
| 4940 | explicit TransposeOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 4941 | : fbb_(_fbb) { |
| 4942 | start_ = fbb_.StartTable(); |
| 4943 | } |
| 4944 | flatbuffers::Offset<TransposeOptions> Finish() { |
| 4945 | const auto end = fbb_.EndTable(start_); |
| 4946 | auto o = flatbuffers::Offset<TransposeOptions>(end); |
| 4947 | return o; |
| 4948 | } |
| 4949 | }; |
| 4950 | |
| 4951 | inline flatbuffers::Offset<TransposeOptions> CreateTransposeOptions( |
| 4952 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 4953 | TransposeOptionsBuilder builder_(_fbb); |
| 4954 | return builder_.Finish(); |
| 4955 | } |
| 4956 | |
| 4957 | struct ExpOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 4958 | typedef ExpOptionsBuilder Builder; |
| 4959 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 4960 | return VerifyTableStart(verifier) && |
| 4961 | verifier.EndTable(); |
| 4962 | } |
| 4963 | }; |
| 4964 | |
| 4965 | struct ExpOptionsBuilder { |
| 4966 | typedef ExpOptions Table; |
| 4967 | flatbuffers::FlatBufferBuilder &fbb_; |
| 4968 | flatbuffers::uoffset_t start_; |
| 4969 | explicit ExpOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 4970 | : fbb_(_fbb) { |
| 4971 | start_ = fbb_.StartTable(); |
| 4972 | } |
| 4973 | flatbuffers::Offset<ExpOptions> Finish() { |
| 4974 | const auto end = fbb_.EndTable(start_); |
| 4975 | auto o = flatbuffers::Offset<ExpOptions>(end); |
| 4976 | return o; |
| 4977 | } |
| 4978 | }; |
| 4979 | |
| 4980 | inline flatbuffers::Offset<ExpOptions> CreateExpOptions( |
| 4981 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 4982 | ExpOptionsBuilder builder_(_fbb); |
| 4983 | return builder_.Finish(); |
| 4984 | } |
| 4985 | |
| 4986 | struct CosOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 4987 | typedef CosOptionsBuilder Builder; |
| 4988 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 4989 | return VerifyTableStart(verifier) && |
| 4990 | verifier.EndTable(); |
| 4991 | } |
| 4992 | }; |
| 4993 | |
| 4994 | struct CosOptionsBuilder { |
| 4995 | typedef CosOptions Table; |
| 4996 | flatbuffers::FlatBufferBuilder &fbb_; |
| 4997 | flatbuffers::uoffset_t start_; |
| 4998 | explicit CosOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 4999 | : fbb_(_fbb) { |
| 5000 | start_ = fbb_.StartTable(); |
| 5001 | } |
| 5002 | flatbuffers::Offset<CosOptions> Finish() { |
| 5003 | const auto end = fbb_.EndTable(start_); |
| 5004 | auto o = flatbuffers::Offset<CosOptions>(end); |
| 5005 | return o; |
| 5006 | } |
| 5007 | }; |
| 5008 | |
| 5009 | inline flatbuffers::Offset<CosOptions> CreateCosOptions( |
| 5010 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 5011 | CosOptionsBuilder builder_(_fbb); |
| 5012 | return builder_.Finish(); |
| 5013 | } |
| 5014 | |
| 5015 | struct ReducerOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 5016 | typedef ReducerOptionsBuilder Builder; |
| 5017 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 5018 | VT_KEEP_DIMS = 4 |
| 5019 | }; |
| 5020 | bool keep_dims() const { |
| 5021 | return GetField<uint8_t>(VT_KEEP_DIMS, 0) != 0; |
| 5022 | } |
| 5023 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 5024 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 5025 | VerifyField<uint8_t>(verifier, VT_KEEP_DIMS, 1) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 5026 | verifier.EndTable(); |
| 5027 | } |
| 5028 | }; |
| 5029 | |
| 5030 | struct ReducerOptionsBuilder { |
| 5031 | typedef ReducerOptions Table; |
| 5032 | flatbuffers::FlatBufferBuilder &fbb_; |
| 5033 | flatbuffers::uoffset_t start_; |
| 5034 | void add_keep_dims(bool keep_dims) { |
| 5035 | fbb_.AddElement<uint8_t>(ReducerOptions::VT_KEEP_DIMS, static_cast<uint8_t>(keep_dims), 0); |
| 5036 | } |
| 5037 | explicit ReducerOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 5038 | : fbb_(_fbb) { |
| 5039 | start_ = fbb_.StartTable(); |
| 5040 | } |
| 5041 | flatbuffers::Offset<ReducerOptions> Finish() { |
| 5042 | const auto end = fbb_.EndTable(start_); |
| 5043 | auto o = flatbuffers::Offset<ReducerOptions>(end); |
| 5044 | return o; |
| 5045 | } |
| 5046 | }; |
| 5047 | |
| 5048 | inline flatbuffers::Offset<ReducerOptions> CreateReducerOptions( |
| 5049 | flatbuffers::FlatBufferBuilder &_fbb, |
| 5050 | bool keep_dims = false) { |
| 5051 | ReducerOptionsBuilder builder_(_fbb); |
| 5052 | builder_.add_keep_dims(keep_dims); |
| 5053 | return builder_.Finish(); |
| 5054 | } |
| 5055 | |
| 5056 | struct SqueezeOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 5057 | typedef SqueezeOptionsBuilder Builder; |
| 5058 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 5059 | VT_SQUEEZE_DIMS = 4 |
| 5060 | }; |
| 5061 | const flatbuffers::Vector<int32_t> *squeeze_dims() const { |
| 5062 | return GetPointer<const flatbuffers::Vector<int32_t> *>(VT_SQUEEZE_DIMS); |
| 5063 | } |
| 5064 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 5065 | return VerifyTableStart(verifier) && |
| 5066 | VerifyOffset(verifier, VT_SQUEEZE_DIMS) && |
| 5067 | verifier.VerifyVector(squeeze_dims()) && |
| 5068 | verifier.EndTable(); |
| 5069 | } |
| 5070 | }; |
| 5071 | |
| 5072 | struct SqueezeOptionsBuilder { |
| 5073 | typedef SqueezeOptions Table; |
| 5074 | flatbuffers::FlatBufferBuilder &fbb_; |
| 5075 | flatbuffers::uoffset_t start_; |
| 5076 | void add_squeeze_dims(flatbuffers::Offset<flatbuffers::Vector<int32_t>> squeeze_dims) { |
| 5077 | fbb_.AddOffset(SqueezeOptions::VT_SQUEEZE_DIMS, squeeze_dims); |
| 5078 | } |
| 5079 | explicit SqueezeOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 5080 | : fbb_(_fbb) { |
| 5081 | start_ = fbb_.StartTable(); |
| 5082 | } |
| 5083 | flatbuffers::Offset<SqueezeOptions> Finish() { |
| 5084 | const auto end = fbb_.EndTable(start_); |
| 5085 | auto o = flatbuffers::Offset<SqueezeOptions>(end); |
| 5086 | return o; |
| 5087 | } |
| 5088 | }; |
| 5089 | |
| 5090 | inline flatbuffers::Offset<SqueezeOptions> CreateSqueezeOptions( |
| 5091 | flatbuffers::FlatBufferBuilder &_fbb, |
| 5092 | flatbuffers::Offset<flatbuffers::Vector<int32_t>> squeeze_dims = 0) { |
| 5093 | SqueezeOptionsBuilder builder_(_fbb); |
| 5094 | builder_.add_squeeze_dims(squeeze_dims); |
| 5095 | return builder_.Finish(); |
| 5096 | } |
| 5097 | |
| 5098 | inline flatbuffers::Offset<SqueezeOptions> CreateSqueezeOptionsDirect( |
| 5099 | flatbuffers::FlatBufferBuilder &_fbb, |
| 5100 | const std::vector<int32_t> *squeeze_dims = nullptr) { |
| 5101 | auto squeeze_dims__ = squeeze_dims ? _fbb.CreateVector<int32_t>(*squeeze_dims) : 0; |
| 5102 | return tflite::CreateSqueezeOptions( |
| 5103 | _fbb, |
| 5104 | squeeze_dims__); |
| 5105 | } |
| 5106 | |
| 5107 | struct SplitOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 5108 | typedef SplitOptionsBuilder Builder; |
| 5109 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 5110 | VT_NUM_SPLITS = 4 |
| 5111 | }; |
| 5112 | int32_t num_splits() const { |
| 5113 | return GetField<int32_t>(VT_NUM_SPLITS, 0); |
| 5114 | } |
| 5115 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 5116 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 5117 | VerifyField<int32_t>(verifier, VT_NUM_SPLITS, 4) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 5118 | verifier.EndTable(); |
| 5119 | } |
| 5120 | }; |
| 5121 | |
| 5122 | struct SplitOptionsBuilder { |
| 5123 | typedef SplitOptions Table; |
| 5124 | flatbuffers::FlatBufferBuilder &fbb_; |
| 5125 | flatbuffers::uoffset_t start_; |
| 5126 | void add_num_splits(int32_t num_splits) { |
| 5127 | fbb_.AddElement<int32_t>(SplitOptions::VT_NUM_SPLITS, num_splits, 0); |
| 5128 | } |
| 5129 | explicit SplitOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 5130 | : fbb_(_fbb) { |
| 5131 | start_ = fbb_.StartTable(); |
| 5132 | } |
| 5133 | flatbuffers::Offset<SplitOptions> Finish() { |
| 5134 | const auto end = fbb_.EndTable(start_); |
| 5135 | auto o = flatbuffers::Offset<SplitOptions>(end); |
| 5136 | return o; |
| 5137 | } |
| 5138 | }; |
| 5139 | |
| 5140 | inline flatbuffers::Offset<SplitOptions> CreateSplitOptions( |
| 5141 | flatbuffers::FlatBufferBuilder &_fbb, |
| 5142 | int32_t num_splits = 0) { |
| 5143 | SplitOptionsBuilder builder_(_fbb); |
| 5144 | builder_.add_num_splits(num_splits); |
| 5145 | return builder_.Finish(); |
| 5146 | } |
| 5147 | |
| 5148 | struct SplitVOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 5149 | typedef SplitVOptionsBuilder Builder; |
| 5150 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 5151 | VT_NUM_SPLITS = 4 |
| 5152 | }; |
| 5153 | int32_t num_splits() const { |
| 5154 | return GetField<int32_t>(VT_NUM_SPLITS, 0); |
| 5155 | } |
| 5156 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 5157 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 5158 | VerifyField<int32_t>(verifier, VT_NUM_SPLITS, 4) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 5159 | verifier.EndTable(); |
| 5160 | } |
| 5161 | }; |
| 5162 | |
| 5163 | struct SplitVOptionsBuilder { |
| 5164 | typedef SplitVOptions Table; |
| 5165 | flatbuffers::FlatBufferBuilder &fbb_; |
| 5166 | flatbuffers::uoffset_t start_; |
| 5167 | void add_num_splits(int32_t num_splits) { |
| 5168 | fbb_.AddElement<int32_t>(SplitVOptions::VT_NUM_SPLITS, num_splits, 0); |
| 5169 | } |
| 5170 | explicit SplitVOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 5171 | : fbb_(_fbb) { |
| 5172 | start_ = fbb_.StartTable(); |
| 5173 | } |
| 5174 | flatbuffers::Offset<SplitVOptions> Finish() { |
| 5175 | const auto end = fbb_.EndTable(start_); |
| 5176 | auto o = flatbuffers::Offset<SplitVOptions>(end); |
| 5177 | return o; |
| 5178 | } |
| 5179 | }; |
| 5180 | |
| 5181 | inline flatbuffers::Offset<SplitVOptions> CreateSplitVOptions( |
| 5182 | flatbuffers::FlatBufferBuilder &_fbb, |
| 5183 | int32_t num_splits = 0) { |
| 5184 | SplitVOptionsBuilder builder_(_fbb); |
| 5185 | builder_.add_num_splits(num_splits); |
| 5186 | return builder_.Finish(); |
| 5187 | } |
| 5188 | |
| 5189 | struct StridedSliceOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 5190 | typedef StridedSliceOptionsBuilder Builder; |
| 5191 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 5192 | VT_BEGIN_MASK = 4, |
| 5193 | VT_END_MASK = 6, |
| 5194 | VT_ELLIPSIS_MASK = 8, |
| 5195 | VT_NEW_AXIS_MASK = 10, |
| 5196 | VT_SHRINK_AXIS_MASK = 12 |
| 5197 | }; |
| 5198 | int32_t begin_mask() const { |
| 5199 | return GetField<int32_t>(VT_BEGIN_MASK, 0); |
| 5200 | } |
| 5201 | int32_t end_mask() const { |
| 5202 | return GetField<int32_t>(VT_END_MASK, 0); |
| 5203 | } |
| 5204 | int32_t ellipsis_mask() const { |
| 5205 | return GetField<int32_t>(VT_ELLIPSIS_MASK, 0); |
| 5206 | } |
| 5207 | int32_t new_axis_mask() const { |
| 5208 | return GetField<int32_t>(VT_NEW_AXIS_MASK, 0); |
| 5209 | } |
| 5210 | int32_t shrink_axis_mask() const { |
| 5211 | return GetField<int32_t>(VT_SHRINK_AXIS_MASK, 0); |
| 5212 | } |
| 5213 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 5214 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 5215 | VerifyField<int32_t>(verifier, VT_BEGIN_MASK, 4) && |
| 5216 | VerifyField<int32_t>(verifier, VT_END_MASK, 4) && |
| 5217 | VerifyField<int32_t>(verifier, VT_ELLIPSIS_MASK, 4) && |
| 5218 | VerifyField<int32_t>(verifier, VT_NEW_AXIS_MASK, 4) && |
| 5219 | VerifyField<int32_t>(verifier, VT_SHRINK_AXIS_MASK, 4) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 5220 | verifier.EndTable(); |
| 5221 | } |
| 5222 | }; |
| 5223 | |
| 5224 | struct StridedSliceOptionsBuilder { |
| 5225 | typedef StridedSliceOptions Table; |
| 5226 | flatbuffers::FlatBufferBuilder &fbb_; |
| 5227 | flatbuffers::uoffset_t start_; |
| 5228 | void add_begin_mask(int32_t begin_mask) { |
| 5229 | fbb_.AddElement<int32_t>(StridedSliceOptions::VT_BEGIN_MASK, begin_mask, 0); |
| 5230 | } |
| 5231 | void add_end_mask(int32_t end_mask) { |
| 5232 | fbb_.AddElement<int32_t>(StridedSliceOptions::VT_END_MASK, end_mask, 0); |
| 5233 | } |
| 5234 | void add_ellipsis_mask(int32_t ellipsis_mask) { |
| 5235 | fbb_.AddElement<int32_t>(StridedSliceOptions::VT_ELLIPSIS_MASK, ellipsis_mask, 0); |
| 5236 | } |
| 5237 | void add_new_axis_mask(int32_t new_axis_mask) { |
| 5238 | fbb_.AddElement<int32_t>(StridedSliceOptions::VT_NEW_AXIS_MASK, new_axis_mask, 0); |
| 5239 | } |
| 5240 | void add_shrink_axis_mask(int32_t shrink_axis_mask) { |
| 5241 | fbb_.AddElement<int32_t>(StridedSliceOptions::VT_SHRINK_AXIS_MASK, shrink_axis_mask, 0); |
| 5242 | } |
| 5243 | explicit StridedSliceOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 5244 | : fbb_(_fbb) { |
| 5245 | start_ = fbb_.StartTable(); |
| 5246 | } |
| 5247 | flatbuffers::Offset<StridedSliceOptions> Finish() { |
| 5248 | const auto end = fbb_.EndTable(start_); |
| 5249 | auto o = flatbuffers::Offset<StridedSliceOptions>(end); |
| 5250 | return o; |
| 5251 | } |
| 5252 | }; |
| 5253 | |
| 5254 | inline flatbuffers::Offset<StridedSliceOptions> CreateStridedSliceOptions( |
| 5255 | flatbuffers::FlatBufferBuilder &_fbb, |
| 5256 | int32_t begin_mask = 0, |
| 5257 | int32_t end_mask = 0, |
| 5258 | int32_t ellipsis_mask = 0, |
| 5259 | int32_t new_axis_mask = 0, |
| 5260 | int32_t shrink_axis_mask = 0) { |
| 5261 | StridedSliceOptionsBuilder builder_(_fbb); |
| 5262 | builder_.add_shrink_axis_mask(shrink_axis_mask); |
| 5263 | builder_.add_new_axis_mask(new_axis_mask); |
| 5264 | builder_.add_ellipsis_mask(ellipsis_mask); |
| 5265 | builder_.add_end_mask(end_mask); |
| 5266 | builder_.add_begin_mask(begin_mask); |
| 5267 | return builder_.Finish(); |
| 5268 | } |
| 5269 | |
| 5270 | struct LogSoftmaxOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 5271 | typedef LogSoftmaxOptionsBuilder Builder; |
| 5272 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 5273 | return VerifyTableStart(verifier) && |
| 5274 | verifier.EndTable(); |
| 5275 | } |
| 5276 | }; |
| 5277 | |
| 5278 | struct LogSoftmaxOptionsBuilder { |
| 5279 | typedef LogSoftmaxOptions Table; |
| 5280 | flatbuffers::FlatBufferBuilder &fbb_; |
| 5281 | flatbuffers::uoffset_t start_; |
| 5282 | explicit LogSoftmaxOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 5283 | : fbb_(_fbb) { |
| 5284 | start_ = fbb_.StartTable(); |
| 5285 | } |
| 5286 | flatbuffers::Offset<LogSoftmaxOptions> Finish() { |
| 5287 | const auto end = fbb_.EndTable(start_); |
| 5288 | auto o = flatbuffers::Offset<LogSoftmaxOptions>(end); |
| 5289 | return o; |
| 5290 | } |
| 5291 | }; |
| 5292 | |
| 5293 | inline flatbuffers::Offset<LogSoftmaxOptions> CreateLogSoftmaxOptions( |
| 5294 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 5295 | LogSoftmaxOptionsBuilder builder_(_fbb); |
| 5296 | return builder_.Finish(); |
| 5297 | } |
| 5298 | |
| 5299 | struct CastOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 5300 | typedef CastOptionsBuilder Builder; |
| 5301 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 5302 | VT_IN_DATA_TYPE = 4, |
| 5303 | VT_OUT_DATA_TYPE = 6 |
| 5304 | }; |
| 5305 | tflite::TensorType in_data_type() const { |
| 5306 | return static_cast<tflite::TensorType>(GetField<int8_t>(VT_IN_DATA_TYPE, 0)); |
| 5307 | } |
| 5308 | tflite::TensorType out_data_type() const { |
| 5309 | return static_cast<tflite::TensorType>(GetField<int8_t>(VT_OUT_DATA_TYPE, 0)); |
| 5310 | } |
| 5311 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 5312 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 5313 | VerifyField<int8_t>(verifier, VT_IN_DATA_TYPE, 1) && |
| 5314 | VerifyField<int8_t>(verifier, VT_OUT_DATA_TYPE, 1) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 5315 | verifier.EndTable(); |
| 5316 | } |
| 5317 | }; |
| 5318 | |
| 5319 | struct CastOptionsBuilder { |
| 5320 | typedef CastOptions Table; |
| 5321 | flatbuffers::FlatBufferBuilder &fbb_; |
| 5322 | flatbuffers::uoffset_t start_; |
| 5323 | void add_in_data_type(tflite::TensorType in_data_type) { |
| 5324 | fbb_.AddElement<int8_t>(CastOptions::VT_IN_DATA_TYPE, static_cast<int8_t>(in_data_type), 0); |
| 5325 | } |
| 5326 | void add_out_data_type(tflite::TensorType out_data_type) { |
| 5327 | fbb_.AddElement<int8_t>(CastOptions::VT_OUT_DATA_TYPE, static_cast<int8_t>(out_data_type), 0); |
| 5328 | } |
| 5329 | explicit CastOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 5330 | : fbb_(_fbb) { |
| 5331 | start_ = fbb_.StartTable(); |
| 5332 | } |
| 5333 | flatbuffers::Offset<CastOptions> Finish() { |
| 5334 | const auto end = fbb_.EndTable(start_); |
| 5335 | auto o = flatbuffers::Offset<CastOptions>(end); |
| 5336 | return o; |
| 5337 | } |
| 5338 | }; |
| 5339 | |
| 5340 | inline flatbuffers::Offset<CastOptions> CreateCastOptions( |
| 5341 | flatbuffers::FlatBufferBuilder &_fbb, |
| 5342 | tflite::TensorType in_data_type = tflite::TensorType_FLOAT32, |
| 5343 | tflite::TensorType out_data_type = tflite::TensorType_FLOAT32) { |
| 5344 | CastOptionsBuilder builder_(_fbb); |
| 5345 | builder_.add_out_data_type(out_data_type); |
| 5346 | builder_.add_in_data_type(in_data_type); |
| 5347 | return builder_.Finish(); |
| 5348 | } |
| 5349 | |
| 5350 | struct DequantizeOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 5351 | typedef DequantizeOptionsBuilder Builder; |
| 5352 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 5353 | return VerifyTableStart(verifier) && |
| 5354 | verifier.EndTable(); |
| 5355 | } |
| 5356 | }; |
| 5357 | |
| 5358 | struct DequantizeOptionsBuilder { |
| 5359 | typedef DequantizeOptions Table; |
| 5360 | flatbuffers::FlatBufferBuilder &fbb_; |
| 5361 | flatbuffers::uoffset_t start_; |
| 5362 | explicit DequantizeOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 5363 | : fbb_(_fbb) { |
| 5364 | start_ = fbb_.StartTable(); |
| 5365 | } |
| 5366 | flatbuffers::Offset<DequantizeOptions> Finish() { |
| 5367 | const auto end = fbb_.EndTable(start_); |
| 5368 | auto o = flatbuffers::Offset<DequantizeOptions>(end); |
| 5369 | return o; |
| 5370 | } |
| 5371 | }; |
| 5372 | |
| 5373 | inline flatbuffers::Offset<DequantizeOptions> CreateDequantizeOptions( |
| 5374 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 5375 | DequantizeOptionsBuilder builder_(_fbb); |
| 5376 | return builder_.Finish(); |
| 5377 | } |
| 5378 | |
| 5379 | struct MaximumMinimumOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 5380 | typedef MaximumMinimumOptionsBuilder Builder; |
| 5381 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 5382 | return VerifyTableStart(verifier) && |
| 5383 | verifier.EndTable(); |
| 5384 | } |
| 5385 | }; |
| 5386 | |
| 5387 | struct MaximumMinimumOptionsBuilder { |
| 5388 | typedef MaximumMinimumOptions Table; |
| 5389 | flatbuffers::FlatBufferBuilder &fbb_; |
| 5390 | flatbuffers::uoffset_t start_; |
| 5391 | explicit MaximumMinimumOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 5392 | : fbb_(_fbb) { |
| 5393 | start_ = fbb_.StartTable(); |
| 5394 | } |
| 5395 | flatbuffers::Offset<MaximumMinimumOptions> Finish() { |
| 5396 | const auto end = fbb_.EndTable(start_); |
| 5397 | auto o = flatbuffers::Offset<MaximumMinimumOptions>(end); |
| 5398 | return o; |
| 5399 | } |
| 5400 | }; |
| 5401 | |
| 5402 | inline flatbuffers::Offset<MaximumMinimumOptions> CreateMaximumMinimumOptions( |
| 5403 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 5404 | MaximumMinimumOptionsBuilder builder_(_fbb); |
| 5405 | return builder_.Finish(); |
| 5406 | } |
| 5407 | |
| 5408 | struct TileOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 5409 | typedef TileOptionsBuilder Builder; |
| 5410 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 5411 | return VerifyTableStart(verifier) && |
| 5412 | verifier.EndTable(); |
| 5413 | } |
| 5414 | }; |
| 5415 | |
| 5416 | struct TileOptionsBuilder { |
| 5417 | typedef TileOptions Table; |
| 5418 | flatbuffers::FlatBufferBuilder &fbb_; |
| 5419 | flatbuffers::uoffset_t start_; |
| 5420 | explicit TileOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 5421 | : fbb_(_fbb) { |
| 5422 | start_ = fbb_.StartTable(); |
| 5423 | } |
| 5424 | flatbuffers::Offset<TileOptions> Finish() { |
| 5425 | const auto end = fbb_.EndTable(start_); |
| 5426 | auto o = flatbuffers::Offset<TileOptions>(end); |
| 5427 | return o; |
| 5428 | } |
| 5429 | }; |
| 5430 | |
| 5431 | inline flatbuffers::Offset<TileOptions> CreateTileOptions( |
| 5432 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 5433 | TileOptionsBuilder builder_(_fbb); |
| 5434 | return builder_.Finish(); |
| 5435 | } |
| 5436 | |
| 5437 | struct ArgMaxOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 5438 | typedef ArgMaxOptionsBuilder Builder; |
| 5439 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 5440 | VT_OUTPUT_TYPE = 4 |
| 5441 | }; |
| 5442 | tflite::TensorType output_type() const { |
| 5443 | return static_cast<tflite::TensorType>(GetField<int8_t>(VT_OUTPUT_TYPE, 0)); |
| 5444 | } |
| 5445 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 5446 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 5447 | VerifyField<int8_t>(verifier, VT_OUTPUT_TYPE, 1) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 5448 | verifier.EndTable(); |
| 5449 | } |
| 5450 | }; |
| 5451 | |
| 5452 | struct ArgMaxOptionsBuilder { |
| 5453 | typedef ArgMaxOptions Table; |
| 5454 | flatbuffers::FlatBufferBuilder &fbb_; |
| 5455 | flatbuffers::uoffset_t start_; |
| 5456 | void add_output_type(tflite::TensorType output_type) { |
| 5457 | fbb_.AddElement<int8_t>(ArgMaxOptions::VT_OUTPUT_TYPE, static_cast<int8_t>(output_type), 0); |
| 5458 | } |
| 5459 | explicit ArgMaxOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 5460 | : fbb_(_fbb) { |
| 5461 | start_ = fbb_.StartTable(); |
| 5462 | } |
| 5463 | flatbuffers::Offset<ArgMaxOptions> Finish() { |
| 5464 | const auto end = fbb_.EndTable(start_); |
| 5465 | auto o = flatbuffers::Offset<ArgMaxOptions>(end); |
| 5466 | return o; |
| 5467 | } |
| 5468 | }; |
| 5469 | |
| 5470 | inline flatbuffers::Offset<ArgMaxOptions> CreateArgMaxOptions( |
| 5471 | flatbuffers::FlatBufferBuilder &_fbb, |
| 5472 | tflite::TensorType output_type = tflite::TensorType_FLOAT32) { |
| 5473 | ArgMaxOptionsBuilder builder_(_fbb); |
| 5474 | builder_.add_output_type(output_type); |
| 5475 | return builder_.Finish(); |
| 5476 | } |
| 5477 | |
| 5478 | struct ArgMinOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 5479 | typedef ArgMinOptionsBuilder Builder; |
| 5480 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 5481 | VT_OUTPUT_TYPE = 4 |
| 5482 | }; |
| 5483 | tflite::TensorType output_type() const { |
| 5484 | return static_cast<tflite::TensorType>(GetField<int8_t>(VT_OUTPUT_TYPE, 0)); |
| 5485 | } |
| 5486 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 5487 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 5488 | VerifyField<int8_t>(verifier, VT_OUTPUT_TYPE, 1) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 5489 | verifier.EndTable(); |
| 5490 | } |
| 5491 | }; |
| 5492 | |
| 5493 | struct ArgMinOptionsBuilder { |
| 5494 | typedef ArgMinOptions Table; |
| 5495 | flatbuffers::FlatBufferBuilder &fbb_; |
| 5496 | flatbuffers::uoffset_t start_; |
| 5497 | void add_output_type(tflite::TensorType output_type) { |
| 5498 | fbb_.AddElement<int8_t>(ArgMinOptions::VT_OUTPUT_TYPE, static_cast<int8_t>(output_type), 0); |
| 5499 | } |
| 5500 | explicit ArgMinOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 5501 | : fbb_(_fbb) { |
| 5502 | start_ = fbb_.StartTable(); |
| 5503 | } |
| 5504 | flatbuffers::Offset<ArgMinOptions> Finish() { |
| 5505 | const auto end = fbb_.EndTable(start_); |
| 5506 | auto o = flatbuffers::Offset<ArgMinOptions>(end); |
| 5507 | return o; |
| 5508 | } |
| 5509 | }; |
| 5510 | |
| 5511 | inline flatbuffers::Offset<ArgMinOptions> CreateArgMinOptions( |
| 5512 | flatbuffers::FlatBufferBuilder &_fbb, |
| 5513 | tflite::TensorType output_type = tflite::TensorType_FLOAT32) { |
| 5514 | ArgMinOptionsBuilder builder_(_fbb); |
| 5515 | builder_.add_output_type(output_type); |
| 5516 | return builder_.Finish(); |
| 5517 | } |
| 5518 | |
| 5519 | struct GreaterOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 5520 | typedef GreaterOptionsBuilder Builder; |
| 5521 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 5522 | return VerifyTableStart(verifier) && |
| 5523 | verifier.EndTable(); |
| 5524 | } |
| 5525 | }; |
| 5526 | |
| 5527 | struct GreaterOptionsBuilder { |
| 5528 | typedef GreaterOptions Table; |
| 5529 | flatbuffers::FlatBufferBuilder &fbb_; |
| 5530 | flatbuffers::uoffset_t start_; |
| 5531 | explicit GreaterOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 5532 | : fbb_(_fbb) { |
| 5533 | start_ = fbb_.StartTable(); |
| 5534 | } |
| 5535 | flatbuffers::Offset<GreaterOptions> Finish() { |
| 5536 | const auto end = fbb_.EndTable(start_); |
| 5537 | auto o = flatbuffers::Offset<GreaterOptions>(end); |
| 5538 | return o; |
| 5539 | } |
| 5540 | }; |
| 5541 | |
| 5542 | inline flatbuffers::Offset<GreaterOptions> CreateGreaterOptions( |
| 5543 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 5544 | GreaterOptionsBuilder builder_(_fbb); |
| 5545 | return builder_.Finish(); |
| 5546 | } |
| 5547 | |
| 5548 | struct GreaterEqualOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 5549 | typedef GreaterEqualOptionsBuilder Builder; |
| 5550 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 5551 | return VerifyTableStart(verifier) && |
| 5552 | verifier.EndTable(); |
| 5553 | } |
| 5554 | }; |
| 5555 | |
| 5556 | struct GreaterEqualOptionsBuilder { |
| 5557 | typedef GreaterEqualOptions Table; |
| 5558 | flatbuffers::FlatBufferBuilder &fbb_; |
| 5559 | flatbuffers::uoffset_t start_; |
| 5560 | explicit GreaterEqualOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 5561 | : fbb_(_fbb) { |
| 5562 | start_ = fbb_.StartTable(); |
| 5563 | } |
| 5564 | flatbuffers::Offset<GreaterEqualOptions> Finish() { |
| 5565 | const auto end = fbb_.EndTable(start_); |
| 5566 | auto o = flatbuffers::Offset<GreaterEqualOptions>(end); |
| 5567 | return o; |
| 5568 | } |
| 5569 | }; |
| 5570 | |
| 5571 | inline flatbuffers::Offset<GreaterEqualOptions> CreateGreaterEqualOptions( |
| 5572 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 5573 | GreaterEqualOptionsBuilder builder_(_fbb); |
| 5574 | return builder_.Finish(); |
| 5575 | } |
| 5576 | |
| 5577 | struct LessOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 5578 | typedef LessOptionsBuilder Builder; |
| 5579 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 5580 | return VerifyTableStart(verifier) && |
| 5581 | verifier.EndTable(); |
| 5582 | } |
| 5583 | }; |
| 5584 | |
| 5585 | struct LessOptionsBuilder { |
| 5586 | typedef LessOptions Table; |
| 5587 | flatbuffers::FlatBufferBuilder &fbb_; |
| 5588 | flatbuffers::uoffset_t start_; |
| 5589 | explicit LessOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 5590 | : fbb_(_fbb) { |
| 5591 | start_ = fbb_.StartTable(); |
| 5592 | } |
| 5593 | flatbuffers::Offset<LessOptions> Finish() { |
| 5594 | const auto end = fbb_.EndTable(start_); |
| 5595 | auto o = flatbuffers::Offset<LessOptions>(end); |
| 5596 | return o; |
| 5597 | } |
| 5598 | }; |
| 5599 | |
| 5600 | inline flatbuffers::Offset<LessOptions> CreateLessOptions( |
| 5601 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 5602 | LessOptionsBuilder builder_(_fbb); |
| 5603 | return builder_.Finish(); |
| 5604 | } |
| 5605 | |
| 5606 | struct LessEqualOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 5607 | typedef LessEqualOptionsBuilder Builder; |
| 5608 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 5609 | return VerifyTableStart(verifier) && |
| 5610 | verifier.EndTable(); |
| 5611 | } |
| 5612 | }; |
| 5613 | |
| 5614 | struct LessEqualOptionsBuilder { |
| 5615 | typedef LessEqualOptions Table; |
| 5616 | flatbuffers::FlatBufferBuilder &fbb_; |
| 5617 | flatbuffers::uoffset_t start_; |
| 5618 | explicit LessEqualOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 5619 | : fbb_(_fbb) { |
| 5620 | start_ = fbb_.StartTable(); |
| 5621 | } |
| 5622 | flatbuffers::Offset<LessEqualOptions> Finish() { |
| 5623 | const auto end = fbb_.EndTable(start_); |
| 5624 | auto o = flatbuffers::Offset<LessEqualOptions>(end); |
| 5625 | return o; |
| 5626 | } |
| 5627 | }; |
| 5628 | |
| 5629 | inline flatbuffers::Offset<LessEqualOptions> CreateLessEqualOptions( |
| 5630 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 5631 | LessEqualOptionsBuilder builder_(_fbb); |
| 5632 | return builder_.Finish(); |
| 5633 | } |
| 5634 | |
| 5635 | struct NegOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 5636 | typedef NegOptionsBuilder Builder; |
| 5637 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 5638 | return VerifyTableStart(verifier) && |
| 5639 | verifier.EndTable(); |
| 5640 | } |
| 5641 | }; |
| 5642 | |
| 5643 | struct NegOptionsBuilder { |
| 5644 | typedef NegOptions Table; |
| 5645 | flatbuffers::FlatBufferBuilder &fbb_; |
| 5646 | flatbuffers::uoffset_t start_; |
| 5647 | explicit NegOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 5648 | : fbb_(_fbb) { |
| 5649 | start_ = fbb_.StartTable(); |
| 5650 | } |
| 5651 | flatbuffers::Offset<NegOptions> Finish() { |
| 5652 | const auto end = fbb_.EndTable(start_); |
| 5653 | auto o = flatbuffers::Offset<NegOptions>(end); |
| 5654 | return o; |
| 5655 | } |
| 5656 | }; |
| 5657 | |
| 5658 | inline flatbuffers::Offset<NegOptions> CreateNegOptions( |
| 5659 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 5660 | NegOptionsBuilder builder_(_fbb); |
| 5661 | return builder_.Finish(); |
| 5662 | } |
| 5663 | |
| 5664 | struct SelectOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 5665 | typedef SelectOptionsBuilder Builder; |
| 5666 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 5667 | return VerifyTableStart(verifier) && |
| 5668 | verifier.EndTable(); |
| 5669 | } |
| 5670 | }; |
| 5671 | |
| 5672 | struct SelectOptionsBuilder { |
| 5673 | typedef SelectOptions Table; |
| 5674 | flatbuffers::FlatBufferBuilder &fbb_; |
| 5675 | flatbuffers::uoffset_t start_; |
| 5676 | explicit SelectOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 5677 | : fbb_(_fbb) { |
| 5678 | start_ = fbb_.StartTable(); |
| 5679 | } |
| 5680 | flatbuffers::Offset<SelectOptions> Finish() { |
| 5681 | const auto end = fbb_.EndTable(start_); |
| 5682 | auto o = flatbuffers::Offset<SelectOptions>(end); |
| 5683 | return o; |
| 5684 | } |
| 5685 | }; |
| 5686 | |
| 5687 | inline flatbuffers::Offset<SelectOptions> CreateSelectOptions( |
| 5688 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 5689 | SelectOptionsBuilder builder_(_fbb); |
| 5690 | return builder_.Finish(); |
| 5691 | } |
| 5692 | |
| 5693 | struct SliceOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 5694 | typedef SliceOptionsBuilder Builder; |
| 5695 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 5696 | return VerifyTableStart(verifier) && |
| 5697 | verifier.EndTable(); |
| 5698 | } |
| 5699 | }; |
| 5700 | |
| 5701 | struct SliceOptionsBuilder { |
| 5702 | typedef SliceOptions Table; |
| 5703 | flatbuffers::FlatBufferBuilder &fbb_; |
| 5704 | flatbuffers::uoffset_t start_; |
| 5705 | explicit SliceOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 5706 | : fbb_(_fbb) { |
| 5707 | start_ = fbb_.StartTable(); |
| 5708 | } |
| 5709 | flatbuffers::Offset<SliceOptions> Finish() { |
| 5710 | const auto end = fbb_.EndTable(start_); |
| 5711 | auto o = flatbuffers::Offset<SliceOptions>(end); |
| 5712 | return o; |
| 5713 | } |
| 5714 | }; |
| 5715 | |
| 5716 | inline flatbuffers::Offset<SliceOptions> CreateSliceOptions( |
| 5717 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 5718 | SliceOptionsBuilder builder_(_fbb); |
| 5719 | return builder_.Finish(); |
| 5720 | } |
| 5721 | |
| 5722 | struct TransposeConvOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 5723 | typedef TransposeConvOptionsBuilder Builder; |
| 5724 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 5725 | VT_PADDING = 4, |
| 5726 | VT_STRIDE_W = 6, |
| 5727 | VT_STRIDE_H = 8 |
| 5728 | }; |
| 5729 | tflite::Padding padding() const { |
| 5730 | return static_cast<tflite::Padding>(GetField<int8_t>(VT_PADDING, 0)); |
| 5731 | } |
| 5732 | int32_t stride_w() const { |
| 5733 | return GetField<int32_t>(VT_STRIDE_W, 0); |
| 5734 | } |
| 5735 | int32_t stride_h() const { |
| 5736 | return GetField<int32_t>(VT_STRIDE_H, 0); |
| 5737 | } |
| 5738 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 5739 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 5740 | VerifyField<int8_t>(verifier, VT_PADDING, 1) && |
| 5741 | VerifyField<int32_t>(verifier, VT_STRIDE_W, 4) && |
| 5742 | VerifyField<int32_t>(verifier, VT_STRIDE_H, 4) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 5743 | verifier.EndTable(); |
| 5744 | } |
| 5745 | }; |
| 5746 | |
| 5747 | struct TransposeConvOptionsBuilder { |
| 5748 | typedef TransposeConvOptions Table; |
| 5749 | flatbuffers::FlatBufferBuilder &fbb_; |
| 5750 | flatbuffers::uoffset_t start_; |
| 5751 | void add_padding(tflite::Padding padding) { |
| 5752 | fbb_.AddElement<int8_t>(TransposeConvOptions::VT_PADDING, static_cast<int8_t>(padding), 0); |
| 5753 | } |
| 5754 | void add_stride_w(int32_t stride_w) { |
| 5755 | fbb_.AddElement<int32_t>(TransposeConvOptions::VT_STRIDE_W, stride_w, 0); |
| 5756 | } |
| 5757 | void add_stride_h(int32_t stride_h) { |
| 5758 | fbb_.AddElement<int32_t>(TransposeConvOptions::VT_STRIDE_H, stride_h, 0); |
| 5759 | } |
| 5760 | explicit TransposeConvOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 5761 | : fbb_(_fbb) { |
| 5762 | start_ = fbb_.StartTable(); |
| 5763 | } |
| 5764 | flatbuffers::Offset<TransposeConvOptions> Finish() { |
| 5765 | const auto end = fbb_.EndTable(start_); |
| 5766 | auto o = flatbuffers::Offset<TransposeConvOptions>(end); |
| 5767 | return o; |
| 5768 | } |
| 5769 | }; |
| 5770 | |
| 5771 | inline flatbuffers::Offset<TransposeConvOptions> CreateTransposeConvOptions( |
| 5772 | flatbuffers::FlatBufferBuilder &_fbb, |
| 5773 | tflite::Padding padding = tflite::Padding_SAME, |
| 5774 | int32_t stride_w = 0, |
| 5775 | int32_t stride_h = 0) { |
| 5776 | TransposeConvOptionsBuilder builder_(_fbb); |
| 5777 | builder_.add_stride_h(stride_h); |
| 5778 | builder_.add_stride_w(stride_w); |
| 5779 | builder_.add_padding(padding); |
| 5780 | return builder_.Finish(); |
| 5781 | } |
| 5782 | |
| 5783 | struct ExpandDimsOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 5784 | typedef ExpandDimsOptionsBuilder Builder; |
| 5785 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 5786 | return VerifyTableStart(verifier) && |
| 5787 | verifier.EndTable(); |
| 5788 | } |
| 5789 | }; |
| 5790 | |
| 5791 | struct ExpandDimsOptionsBuilder { |
| 5792 | typedef ExpandDimsOptions Table; |
| 5793 | flatbuffers::FlatBufferBuilder &fbb_; |
| 5794 | flatbuffers::uoffset_t start_; |
| 5795 | explicit ExpandDimsOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 5796 | : fbb_(_fbb) { |
| 5797 | start_ = fbb_.StartTable(); |
| 5798 | } |
| 5799 | flatbuffers::Offset<ExpandDimsOptions> Finish() { |
| 5800 | const auto end = fbb_.EndTable(start_); |
| 5801 | auto o = flatbuffers::Offset<ExpandDimsOptions>(end); |
| 5802 | return o; |
| 5803 | } |
| 5804 | }; |
| 5805 | |
| 5806 | inline flatbuffers::Offset<ExpandDimsOptions> CreateExpandDimsOptions( |
| 5807 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 5808 | ExpandDimsOptionsBuilder builder_(_fbb); |
| 5809 | return builder_.Finish(); |
| 5810 | } |
| 5811 | |
| 5812 | struct SparseToDenseOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 5813 | typedef SparseToDenseOptionsBuilder Builder; |
| 5814 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 5815 | VT_VALIDATE_INDICES = 4 |
| 5816 | }; |
| 5817 | bool validate_indices() const { |
| 5818 | return GetField<uint8_t>(VT_VALIDATE_INDICES, 0) != 0; |
| 5819 | } |
| 5820 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 5821 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 5822 | VerifyField<uint8_t>(verifier, VT_VALIDATE_INDICES, 1) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 5823 | verifier.EndTable(); |
| 5824 | } |
| 5825 | }; |
| 5826 | |
| 5827 | struct SparseToDenseOptionsBuilder { |
| 5828 | typedef SparseToDenseOptions Table; |
| 5829 | flatbuffers::FlatBufferBuilder &fbb_; |
| 5830 | flatbuffers::uoffset_t start_; |
| 5831 | void add_validate_indices(bool validate_indices) { |
| 5832 | fbb_.AddElement<uint8_t>(SparseToDenseOptions::VT_VALIDATE_INDICES, static_cast<uint8_t>(validate_indices), 0); |
| 5833 | } |
| 5834 | explicit SparseToDenseOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 5835 | : fbb_(_fbb) { |
| 5836 | start_ = fbb_.StartTable(); |
| 5837 | } |
| 5838 | flatbuffers::Offset<SparseToDenseOptions> Finish() { |
| 5839 | const auto end = fbb_.EndTable(start_); |
| 5840 | auto o = flatbuffers::Offset<SparseToDenseOptions>(end); |
| 5841 | return o; |
| 5842 | } |
| 5843 | }; |
| 5844 | |
| 5845 | inline flatbuffers::Offset<SparseToDenseOptions> CreateSparseToDenseOptions( |
| 5846 | flatbuffers::FlatBufferBuilder &_fbb, |
| 5847 | bool validate_indices = false) { |
| 5848 | SparseToDenseOptionsBuilder builder_(_fbb); |
| 5849 | builder_.add_validate_indices(validate_indices); |
| 5850 | return builder_.Finish(); |
| 5851 | } |
| 5852 | |
| 5853 | struct EqualOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 5854 | typedef EqualOptionsBuilder Builder; |
| 5855 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 5856 | return VerifyTableStart(verifier) && |
| 5857 | verifier.EndTable(); |
| 5858 | } |
| 5859 | }; |
| 5860 | |
| 5861 | struct EqualOptionsBuilder { |
| 5862 | typedef EqualOptions Table; |
| 5863 | flatbuffers::FlatBufferBuilder &fbb_; |
| 5864 | flatbuffers::uoffset_t start_; |
| 5865 | explicit EqualOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 5866 | : fbb_(_fbb) { |
| 5867 | start_ = fbb_.StartTable(); |
| 5868 | } |
| 5869 | flatbuffers::Offset<EqualOptions> Finish() { |
| 5870 | const auto end = fbb_.EndTable(start_); |
| 5871 | auto o = flatbuffers::Offset<EqualOptions>(end); |
| 5872 | return o; |
| 5873 | } |
| 5874 | }; |
| 5875 | |
| 5876 | inline flatbuffers::Offset<EqualOptions> CreateEqualOptions( |
| 5877 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 5878 | EqualOptionsBuilder builder_(_fbb); |
| 5879 | return builder_.Finish(); |
| 5880 | } |
| 5881 | |
| 5882 | struct NotEqualOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 5883 | typedef NotEqualOptionsBuilder Builder; |
| 5884 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 5885 | return VerifyTableStart(verifier) && |
| 5886 | verifier.EndTable(); |
| 5887 | } |
| 5888 | }; |
| 5889 | |
| 5890 | struct NotEqualOptionsBuilder { |
| 5891 | typedef NotEqualOptions Table; |
| 5892 | flatbuffers::FlatBufferBuilder &fbb_; |
| 5893 | flatbuffers::uoffset_t start_; |
| 5894 | explicit NotEqualOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 5895 | : fbb_(_fbb) { |
| 5896 | start_ = fbb_.StartTable(); |
| 5897 | } |
| 5898 | flatbuffers::Offset<NotEqualOptions> Finish() { |
| 5899 | const auto end = fbb_.EndTable(start_); |
| 5900 | auto o = flatbuffers::Offset<NotEqualOptions>(end); |
| 5901 | return o; |
| 5902 | } |
| 5903 | }; |
| 5904 | |
| 5905 | inline flatbuffers::Offset<NotEqualOptions> CreateNotEqualOptions( |
| 5906 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 5907 | NotEqualOptionsBuilder builder_(_fbb); |
| 5908 | return builder_.Finish(); |
| 5909 | } |
| 5910 | |
| 5911 | struct ShapeOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 5912 | typedef ShapeOptionsBuilder Builder; |
| 5913 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 5914 | VT_OUT_TYPE = 4 |
| 5915 | }; |
| 5916 | tflite::TensorType out_type() const { |
| 5917 | return static_cast<tflite::TensorType>(GetField<int8_t>(VT_OUT_TYPE, 0)); |
| 5918 | } |
| 5919 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 5920 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 5921 | VerifyField<int8_t>(verifier, VT_OUT_TYPE, 1) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 5922 | verifier.EndTable(); |
| 5923 | } |
| 5924 | }; |
| 5925 | |
| 5926 | struct ShapeOptionsBuilder { |
| 5927 | typedef ShapeOptions Table; |
| 5928 | flatbuffers::FlatBufferBuilder &fbb_; |
| 5929 | flatbuffers::uoffset_t start_; |
| 5930 | void add_out_type(tflite::TensorType out_type) { |
| 5931 | fbb_.AddElement<int8_t>(ShapeOptions::VT_OUT_TYPE, static_cast<int8_t>(out_type), 0); |
| 5932 | } |
| 5933 | explicit ShapeOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 5934 | : fbb_(_fbb) { |
| 5935 | start_ = fbb_.StartTable(); |
| 5936 | } |
| 5937 | flatbuffers::Offset<ShapeOptions> Finish() { |
| 5938 | const auto end = fbb_.EndTable(start_); |
| 5939 | auto o = flatbuffers::Offset<ShapeOptions>(end); |
| 5940 | return o; |
| 5941 | } |
| 5942 | }; |
| 5943 | |
| 5944 | inline flatbuffers::Offset<ShapeOptions> CreateShapeOptions( |
| 5945 | flatbuffers::FlatBufferBuilder &_fbb, |
| 5946 | tflite::TensorType out_type = tflite::TensorType_FLOAT32) { |
| 5947 | ShapeOptionsBuilder builder_(_fbb); |
| 5948 | builder_.add_out_type(out_type); |
| 5949 | return builder_.Finish(); |
| 5950 | } |
| 5951 | |
| 5952 | struct RankOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 5953 | typedef RankOptionsBuilder Builder; |
| 5954 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 5955 | return VerifyTableStart(verifier) && |
| 5956 | verifier.EndTable(); |
| 5957 | } |
| 5958 | }; |
| 5959 | |
| 5960 | struct RankOptionsBuilder { |
| 5961 | typedef RankOptions Table; |
| 5962 | flatbuffers::FlatBufferBuilder &fbb_; |
| 5963 | flatbuffers::uoffset_t start_; |
| 5964 | explicit RankOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 5965 | : fbb_(_fbb) { |
| 5966 | start_ = fbb_.StartTable(); |
| 5967 | } |
| 5968 | flatbuffers::Offset<RankOptions> Finish() { |
| 5969 | const auto end = fbb_.EndTable(start_); |
| 5970 | auto o = flatbuffers::Offset<RankOptions>(end); |
| 5971 | return o; |
| 5972 | } |
| 5973 | }; |
| 5974 | |
| 5975 | inline flatbuffers::Offset<RankOptions> CreateRankOptions( |
| 5976 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 5977 | RankOptionsBuilder builder_(_fbb); |
| 5978 | return builder_.Finish(); |
| 5979 | } |
| 5980 | |
| 5981 | struct PowOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 5982 | typedef PowOptionsBuilder Builder; |
| 5983 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 5984 | return VerifyTableStart(verifier) && |
| 5985 | verifier.EndTable(); |
| 5986 | } |
| 5987 | }; |
| 5988 | |
| 5989 | struct PowOptionsBuilder { |
| 5990 | typedef PowOptions Table; |
| 5991 | flatbuffers::FlatBufferBuilder &fbb_; |
| 5992 | flatbuffers::uoffset_t start_; |
| 5993 | explicit PowOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 5994 | : fbb_(_fbb) { |
| 5995 | start_ = fbb_.StartTable(); |
| 5996 | } |
| 5997 | flatbuffers::Offset<PowOptions> Finish() { |
| 5998 | const auto end = fbb_.EndTable(start_); |
| 5999 | auto o = flatbuffers::Offset<PowOptions>(end); |
| 6000 | return o; |
| 6001 | } |
| 6002 | }; |
| 6003 | |
| 6004 | inline flatbuffers::Offset<PowOptions> CreatePowOptions( |
| 6005 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 6006 | PowOptionsBuilder builder_(_fbb); |
| 6007 | return builder_.Finish(); |
| 6008 | } |
| 6009 | |
| 6010 | struct FakeQuantOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 6011 | typedef FakeQuantOptionsBuilder Builder; |
| 6012 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 6013 | VT_MIN = 4, |
| 6014 | VT_MAX = 6, |
| 6015 | VT_NUM_BITS = 8, |
| 6016 | VT_NARROW_RANGE = 10 |
| 6017 | }; |
| 6018 | float min() const { |
| 6019 | return GetField<float>(VT_MIN, 0.0f); |
| 6020 | } |
| 6021 | float max() const { |
| 6022 | return GetField<float>(VT_MAX, 0.0f); |
| 6023 | } |
| 6024 | int32_t num_bits() const { |
| 6025 | return GetField<int32_t>(VT_NUM_BITS, 0); |
| 6026 | } |
| 6027 | bool narrow_range() const { |
| 6028 | return GetField<uint8_t>(VT_NARROW_RANGE, 0) != 0; |
| 6029 | } |
| 6030 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 6031 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 6032 | VerifyField<float>(verifier, VT_MIN, 4) && |
| 6033 | VerifyField<float>(verifier, VT_MAX, 4) && |
| 6034 | VerifyField<int32_t>(verifier, VT_NUM_BITS, 4) && |
| 6035 | VerifyField<uint8_t>(verifier, VT_NARROW_RANGE, 1) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 6036 | verifier.EndTable(); |
| 6037 | } |
| 6038 | }; |
| 6039 | |
| 6040 | struct FakeQuantOptionsBuilder { |
| 6041 | typedef FakeQuantOptions Table; |
| 6042 | flatbuffers::FlatBufferBuilder &fbb_; |
| 6043 | flatbuffers::uoffset_t start_; |
| 6044 | void add_min(float min) { |
| 6045 | fbb_.AddElement<float>(FakeQuantOptions::VT_MIN, min, 0.0f); |
| 6046 | } |
| 6047 | void add_max(float max) { |
| 6048 | fbb_.AddElement<float>(FakeQuantOptions::VT_MAX, max, 0.0f); |
| 6049 | } |
| 6050 | void add_num_bits(int32_t num_bits) { |
| 6051 | fbb_.AddElement<int32_t>(FakeQuantOptions::VT_NUM_BITS, num_bits, 0); |
| 6052 | } |
| 6053 | void add_narrow_range(bool narrow_range) { |
| 6054 | fbb_.AddElement<uint8_t>(FakeQuantOptions::VT_NARROW_RANGE, static_cast<uint8_t>(narrow_range), 0); |
| 6055 | } |
| 6056 | explicit FakeQuantOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 6057 | : fbb_(_fbb) { |
| 6058 | start_ = fbb_.StartTable(); |
| 6059 | } |
| 6060 | flatbuffers::Offset<FakeQuantOptions> Finish() { |
| 6061 | const auto end = fbb_.EndTable(start_); |
| 6062 | auto o = flatbuffers::Offset<FakeQuantOptions>(end); |
| 6063 | return o; |
| 6064 | } |
| 6065 | }; |
| 6066 | |
| 6067 | inline flatbuffers::Offset<FakeQuantOptions> CreateFakeQuantOptions( |
| 6068 | flatbuffers::FlatBufferBuilder &_fbb, |
| 6069 | float min = 0.0f, |
| 6070 | float max = 0.0f, |
| 6071 | int32_t num_bits = 0, |
| 6072 | bool narrow_range = false) { |
| 6073 | FakeQuantOptionsBuilder builder_(_fbb); |
| 6074 | builder_.add_num_bits(num_bits); |
| 6075 | builder_.add_max(max); |
| 6076 | builder_.add_min(min); |
| 6077 | builder_.add_narrow_range(narrow_range); |
| 6078 | return builder_.Finish(); |
| 6079 | } |
| 6080 | |
| 6081 | struct PackOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 6082 | typedef PackOptionsBuilder Builder; |
| 6083 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 6084 | VT_VALUES_COUNT = 4, |
| 6085 | VT_AXIS = 6 |
| 6086 | }; |
| 6087 | int32_t values_count() const { |
| 6088 | return GetField<int32_t>(VT_VALUES_COUNT, 0); |
| 6089 | } |
| 6090 | int32_t axis() const { |
| 6091 | return GetField<int32_t>(VT_AXIS, 0); |
| 6092 | } |
| 6093 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 6094 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 6095 | VerifyField<int32_t>(verifier, VT_VALUES_COUNT, 4) && |
| 6096 | VerifyField<int32_t>(verifier, VT_AXIS, 4) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 6097 | verifier.EndTable(); |
| 6098 | } |
| 6099 | }; |
| 6100 | |
| 6101 | struct PackOptionsBuilder { |
| 6102 | typedef PackOptions Table; |
| 6103 | flatbuffers::FlatBufferBuilder &fbb_; |
| 6104 | flatbuffers::uoffset_t start_; |
| 6105 | void add_values_count(int32_t values_count) { |
| 6106 | fbb_.AddElement<int32_t>(PackOptions::VT_VALUES_COUNT, values_count, 0); |
| 6107 | } |
| 6108 | void add_axis(int32_t axis) { |
| 6109 | fbb_.AddElement<int32_t>(PackOptions::VT_AXIS, axis, 0); |
| 6110 | } |
| 6111 | explicit PackOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 6112 | : fbb_(_fbb) { |
| 6113 | start_ = fbb_.StartTable(); |
| 6114 | } |
| 6115 | flatbuffers::Offset<PackOptions> Finish() { |
| 6116 | const auto end = fbb_.EndTable(start_); |
| 6117 | auto o = flatbuffers::Offset<PackOptions>(end); |
| 6118 | return o; |
| 6119 | } |
| 6120 | }; |
| 6121 | |
| 6122 | inline flatbuffers::Offset<PackOptions> CreatePackOptions( |
| 6123 | flatbuffers::FlatBufferBuilder &_fbb, |
| 6124 | int32_t values_count = 0, |
| 6125 | int32_t axis = 0) { |
| 6126 | PackOptionsBuilder builder_(_fbb); |
| 6127 | builder_.add_axis(axis); |
| 6128 | builder_.add_values_count(values_count); |
| 6129 | return builder_.Finish(); |
| 6130 | } |
| 6131 | |
| 6132 | struct LogicalOrOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 6133 | typedef LogicalOrOptionsBuilder Builder; |
| 6134 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 6135 | return VerifyTableStart(verifier) && |
| 6136 | verifier.EndTable(); |
| 6137 | } |
| 6138 | }; |
| 6139 | |
| 6140 | struct LogicalOrOptionsBuilder { |
| 6141 | typedef LogicalOrOptions Table; |
| 6142 | flatbuffers::FlatBufferBuilder &fbb_; |
| 6143 | flatbuffers::uoffset_t start_; |
| 6144 | explicit LogicalOrOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 6145 | : fbb_(_fbb) { |
| 6146 | start_ = fbb_.StartTable(); |
| 6147 | } |
| 6148 | flatbuffers::Offset<LogicalOrOptions> Finish() { |
| 6149 | const auto end = fbb_.EndTable(start_); |
| 6150 | auto o = flatbuffers::Offset<LogicalOrOptions>(end); |
| 6151 | return o; |
| 6152 | } |
| 6153 | }; |
| 6154 | |
| 6155 | inline flatbuffers::Offset<LogicalOrOptions> CreateLogicalOrOptions( |
| 6156 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 6157 | LogicalOrOptionsBuilder builder_(_fbb); |
| 6158 | return builder_.Finish(); |
| 6159 | } |
| 6160 | |
| 6161 | struct OneHotOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 6162 | typedef OneHotOptionsBuilder Builder; |
| 6163 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 6164 | VT_AXIS = 4 |
| 6165 | }; |
| 6166 | int32_t axis() const { |
| 6167 | return GetField<int32_t>(VT_AXIS, 0); |
| 6168 | } |
| 6169 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 6170 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 6171 | VerifyField<int32_t>(verifier, VT_AXIS, 4) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 6172 | verifier.EndTable(); |
| 6173 | } |
| 6174 | }; |
| 6175 | |
| 6176 | struct OneHotOptionsBuilder { |
| 6177 | typedef OneHotOptions Table; |
| 6178 | flatbuffers::FlatBufferBuilder &fbb_; |
| 6179 | flatbuffers::uoffset_t start_; |
| 6180 | void add_axis(int32_t axis) { |
| 6181 | fbb_.AddElement<int32_t>(OneHotOptions::VT_AXIS, axis, 0); |
| 6182 | } |
| 6183 | explicit OneHotOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 6184 | : fbb_(_fbb) { |
| 6185 | start_ = fbb_.StartTable(); |
| 6186 | } |
| 6187 | flatbuffers::Offset<OneHotOptions> Finish() { |
| 6188 | const auto end = fbb_.EndTable(start_); |
| 6189 | auto o = flatbuffers::Offset<OneHotOptions>(end); |
| 6190 | return o; |
| 6191 | } |
| 6192 | }; |
| 6193 | |
| 6194 | inline flatbuffers::Offset<OneHotOptions> CreateOneHotOptions( |
| 6195 | flatbuffers::FlatBufferBuilder &_fbb, |
| 6196 | int32_t axis = 0) { |
| 6197 | OneHotOptionsBuilder builder_(_fbb); |
| 6198 | builder_.add_axis(axis); |
| 6199 | return builder_.Finish(); |
| 6200 | } |
| 6201 | |
| 6202 | struct AbsOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 6203 | typedef AbsOptionsBuilder Builder; |
| 6204 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 6205 | return VerifyTableStart(verifier) && |
| 6206 | verifier.EndTable(); |
| 6207 | } |
| 6208 | }; |
| 6209 | |
| 6210 | struct AbsOptionsBuilder { |
| 6211 | typedef AbsOptions Table; |
| 6212 | flatbuffers::FlatBufferBuilder &fbb_; |
| 6213 | flatbuffers::uoffset_t start_; |
| 6214 | explicit AbsOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 6215 | : fbb_(_fbb) { |
| 6216 | start_ = fbb_.StartTable(); |
| 6217 | } |
| 6218 | flatbuffers::Offset<AbsOptions> Finish() { |
| 6219 | const auto end = fbb_.EndTable(start_); |
| 6220 | auto o = flatbuffers::Offset<AbsOptions>(end); |
| 6221 | return o; |
| 6222 | } |
| 6223 | }; |
| 6224 | |
| 6225 | inline flatbuffers::Offset<AbsOptions> CreateAbsOptions( |
| 6226 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 6227 | AbsOptionsBuilder builder_(_fbb); |
| 6228 | return builder_.Finish(); |
| 6229 | } |
| 6230 | |
| 6231 | struct HardSwishOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 6232 | typedef HardSwishOptionsBuilder Builder; |
| 6233 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 6234 | return VerifyTableStart(verifier) && |
| 6235 | verifier.EndTable(); |
| 6236 | } |
| 6237 | }; |
| 6238 | |
| 6239 | struct HardSwishOptionsBuilder { |
| 6240 | typedef HardSwishOptions Table; |
| 6241 | flatbuffers::FlatBufferBuilder &fbb_; |
| 6242 | flatbuffers::uoffset_t start_; |
| 6243 | explicit HardSwishOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 6244 | : fbb_(_fbb) { |
| 6245 | start_ = fbb_.StartTable(); |
| 6246 | } |
| 6247 | flatbuffers::Offset<HardSwishOptions> Finish() { |
| 6248 | const auto end = fbb_.EndTable(start_); |
| 6249 | auto o = flatbuffers::Offset<HardSwishOptions>(end); |
| 6250 | return o; |
| 6251 | } |
| 6252 | }; |
| 6253 | |
| 6254 | inline flatbuffers::Offset<HardSwishOptions> CreateHardSwishOptions( |
| 6255 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 6256 | HardSwishOptionsBuilder builder_(_fbb); |
| 6257 | return builder_.Finish(); |
| 6258 | } |
| 6259 | |
| 6260 | struct LogicalAndOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 6261 | typedef LogicalAndOptionsBuilder Builder; |
| 6262 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 6263 | return VerifyTableStart(verifier) && |
| 6264 | verifier.EndTable(); |
| 6265 | } |
| 6266 | }; |
| 6267 | |
| 6268 | struct LogicalAndOptionsBuilder { |
| 6269 | typedef LogicalAndOptions Table; |
| 6270 | flatbuffers::FlatBufferBuilder &fbb_; |
| 6271 | flatbuffers::uoffset_t start_; |
| 6272 | explicit LogicalAndOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 6273 | : fbb_(_fbb) { |
| 6274 | start_ = fbb_.StartTable(); |
| 6275 | } |
| 6276 | flatbuffers::Offset<LogicalAndOptions> Finish() { |
| 6277 | const auto end = fbb_.EndTable(start_); |
| 6278 | auto o = flatbuffers::Offset<LogicalAndOptions>(end); |
| 6279 | return o; |
| 6280 | } |
| 6281 | }; |
| 6282 | |
| 6283 | inline flatbuffers::Offset<LogicalAndOptions> CreateLogicalAndOptions( |
| 6284 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 6285 | LogicalAndOptionsBuilder builder_(_fbb); |
| 6286 | return builder_.Finish(); |
| 6287 | } |
| 6288 | |
| 6289 | struct LogicalNotOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 6290 | typedef LogicalNotOptionsBuilder Builder; |
| 6291 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 6292 | return VerifyTableStart(verifier) && |
| 6293 | verifier.EndTable(); |
| 6294 | } |
| 6295 | }; |
| 6296 | |
| 6297 | struct LogicalNotOptionsBuilder { |
| 6298 | typedef LogicalNotOptions Table; |
| 6299 | flatbuffers::FlatBufferBuilder &fbb_; |
| 6300 | flatbuffers::uoffset_t start_; |
| 6301 | explicit LogicalNotOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 6302 | : fbb_(_fbb) { |
| 6303 | start_ = fbb_.StartTable(); |
| 6304 | } |
| 6305 | flatbuffers::Offset<LogicalNotOptions> Finish() { |
| 6306 | const auto end = fbb_.EndTable(start_); |
| 6307 | auto o = flatbuffers::Offset<LogicalNotOptions>(end); |
| 6308 | return o; |
| 6309 | } |
| 6310 | }; |
| 6311 | |
| 6312 | inline flatbuffers::Offset<LogicalNotOptions> CreateLogicalNotOptions( |
| 6313 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 6314 | LogicalNotOptionsBuilder builder_(_fbb); |
| 6315 | return builder_.Finish(); |
| 6316 | } |
| 6317 | |
| 6318 | struct UnpackOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 6319 | typedef UnpackOptionsBuilder Builder; |
| 6320 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 6321 | VT_NUM = 4, |
| 6322 | VT_AXIS = 6 |
| 6323 | }; |
| 6324 | int32_t num() const { |
| 6325 | return GetField<int32_t>(VT_NUM, 0); |
| 6326 | } |
| 6327 | int32_t axis() const { |
| 6328 | return GetField<int32_t>(VT_AXIS, 0); |
| 6329 | } |
| 6330 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 6331 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 6332 | VerifyField<int32_t>(verifier, VT_NUM, 4) && |
| 6333 | VerifyField<int32_t>(verifier, VT_AXIS, 4) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 6334 | verifier.EndTable(); |
| 6335 | } |
| 6336 | }; |
| 6337 | |
| 6338 | struct UnpackOptionsBuilder { |
| 6339 | typedef UnpackOptions Table; |
| 6340 | flatbuffers::FlatBufferBuilder &fbb_; |
| 6341 | flatbuffers::uoffset_t start_; |
| 6342 | void add_num(int32_t num) { |
| 6343 | fbb_.AddElement<int32_t>(UnpackOptions::VT_NUM, num, 0); |
| 6344 | } |
| 6345 | void add_axis(int32_t axis) { |
| 6346 | fbb_.AddElement<int32_t>(UnpackOptions::VT_AXIS, axis, 0); |
| 6347 | } |
| 6348 | explicit UnpackOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 6349 | : fbb_(_fbb) { |
| 6350 | start_ = fbb_.StartTable(); |
| 6351 | } |
| 6352 | flatbuffers::Offset<UnpackOptions> Finish() { |
| 6353 | const auto end = fbb_.EndTable(start_); |
| 6354 | auto o = flatbuffers::Offset<UnpackOptions>(end); |
| 6355 | return o; |
| 6356 | } |
| 6357 | }; |
| 6358 | |
| 6359 | inline flatbuffers::Offset<UnpackOptions> CreateUnpackOptions( |
| 6360 | flatbuffers::FlatBufferBuilder &_fbb, |
| 6361 | int32_t num = 0, |
| 6362 | int32_t axis = 0) { |
| 6363 | UnpackOptionsBuilder builder_(_fbb); |
| 6364 | builder_.add_axis(axis); |
| 6365 | builder_.add_num(num); |
| 6366 | return builder_.Finish(); |
| 6367 | } |
| 6368 | |
| 6369 | struct FloorDivOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 6370 | typedef FloorDivOptionsBuilder Builder; |
| 6371 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 6372 | return VerifyTableStart(verifier) && |
| 6373 | verifier.EndTable(); |
| 6374 | } |
| 6375 | }; |
| 6376 | |
| 6377 | struct FloorDivOptionsBuilder { |
| 6378 | typedef FloorDivOptions Table; |
| 6379 | flatbuffers::FlatBufferBuilder &fbb_; |
| 6380 | flatbuffers::uoffset_t start_; |
| 6381 | explicit FloorDivOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 6382 | : fbb_(_fbb) { |
| 6383 | start_ = fbb_.StartTable(); |
| 6384 | } |
| 6385 | flatbuffers::Offset<FloorDivOptions> Finish() { |
| 6386 | const auto end = fbb_.EndTable(start_); |
| 6387 | auto o = flatbuffers::Offset<FloorDivOptions>(end); |
| 6388 | return o; |
| 6389 | } |
| 6390 | }; |
| 6391 | |
| 6392 | inline flatbuffers::Offset<FloorDivOptions> CreateFloorDivOptions( |
| 6393 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 6394 | FloorDivOptionsBuilder builder_(_fbb); |
| 6395 | return builder_.Finish(); |
| 6396 | } |
| 6397 | |
| 6398 | struct SquareOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 6399 | typedef SquareOptionsBuilder Builder; |
| 6400 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 6401 | return VerifyTableStart(verifier) && |
| 6402 | verifier.EndTable(); |
| 6403 | } |
| 6404 | }; |
| 6405 | |
| 6406 | struct SquareOptionsBuilder { |
| 6407 | typedef SquareOptions Table; |
| 6408 | flatbuffers::FlatBufferBuilder &fbb_; |
| 6409 | flatbuffers::uoffset_t start_; |
| 6410 | explicit SquareOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 6411 | : fbb_(_fbb) { |
| 6412 | start_ = fbb_.StartTable(); |
| 6413 | } |
| 6414 | flatbuffers::Offset<SquareOptions> Finish() { |
| 6415 | const auto end = fbb_.EndTable(start_); |
| 6416 | auto o = flatbuffers::Offset<SquareOptions>(end); |
| 6417 | return o; |
| 6418 | } |
| 6419 | }; |
| 6420 | |
| 6421 | inline flatbuffers::Offset<SquareOptions> CreateSquareOptions( |
| 6422 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 6423 | SquareOptionsBuilder builder_(_fbb); |
| 6424 | return builder_.Finish(); |
| 6425 | } |
| 6426 | |
| 6427 | struct ZerosLikeOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 6428 | typedef ZerosLikeOptionsBuilder Builder; |
| 6429 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 6430 | return VerifyTableStart(verifier) && |
| 6431 | verifier.EndTable(); |
| 6432 | } |
| 6433 | }; |
| 6434 | |
| 6435 | struct ZerosLikeOptionsBuilder { |
| 6436 | typedef ZerosLikeOptions Table; |
| 6437 | flatbuffers::FlatBufferBuilder &fbb_; |
| 6438 | flatbuffers::uoffset_t start_; |
| 6439 | explicit ZerosLikeOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 6440 | : fbb_(_fbb) { |
| 6441 | start_ = fbb_.StartTable(); |
| 6442 | } |
| 6443 | flatbuffers::Offset<ZerosLikeOptions> Finish() { |
| 6444 | const auto end = fbb_.EndTable(start_); |
| 6445 | auto o = flatbuffers::Offset<ZerosLikeOptions>(end); |
| 6446 | return o; |
| 6447 | } |
| 6448 | }; |
| 6449 | |
| 6450 | inline flatbuffers::Offset<ZerosLikeOptions> CreateZerosLikeOptions( |
| 6451 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 6452 | ZerosLikeOptionsBuilder builder_(_fbb); |
| 6453 | return builder_.Finish(); |
| 6454 | } |
| 6455 | |
| 6456 | struct FillOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 6457 | typedef FillOptionsBuilder Builder; |
| 6458 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 6459 | return VerifyTableStart(verifier) && |
| 6460 | verifier.EndTable(); |
| 6461 | } |
| 6462 | }; |
| 6463 | |
| 6464 | struct FillOptionsBuilder { |
| 6465 | typedef FillOptions Table; |
| 6466 | flatbuffers::FlatBufferBuilder &fbb_; |
| 6467 | flatbuffers::uoffset_t start_; |
| 6468 | explicit FillOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 6469 | : fbb_(_fbb) { |
| 6470 | start_ = fbb_.StartTable(); |
| 6471 | } |
| 6472 | flatbuffers::Offset<FillOptions> Finish() { |
| 6473 | const auto end = fbb_.EndTable(start_); |
| 6474 | auto o = flatbuffers::Offset<FillOptions>(end); |
| 6475 | return o; |
| 6476 | } |
| 6477 | }; |
| 6478 | |
| 6479 | inline flatbuffers::Offset<FillOptions> CreateFillOptions( |
| 6480 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 6481 | FillOptionsBuilder builder_(_fbb); |
| 6482 | return builder_.Finish(); |
| 6483 | } |
| 6484 | |
| 6485 | struct FloorModOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 6486 | typedef FloorModOptionsBuilder Builder; |
| 6487 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 6488 | return VerifyTableStart(verifier) && |
| 6489 | verifier.EndTable(); |
| 6490 | } |
| 6491 | }; |
| 6492 | |
| 6493 | struct FloorModOptionsBuilder { |
| 6494 | typedef FloorModOptions Table; |
| 6495 | flatbuffers::FlatBufferBuilder &fbb_; |
| 6496 | flatbuffers::uoffset_t start_; |
| 6497 | explicit FloorModOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 6498 | : fbb_(_fbb) { |
| 6499 | start_ = fbb_.StartTable(); |
| 6500 | } |
| 6501 | flatbuffers::Offset<FloorModOptions> Finish() { |
| 6502 | const auto end = fbb_.EndTable(start_); |
| 6503 | auto o = flatbuffers::Offset<FloorModOptions>(end); |
| 6504 | return o; |
| 6505 | } |
| 6506 | }; |
| 6507 | |
| 6508 | inline flatbuffers::Offset<FloorModOptions> CreateFloorModOptions( |
| 6509 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 6510 | FloorModOptionsBuilder builder_(_fbb); |
| 6511 | return builder_.Finish(); |
| 6512 | } |
| 6513 | |
| 6514 | struct RangeOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 6515 | typedef RangeOptionsBuilder Builder; |
| 6516 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 6517 | return VerifyTableStart(verifier) && |
| 6518 | verifier.EndTable(); |
| 6519 | } |
| 6520 | }; |
| 6521 | |
| 6522 | struct RangeOptionsBuilder { |
| 6523 | typedef RangeOptions Table; |
| 6524 | flatbuffers::FlatBufferBuilder &fbb_; |
| 6525 | flatbuffers::uoffset_t start_; |
| 6526 | explicit RangeOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 6527 | : fbb_(_fbb) { |
| 6528 | start_ = fbb_.StartTable(); |
| 6529 | } |
| 6530 | flatbuffers::Offset<RangeOptions> Finish() { |
| 6531 | const auto end = fbb_.EndTable(start_); |
| 6532 | auto o = flatbuffers::Offset<RangeOptions>(end); |
| 6533 | return o; |
| 6534 | } |
| 6535 | }; |
| 6536 | |
| 6537 | inline flatbuffers::Offset<RangeOptions> CreateRangeOptions( |
| 6538 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 6539 | RangeOptionsBuilder builder_(_fbb); |
| 6540 | return builder_.Finish(); |
| 6541 | } |
| 6542 | |
| 6543 | struct LeakyReluOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 6544 | typedef LeakyReluOptionsBuilder Builder; |
| 6545 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 6546 | VT_ALPHA = 4 |
| 6547 | }; |
| 6548 | float alpha() const { |
| 6549 | return GetField<float>(VT_ALPHA, 0.0f); |
| 6550 | } |
| 6551 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 6552 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 6553 | VerifyField<float>(verifier, VT_ALPHA, 4) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 6554 | verifier.EndTable(); |
| 6555 | } |
| 6556 | }; |
| 6557 | |
| 6558 | struct LeakyReluOptionsBuilder { |
| 6559 | typedef LeakyReluOptions Table; |
| 6560 | flatbuffers::FlatBufferBuilder &fbb_; |
| 6561 | flatbuffers::uoffset_t start_; |
| 6562 | void add_alpha(float alpha) { |
| 6563 | fbb_.AddElement<float>(LeakyReluOptions::VT_ALPHA, alpha, 0.0f); |
| 6564 | } |
| 6565 | explicit LeakyReluOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 6566 | : fbb_(_fbb) { |
| 6567 | start_ = fbb_.StartTable(); |
| 6568 | } |
| 6569 | flatbuffers::Offset<LeakyReluOptions> Finish() { |
| 6570 | const auto end = fbb_.EndTable(start_); |
| 6571 | auto o = flatbuffers::Offset<LeakyReluOptions>(end); |
| 6572 | return o; |
| 6573 | } |
| 6574 | }; |
| 6575 | |
| 6576 | inline flatbuffers::Offset<LeakyReluOptions> CreateLeakyReluOptions( |
| 6577 | flatbuffers::FlatBufferBuilder &_fbb, |
| 6578 | float alpha = 0.0f) { |
| 6579 | LeakyReluOptionsBuilder builder_(_fbb); |
| 6580 | builder_.add_alpha(alpha); |
| 6581 | return builder_.Finish(); |
| 6582 | } |
| 6583 | |
| 6584 | struct SquaredDifferenceOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 6585 | typedef SquaredDifferenceOptionsBuilder Builder; |
| 6586 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 6587 | return VerifyTableStart(verifier) && |
| 6588 | verifier.EndTable(); |
| 6589 | } |
| 6590 | }; |
| 6591 | |
| 6592 | struct SquaredDifferenceOptionsBuilder { |
| 6593 | typedef SquaredDifferenceOptions Table; |
| 6594 | flatbuffers::FlatBufferBuilder &fbb_; |
| 6595 | flatbuffers::uoffset_t start_; |
| 6596 | explicit SquaredDifferenceOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 6597 | : fbb_(_fbb) { |
| 6598 | start_ = fbb_.StartTable(); |
| 6599 | } |
| 6600 | flatbuffers::Offset<SquaredDifferenceOptions> Finish() { |
| 6601 | const auto end = fbb_.EndTable(start_); |
| 6602 | auto o = flatbuffers::Offset<SquaredDifferenceOptions>(end); |
| 6603 | return o; |
| 6604 | } |
| 6605 | }; |
| 6606 | |
| 6607 | inline flatbuffers::Offset<SquaredDifferenceOptions> CreateSquaredDifferenceOptions( |
| 6608 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 6609 | SquaredDifferenceOptionsBuilder builder_(_fbb); |
| 6610 | return builder_.Finish(); |
| 6611 | } |
| 6612 | |
| 6613 | struct MirrorPadOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 6614 | typedef MirrorPadOptionsBuilder Builder; |
| 6615 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 6616 | VT_MODE = 4 |
| 6617 | }; |
| 6618 | tflite::MirrorPadMode mode() const { |
| 6619 | return static_cast<tflite::MirrorPadMode>(GetField<int8_t>(VT_MODE, 0)); |
| 6620 | } |
| 6621 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 6622 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 6623 | VerifyField<int8_t>(verifier, VT_MODE, 1) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 6624 | verifier.EndTable(); |
| 6625 | } |
| 6626 | }; |
| 6627 | |
| 6628 | struct MirrorPadOptionsBuilder { |
| 6629 | typedef MirrorPadOptions Table; |
| 6630 | flatbuffers::FlatBufferBuilder &fbb_; |
| 6631 | flatbuffers::uoffset_t start_; |
| 6632 | void add_mode(tflite::MirrorPadMode mode) { |
| 6633 | fbb_.AddElement<int8_t>(MirrorPadOptions::VT_MODE, static_cast<int8_t>(mode), 0); |
| 6634 | } |
| 6635 | explicit MirrorPadOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 6636 | : fbb_(_fbb) { |
| 6637 | start_ = fbb_.StartTable(); |
| 6638 | } |
| 6639 | flatbuffers::Offset<MirrorPadOptions> Finish() { |
| 6640 | const auto end = fbb_.EndTable(start_); |
| 6641 | auto o = flatbuffers::Offset<MirrorPadOptions>(end); |
| 6642 | return o; |
| 6643 | } |
| 6644 | }; |
| 6645 | |
| 6646 | inline flatbuffers::Offset<MirrorPadOptions> CreateMirrorPadOptions( |
| 6647 | flatbuffers::FlatBufferBuilder &_fbb, |
| 6648 | tflite::MirrorPadMode mode = tflite::MirrorPadMode_REFLECT) { |
| 6649 | MirrorPadOptionsBuilder builder_(_fbb); |
| 6650 | builder_.add_mode(mode); |
| 6651 | return builder_.Finish(); |
| 6652 | } |
| 6653 | |
| 6654 | struct UniqueOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 6655 | typedef UniqueOptionsBuilder Builder; |
| 6656 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 6657 | VT_IDX_OUT_TYPE = 4 |
| 6658 | }; |
| 6659 | tflite::TensorType idx_out_type() const { |
| 6660 | return static_cast<tflite::TensorType>(GetField<int8_t>(VT_IDX_OUT_TYPE, 2)); |
| 6661 | } |
| 6662 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 6663 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 6664 | VerifyField<int8_t>(verifier, VT_IDX_OUT_TYPE, 1) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 6665 | verifier.EndTable(); |
| 6666 | } |
| 6667 | }; |
| 6668 | |
| 6669 | struct UniqueOptionsBuilder { |
| 6670 | typedef UniqueOptions Table; |
| 6671 | flatbuffers::FlatBufferBuilder &fbb_; |
| 6672 | flatbuffers::uoffset_t start_; |
| 6673 | void add_idx_out_type(tflite::TensorType idx_out_type) { |
| 6674 | fbb_.AddElement<int8_t>(UniqueOptions::VT_IDX_OUT_TYPE, static_cast<int8_t>(idx_out_type), 2); |
| 6675 | } |
| 6676 | explicit UniqueOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 6677 | : fbb_(_fbb) { |
| 6678 | start_ = fbb_.StartTable(); |
| 6679 | } |
| 6680 | flatbuffers::Offset<UniqueOptions> Finish() { |
| 6681 | const auto end = fbb_.EndTable(start_); |
| 6682 | auto o = flatbuffers::Offset<UniqueOptions>(end); |
| 6683 | return o; |
| 6684 | } |
| 6685 | }; |
| 6686 | |
| 6687 | inline flatbuffers::Offset<UniqueOptions> CreateUniqueOptions( |
| 6688 | flatbuffers::FlatBufferBuilder &_fbb, |
| 6689 | tflite::TensorType idx_out_type = tflite::TensorType_INT32) { |
| 6690 | UniqueOptionsBuilder builder_(_fbb); |
| 6691 | builder_.add_idx_out_type(idx_out_type); |
| 6692 | return builder_.Finish(); |
| 6693 | } |
| 6694 | |
| 6695 | struct ReverseV2Options FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 6696 | typedef ReverseV2OptionsBuilder Builder; |
| 6697 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 6698 | return VerifyTableStart(verifier) && |
| 6699 | verifier.EndTable(); |
| 6700 | } |
| 6701 | }; |
| 6702 | |
| 6703 | struct ReverseV2OptionsBuilder { |
| 6704 | typedef ReverseV2Options Table; |
| 6705 | flatbuffers::FlatBufferBuilder &fbb_; |
| 6706 | flatbuffers::uoffset_t start_; |
| 6707 | explicit ReverseV2OptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 6708 | : fbb_(_fbb) { |
| 6709 | start_ = fbb_.StartTable(); |
| 6710 | } |
| 6711 | flatbuffers::Offset<ReverseV2Options> Finish() { |
| 6712 | const auto end = fbb_.EndTable(start_); |
| 6713 | auto o = flatbuffers::Offset<ReverseV2Options>(end); |
| 6714 | return o; |
| 6715 | } |
| 6716 | }; |
| 6717 | |
| 6718 | inline flatbuffers::Offset<ReverseV2Options> CreateReverseV2Options( |
| 6719 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 6720 | ReverseV2OptionsBuilder builder_(_fbb); |
| 6721 | return builder_.Finish(); |
| 6722 | } |
| 6723 | |
| 6724 | struct AddNOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 6725 | typedef AddNOptionsBuilder Builder; |
| 6726 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 6727 | return VerifyTableStart(verifier) && |
| 6728 | verifier.EndTable(); |
| 6729 | } |
| 6730 | }; |
| 6731 | |
| 6732 | struct AddNOptionsBuilder { |
| 6733 | typedef AddNOptions Table; |
| 6734 | flatbuffers::FlatBufferBuilder &fbb_; |
| 6735 | flatbuffers::uoffset_t start_; |
| 6736 | explicit AddNOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 6737 | : fbb_(_fbb) { |
| 6738 | start_ = fbb_.StartTable(); |
| 6739 | } |
| 6740 | flatbuffers::Offset<AddNOptions> Finish() { |
| 6741 | const auto end = fbb_.EndTable(start_); |
| 6742 | auto o = flatbuffers::Offset<AddNOptions>(end); |
| 6743 | return o; |
| 6744 | } |
| 6745 | }; |
| 6746 | |
| 6747 | inline flatbuffers::Offset<AddNOptions> CreateAddNOptions( |
| 6748 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 6749 | AddNOptionsBuilder builder_(_fbb); |
| 6750 | return builder_.Finish(); |
| 6751 | } |
| 6752 | |
| 6753 | struct GatherNdOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 6754 | typedef GatherNdOptionsBuilder Builder; |
| 6755 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 6756 | return VerifyTableStart(verifier) && |
| 6757 | verifier.EndTable(); |
| 6758 | } |
| 6759 | }; |
| 6760 | |
| 6761 | struct GatherNdOptionsBuilder { |
| 6762 | typedef GatherNdOptions Table; |
| 6763 | flatbuffers::FlatBufferBuilder &fbb_; |
| 6764 | flatbuffers::uoffset_t start_; |
| 6765 | explicit GatherNdOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 6766 | : fbb_(_fbb) { |
| 6767 | start_ = fbb_.StartTable(); |
| 6768 | } |
| 6769 | flatbuffers::Offset<GatherNdOptions> Finish() { |
| 6770 | const auto end = fbb_.EndTable(start_); |
| 6771 | auto o = flatbuffers::Offset<GatherNdOptions>(end); |
| 6772 | return o; |
| 6773 | } |
| 6774 | }; |
| 6775 | |
| 6776 | inline flatbuffers::Offset<GatherNdOptions> CreateGatherNdOptions( |
| 6777 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 6778 | GatherNdOptionsBuilder builder_(_fbb); |
| 6779 | return builder_.Finish(); |
| 6780 | } |
| 6781 | |
| 6782 | struct WhereOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 6783 | typedef WhereOptionsBuilder Builder; |
| 6784 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 6785 | return VerifyTableStart(verifier) && |
| 6786 | verifier.EndTable(); |
| 6787 | } |
| 6788 | }; |
| 6789 | |
| 6790 | struct WhereOptionsBuilder { |
| 6791 | typedef WhereOptions Table; |
| 6792 | flatbuffers::FlatBufferBuilder &fbb_; |
| 6793 | flatbuffers::uoffset_t start_; |
| 6794 | explicit WhereOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 6795 | : fbb_(_fbb) { |
| 6796 | start_ = fbb_.StartTable(); |
| 6797 | } |
| 6798 | flatbuffers::Offset<WhereOptions> Finish() { |
| 6799 | const auto end = fbb_.EndTable(start_); |
| 6800 | auto o = flatbuffers::Offset<WhereOptions>(end); |
| 6801 | return o; |
| 6802 | } |
| 6803 | }; |
| 6804 | |
| 6805 | inline flatbuffers::Offset<WhereOptions> CreateWhereOptions( |
| 6806 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 6807 | WhereOptionsBuilder builder_(_fbb); |
| 6808 | return builder_.Finish(); |
| 6809 | } |
| 6810 | |
| 6811 | struct ReverseSequenceOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 6812 | typedef ReverseSequenceOptionsBuilder Builder; |
| 6813 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 6814 | VT_SEQ_DIM = 4, |
| 6815 | VT_BATCH_DIM = 6 |
| 6816 | }; |
| 6817 | int32_t seq_dim() const { |
| 6818 | return GetField<int32_t>(VT_SEQ_DIM, 0); |
| 6819 | } |
| 6820 | int32_t batch_dim() const { |
| 6821 | return GetField<int32_t>(VT_BATCH_DIM, 0); |
| 6822 | } |
| 6823 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 6824 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 6825 | VerifyField<int32_t>(verifier, VT_SEQ_DIM, 4) && |
| 6826 | VerifyField<int32_t>(verifier, VT_BATCH_DIM, 4) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 6827 | verifier.EndTable(); |
| 6828 | } |
| 6829 | }; |
| 6830 | |
| 6831 | struct ReverseSequenceOptionsBuilder { |
| 6832 | typedef ReverseSequenceOptions Table; |
| 6833 | flatbuffers::FlatBufferBuilder &fbb_; |
| 6834 | flatbuffers::uoffset_t start_; |
| 6835 | void add_seq_dim(int32_t seq_dim) { |
| 6836 | fbb_.AddElement<int32_t>(ReverseSequenceOptions::VT_SEQ_DIM, seq_dim, 0); |
| 6837 | } |
| 6838 | void add_batch_dim(int32_t batch_dim) { |
| 6839 | fbb_.AddElement<int32_t>(ReverseSequenceOptions::VT_BATCH_DIM, batch_dim, 0); |
| 6840 | } |
| 6841 | explicit ReverseSequenceOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 6842 | : fbb_(_fbb) { |
| 6843 | start_ = fbb_.StartTable(); |
| 6844 | } |
| 6845 | flatbuffers::Offset<ReverseSequenceOptions> Finish() { |
| 6846 | const auto end = fbb_.EndTable(start_); |
| 6847 | auto o = flatbuffers::Offset<ReverseSequenceOptions>(end); |
| 6848 | return o; |
| 6849 | } |
| 6850 | }; |
| 6851 | |
| 6852 | inline flatbuffers::Offset<ReverseSequenceOptions> CreateReverseSequenceOptions( |
| 6853 | flatbuffers::FlatBufferBuilder &_fbb, |
| 6854 | int32_t seq_dim = 0, |
| 6855 | int32_t batch_dim = 0) { |
| 6856 | ReverseSequenceOptionsBuilder builder_(_fbb); |
| 6857 | builder_.add_batch_dim(batch_dim); |
| 6858 | builder_.add_seq_dim(seq_dim); |
| 6859 | return builder_.Finish(); |
| 6860 | } |
| 6861 | |
| 6862 | struct MatrixDiagOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 6863 | typedef MatrixDiagOptionsBuilder Builder; |
| 6864 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 6865 | return VerifyTableStart(verifier) && |
| 6866 | verifier.EndTable(); |
| 6867 | } |
| 6868 | }; |
| 6869 | |
| 6870 | struct MatrixDiagOptionsBuilder { |
| 6871 | typedef MatrixDiagOptions Table; |
| 6872 | flatbuffers::FlatBufferBuilder &fbb_; |
| 6873 | flatbuffers::uoffset_t start_; |
| 6874 | explicit MatrixDiagOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 6875 | : fbb_(_fbb) { |
| 6876 | start_ = fbb_.StartTable(); |
| 6877 | } |
| 6878 | flatbuffers::Offset<MatrixDiagOptions> Finish() { |
| 6879 | const auto end = fbb_.EndTable(start_); |
| 6880 | auto o = flatbuffers::Offset<MatrixDiagOptions>(end); |
| 6881 | return o; |
| 6882 | } |
| 6883 | }; |
| 6884 | |
| 6885 | inline flatbuffers::Offset<MatrixDiagOptions> CreateMatrixDiagOptions( |
| 6886 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 6887 | MatrixDiagOptionsBuilder builder_(_fbb); |
| 6888 | return builder_.Finish(); |
| 6889 | } |
| 6890 | |
| 6891 | struct QuantizeOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 6892 | typedef QuantizeOptionsBuilder Builder; |
| 6893 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 6894 | return VerifyTableStart(verifier) && |
| 6895 | verifier.EndTable(); |
| 6896 | } |
| 6897 | }; |
| 6898 | |
| 6899 | struct QuantizeOptionsBuilder { |
| 6900 | typedef QuantizeOptions Table; |
| 6901 | flatbuffers::FlatBufferBuilder &fbb_; |
| 6902 | flatbuffers::uoffset_t start_; |
| 6903 | explicit QuantizeOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 6904 | : fbb_(_fbb) { |
| 6905 | start_ = fbb_.StartTable(); |
| 6906 | } |
| 6907 | flatbuffers::Offset<QuantizeOptions> Finish() { |
| 6908 | const auto end = fbb_.EndTable(start_); |
| 6909 | auto o = flatbuffers::Offset<QuantizeOptions>(end); |
| 6910 | return o; |
| 6911 | } |
| 6912 | }; |
| 6913 | |
| 6914 | inline flatbuffers::Offset<QuantizeOptions> CreateQuantizeOptions( |
| 6915 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 6916 | QuantizeOptionsBuilder builder_(_fbb); |
| 6917 | return builder_.Finish(); |
| 6918 | } |
| 6919 | |
| 6920 | struct MatrixSetDiagOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 6921 | typedef MatrixSetDiagOptionsBuilder Builder; |
| 6922 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 6923 | return VerifyTableStart(verifier) && |
| 6924 | verifier.EndTable(); |
| 6925 | } |
| 6926 | }; |
| 6927 | |
| 6928 | struct MatrixSetDiagOptionsBuilder { |
| 6929 | typedef MatrixSetDiagOptions Table; |
| 6930 | flatbuffers::FlatBufferBuilder &fbb_; |
| 6931 | flatbuffers::uoffset_t start_; |
| 6932 | explicit MatrixSetDiagOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 6933 | : fbb_(_fbb) { |
| 6934 | start_ = fbb_.StartTable(); |
| 6935 | } |
| 6936 | flatbuffers::Offset<MatrixSetDiagOptions> Finish() { |
| 6937 | const auto end = fbb_.EndTable(start_); |
| 6938 | auto o = flatbuffers::Offset<MatrixSetDiagOptions>(end); |
| 6939 | return o; |
| 6940 | } |
| 6941 | }; |
| 6942 | |
| 6943 | inline flatbuffers::Offset<MatrixSetDiagOptions> CreateMatrixSetDiagOptions( |
| 6944 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 6945 | MatrixSetDiagOptionsBuilder builder_(_fbb); |
| 6946 | return builder_.Finish(); |
| 6947 | } |
| 6948 | |
| 6949 | struct IfOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 6950 | typedef IfOptionsBuilder Builder; |
| 6951 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 6952 | VT_THEN_SUBGRAPH_INDEX = 4, |
| 6953 | VT_ELSE_SUBGRAPH_INDEX = 6 |
| 6954 | }; |
| 6955 | int32_t then_subgraph_index() const { |
| 6956 | return GetField<int32_t>(VT_THEN_SUBGRAPH_INDEX, 0); |
| 6957 | } |
| 6958 | int32_t else_subgraph_index() const { |
| 6959 | return GetField<int32_t>(VT_ELSE_SUBGRAPH_INDEX, 0); |
| 6960 | } |
| 6961 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 6962 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 6963 | VerifyField<int32_t>(verifier, VT_THEN_SUBGRAPH_INDEX, 4) && |
| 6964 | VerifyField<int32_t>(verifier, VT_ELSE_SUBGRAPH_INDEX, 4) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 6965 | verifier.EndTable(); |
| 6966 | } |
| 6967 | }; |
| 6968 | |
| 6969 | struct IfOptionsBuilder { |
| 6970 | typedef IfOptions Table; |
| 6971 | flatbuffers::FlatBufferBuilder &fbb_; |
| 6972 | flatbuffers::uoffset_t start_; |
| 6973 | void add_then_subgraph_index(int32_t then_subgraph_index) { |
| 6974 | fbb_.AddElement<int32_t>(IfOptions::VT_THEN_SUBGRAPH_INDEX, then_subgraph_index, 0); |
| 6975 | } |
| 6976 | void add_else_subgraph_index(int32_t else_subgraph_index) { |
| 6977 | fbb_.AddElement<int32_t>(IfOptions::VT_ELSE_SUBGRAPH_INDEX, else_subgraph_index, 0); |
| 6978 | } |
| 6979 | explicit IfOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 6980 | : fbb_(_fbb) { |
| 6981 | start_ = fbb_.StartTable(); |
| 6982 | } |
| 6983 | flatbuffers::Offset<IfOptions> Finish() { |
| 6984 | const auto end = fbb_.EndTable(start_); |
| 6985 | auto o = flatbuffers::Offset<IfOptions>(end); |
| 6986 | return o; |
| 6987 | } |
| 6988 | }; |
| 6989 | |
| 6990 | inline flatbuffers::Offset<IfOptions> CreateIfOptions( |
| 6991 | flatbuffers::FlatBufferBuilder &_fbb, |
| 6992 | int32_t then_subgraph_index = 0, |
| 6993 | int32_t else_subgraph_index = 0) { |
| 6994 | IfOptionsBuilder builder_(_fbb); |
| 6995 | builder_.add_else_subgraph_index(else_subgraph_index); |
| 6996 | builder_.add_then_subgraph_index(then_subgraph_index); |
| 6997 | return builder_.Finish(); |
| 6998 | } |
| 6999 | |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 7000 | struct CallOnceOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 7001 | typedef CallOnceOptionsBuilder Builder; |
| 7002 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 7003 | VT_INIT_SUBGRAPH_INDEX = 4 |
| 7004 | }; |
| 7005 | int32_t init_subgraph_index() const { |
| 7006 | return GetField<int32_t>(VT_INIT_SUBGRAPH_INDEX, 0); |
| 7007 | } |
| 7008 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 7009 | return VerifyTableStart(verifier) && |
| 7010 | VerifyField<int32_t>(verifier, VT_INIT_SUBGRAPH_INDEX, 4) && |
| 7011 | verifier.EndTable(); |
| 7012 | } |
| 7013 | }; |
| 7014 | |
| 7015 | struct CallOnceOptionsBuilder { |
| 7016 | typedef CallOnceOptions Table; |
| 7017 | flatbuffers::FlatBufferBuilder &fbb_; |
| 7018 | flatbuffers::uoffset_t start_; |
| 7019 | void add_init_subgraph_index(int32_t init_subgraph_index) { |
| 7020 | fbb_.AddElement<int32_t>(CallOnceOptions::VT_INIT_SUBGRAPH_INDEX, init_subgraph_index, 0); |
| 7021 | } |
| 7022 | explicit CallOnceOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 7023 | : fbb_(_fbb) { |
| 7024 | start_ = fbb_.StartTable(); |
| 7025 | } |
| 7026 | flatbuffers::Offset<CallOnceOptions> Finish() { |
| 7027 | const auto end = fbb_.EndTable(start_); |
| 7028 | auto o = flatbuffers::Offset<CallOnceOptions>(end); |
| 7029 | return o; |
| 7030 | } |
| 7031 | }; |
| 7032 | |
| 7033 | inline flatbuffers::Offset<CallOnceOptions> CreateCallOnceOptions( |
| 7034 | flatbuffers::FlatBufferBuilder &_fbb, |
| 7035 | int32_t init_subgraph_index = 0) { |
| 7036 | CallOnceOptionsBuilder builder_(_fbb); |
| 7037 | builder_.add_init_subgraph_index(init_subgraph_index); |
| 7038 | return builder_.Finish(); |
| 7039 | } |
| 7040 | |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 7041 | struct WhileOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 7042 | typedef WhileOptionsBuilder Builder; |
| 7043 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 7044 | VT_COND_SUBGRAPH_INDEX = 4, |
| 7045 | VT_BODY_SUBGRAPH_INDEX = 6 |
| 7046 | }; |
| 7047 | int32_t cond_subgraph_index() const { |
| 7048 | return GetField<int32_t>(VT_COND_SUBGRAPH_INDEX, 0); |
| 7049 | } |
| 7050 | int32_t body_subgraph_index() const { |
| 7051 | return GetField<int32_t>(VT_BODY_SUBGRAPH_INDEX, 0); |
| 7052 | } |
| 7053 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 7054 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 7055 | VerifyField<int32_t>(verifier, VT_COND_SUBGRAPH_INDEX, 4) && |
| 7056 | VerifyField<int32_t>(verifier, VT_BODY_SUBGRAPH_INDEX, 4) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 7057 | verifier.EndTable(); |
| 7058 | } |
| 7059 | }; |
| 7060 | |
| 7061 | struct WhileOptionsBuilder { |
| 7062 | typedef WhileOptions Table; |
| 7063 | flatbuffers::FlatBufferBuilder &fbb_; |
| 7064 | flatbuffers::uoffset_t start_; |
| 7065 | void add_cond_subgraph_index(int32_t cond_subgraph_index) { |
| 7066 | fbb_.AddElement<int32_t>(WhileOptions::VT_COND_SUBGRAPH_INDEX, cond_subgraph_index, 0); |
| 7067 | } |
| 7068 | void add_body_subgraph_index(int32_t body_subgraph_index) { |
| 7069 | fbb_.AddElement<int32_t>(WhileOptions::VT_BODY_SUBGRAPH_INDEX, body_subgraph_index, 0); |
| 7070 | } |
| 7071 | explicit WhileOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 7072 | : fbb_(_fbb) { |
| 7073 | start_ = fbb_.StartTable(); |
| 7074 | } |
| 7075 | flatbuffers::Offset<WhileOptions> Finish() { |
| 7076 | const auto end = fbb_.EndTable(start_); |
| 7077 | auto o = flatbuffers::Offset<WhileOptions>(end); |
| 7078 | return o; |
| 7079 | } |
| 7080 | }; |
| 7081 | |
| 7082 | inline flatbuffers::Offset<WhileOptions> CreateWhileOptions( |
| 7083 | flatbuffers::FlatBufferBuilder &_fbb, |
| 7084 | int32_t cond_subgraph_index = 0, |
| 7085 | int32_t body_subgraph_index = 0) { |
| 7086 | WhileOptionsBuilder builder_(_fbb); |
| 7087 | builder_.add_body_subgraph_index(body_subgraph_index); |
| 7088 | builder_.add_cond_subgraph_index(cond_subgraph_index); |
| 7089 | return builder_.Finish(); |
| 7090 | } |
| 7091 | |
| 7092 | struct NonMaxSuppressionV4Options FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 7093 | typedef NonMaxSuppressionV4OptionsBuilder Builder; |
| 7094 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 7095 | return VerifyTableStart(verifier) && |
| 7096 | verifier.EndTable(); |
| 7097 | } |
| 7098 | }; |
| 7099 | |
| 7100 | struct NonMaxSuppressionV4OptionsBuilder { |
| 7101 | typedef NonMaxSuppressionV4Options Table; |
| 7102 | flatbuffers::FlatBufferBuilder &fbb_; |
| 7103 | flatbuffers::uoffset_t start_; |
| 7104 | explicit NonMaxSuppressionV4OptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 7105 | : fbb_(_fbb) { |
| 7106 | start_ = fbb_.StartTable(); |
| 7107 | } |
| 7108 | flatbuffers::Offset<NonMaxSuppressionV4Options> Finish() { |
| 7109 | const auto end = fbb_.EndTable(start_); |
| 7110 | auto o = flatbuffers::Offset<NonMaxSuppressionV4Options>(end); |
| 7111 | return o; |
| 7112 | } |
| 7113 | }; |
| 7114 | |
| 7115 | inline flatbuffers::Offset<NonMaxSuppressionV4Options> CreateNonMaxSuppressionV4Options( |
| 7116 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 7117 | NonMaxSuppressionV4OptionsBuilder builder_(_fbb); |
| 7118 | return builder_.Finish(); |
| 7119 | } |
| 7120 | |
| 7121 | struct NonMaxSuppressionV5Options FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 7122 | typedef NonMaxSuppressionV5OptionsBuilder Builder; |
| 7123 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 7124 | return VerifyTableStart(verifier) && |
| 7125 | verifier.EndTable(); |
| 7126 | } |
| 7127 | }; |
| 7128 | |
| 7129 | struct NonMaxSuppressionV5OptionsBuilder { |
| 7130 | typedef NonMaxSuppressionV5Options Table; |
| 7131 | flatbuffers::FlatBufferBuilder &fbb_; |
| 7132 | flatbuffers::uoffset_t start_; |
| 7133 | explicit NonMaxSuppressionV5OptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 7134 | : fbb_(_fbb) { |
| 7135 | start_ = fbb_.StartTable(); |
| 7136 | } |
| 7137 | flatbuffers::Offset<NonMaxSuppressionV5Options> Finish() { |
| 7138 | const auto end = fbb_.EndTable(start_); |
| 7139 | auto o = flatbuffers::Offset<NonMaxSuppressionV5Options>(end); |
| 7140 | return o; |
| 7141 | } |
| 7142 | }; |
| 7143 | |
| 7144 | inline flatbuffers::Offset<NonMaxSuppressionV5Options> CreateNonMaxSuppressionV5Options( |
| 7145 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 7146 | NonMaxSuppressionV5OptionsBuilder builder_(_fbb); |
| 7147 | return builder_.Finish(); |
| 7148 | } |
| 7149 | |
| 7150 | struct ScatterNdOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 7151 | typedef ScatterNdOptionsBuilder Builder; |
| 7152 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 7153 | return VerifyTableStart(verifier) && |
| 7154 | verifier.EndTable(); |
| 7155 | } |
| 7156 | }; |
| 7157 | |
| 7158 | struct ScatterNdOptionsBuilder { |
| 7159 | typedef ScatterNdOptions Table; |
| 7160 | flatbuffers::FlatBufferBuilder &fbb_; |
| 7161 | flatbuffers::uoffset_t start_; |
| 7162 | explicit ScatterNdOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 7163 | : fbb_(_fbb) { |
| 7164 | start_ = fbb_.StartTable(); |
| 7165 | } |
| 7166 | flatbuffers::Offset<ScatterNdOptions> Finish() { |
| 7167 | const auto end = fbb_.EndTable(start_); |
| 7168 | auto o = flatbuffers::Offset<ScatterNdOptions>(end); |
| 7169 | return o; |
| 7170 | } |
| 7171 | }; |
| 7172 | |
| 7173 | inline flatbuffers::Offset<ScatterNdOptions> CreateScatterNdOptions( |
| 7174 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 7175 | ScatterNdOptionsBuilder builder_(_fbb); |
| 7176 | return builder_.Finish(); |
| 7177 | } |
| 7178 | |
| 7179 | struct SelectV2Options FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 7180 | typedef SelectV2OptionsBuilder Builder; |
| 7181 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 7182 | return VerifyTableStart(verifier) && |
| 7183 | verifier.EndTable(); |
| 7184 | } |
| 7185 | }; |
| 7186 | |
| 7187 | struct SelectV2OptionsBuilder { |
| 7188 | typedef SelectV2Options Table; |
| 7189 | flatbuffers::FlatBufferBuilder &fbb_; |
| 7190 | flatbuffers::uoffset_t start_; |
| 7191 | explicit SelectV2OptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 7192 | : fbb_(_fbb) { |
| 7193 | start_ = fbb_.StartTable(); |
| 7194 | } |
| 7195 | flatbuffers::Offset<SelectV2Options> Finish() { |
| 7196 | const auto end = fbb_.EndTable(start_); |
| 7197 | auto o = flatbuffers::Offset<SelectV2Options>(end); |
| 7198 | return o; |
| 7199 | } |
| 7200 | }; |
| 7201 | |
| 7202 | inline flatbuffers::Offset<SelectV2Options> CreateSelectV2Options( |
| 7203 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 7204 | SelectV2OptionsBuilder builder_(_fbb); |
| 7205 | return builder_.Finish(); |
| 7206 | } |
| 7207 | |
| 7208 | struct DensifyOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 7209 | typedef DensifyOptionsBuilder Builder; |
| 7210 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 7211 | return VerifyTableStart(verifier) && |
| 7212 | verifier.EndTable(); |
| 7213 | } |
| 7214 | }; |
| 7215 | |
| 7216 | struct DensifyOptionsBuilder { |
| 7217 | typedef DensifyOptions Table; |
| 7218 | flatbuffers::FlatBufferBuilder &fbb_; |
| 7219 | flatbuffers::uoffset_t start_; |
| 7220 | explicit DensifyOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 7221 | : fbb_(_fbb) { |
| 7222 | start_ = fbb_.StartTable(); |
| 7223 | } |
| 7224 | flatbuffers::Offset<DensifyOptions> Finish() { |
| 7225 | const auto end = fbb_.EndTable(start_); |
| 7226 | auto o = flatbuffers::Offset<DensifyOptions>(end); |
| 7227 | return o; |
| 7228 | } |
| 7229 | }; |
| 7230 | |
| 7231 | inline flatbuffers::Offset<DensifyOptions> CreateDensifyOptions( |
| 7232 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 7233 | DensifyOptionsBuilder builder_(_fbb); |
| 7234 | return builder_.Finish(); |
| 7235 | } |
| 7236 | |
| 7237 | struct SegmentSumOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 7238 | typedef SegmentSumOptionsBuilder Builder; |
| 7239 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 7240 | return VerifyTableStart(verifier) && |
| 7241 | verifier.EndTable(); |
| 7242 | } |
| 7243 | }; |
| 7244 | |
| 7245 | struct SegmentSumOptionsBuilder { |
| 7246 | typedef SegmentSumOptions Table; |
| 7247 | flatbuffers::FlatBufferBuilder &fbb_; |
| 7248 | flatbuffers::uoffset_t start_; |
| 7249 | explicit SegmentSumOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 7250 | : fbb_(_fbb) { |
| 7251 | start_ = fbb_.StartTable(); |
| 7252 | } |
| 7253 | flatbuffers::Offset<SegmentSumOptions> Finish() { |
| 7254 | const auto end = fbb_.EndTable(start_); |
| 7255 | auto o = flatbuffers::Offset<SegmentSumOptions>(end); |
| 7256 | return o; |
| 7257 | } |
| 7258 | }; |
| 7259 | |
| 7260 | inline flatbuffers::Offset<SegmentSumOptions> CreateSegmentSumOptions( |
| 7261 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 7262 | SegmentSumOptionsBuilder builder_(_fbb); |
| 7263 | return builder_.Finish(); |
| 7264 | } |
| 7265 | |
| 7266 | struct BatchMatMulOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 7267 | typedef BatchMatMulOptionsBuilder Builder; |
| 7268 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 7269 | VT_ADJ_X = 4, |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 7270 | VT_ADJ_Y = 6, |
| 7271 | VT_ASYMMETRIC_QUANTIZE_INPUTS = 8 |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 7272 | }; |
| 7273 | bool adj_x() const { |
| 7274 | return GetField<uint8_t>(VT_ADJ_X, 0) != 0; |
| 7275 | } |
| 7276 | bool adj_y() const { |
| 7277 | return GetField<uint8_t>(VT_ADJ_Y, 0) != 0; |
| 7278 | } |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 7279 | bool asymmetric_quantize_inputs() const { |
| 7280 | return GetField<uint8_t>(VT_ASYMMETRIC_QUANTIZE_INPUTS, 0) != 0; |
| 7281 | } |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 7282 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 7283 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 7284 | VerifyField<uint8_t>(verifier, VT_ADJ_X, 1) && |
| 7285 | VerifyField<uint8_t>(verifier, VT_ADJ_Y, 1) && |
| 7286 | VerifyField<uint8_t>(verifier, VT_ASYMMETRIC_QUANTIZE_INPUTS, 1) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 7287 | verifier.EndTable(); |
| 7288 | } |
| 7289 | }; |
| 7290 | |
| 7291 | struct BatchMatMulOptionsBuilder { |
| 7292 | typedef BatchMatMulOptions Table; |
| 7293 | flatbuffers::FlatBufferBuilder &fbb_; |
| 7294 | flatbuffers::uoffset_t start_; |
| 7295 | void add_adj_x(bool adj_x) { |
| 7296 | fbb_.AddElement<uint8_t>(BatchMatMulOptions::VT_ADJ_X, static_cast<uint8_t>(adj_x), 0); |
| 7297 | } |
| 7298 | void add_adj_y(bool adj_y) { |
| 7299 | fbb_.AddElement<uint8_t>(BatchMatMulOptions::VT_ADJ_Y, static_cast<uint8_t>(adj_y), 0); |
| 7300 | } |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 7301 | void add_asymmetric_quantize_inputs(bool asymmetric_quantize_inputs) { |
| 7302 | fbb_.AddElement<uint8_t>(BatchMatMulOptions::VT_ASYMMETRIC_QUANTIZE_INPUTS, static_cast<uint8_t>(asymmetric_quantize_inputs), 0); |
| 7303 | } |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 7304 | explicit BatchMatMulOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 7305 | : fbb_(_fbb) { |
| 7306 | start_ = fbb_.StartTable(); |
| 7307 | } |
| 7308 | flatbuffers::Offset<BatchMatMulOptions> Finish() { |
| 7309 | const auto end = fbb_.EndTable(start_); |
| 7310 | auto o = flatbuffers::Offset<BatchMatMulOptions>(end); |
| 7311 | return o; |
| 7312 | } |
| 7313 | }; |
| 7314 | |
| 7315 | inline flatbuffers::Offset<BatchMatMulOptions> CreateBatchMatMulOptions( |
| 7316 | flatbuffers::FlatBufferBuilder &_fbb, |
| 7317 | bool adj_x = false, |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 7318 | bool adj_y = false, |
| 7319 | bool asymmetric_quantize_inputs = false) { |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 7320 | BatchMatMulOptionsBuilder builder_(_fbb); |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 7321 | builder_.add_asymmetric_quantize_inputs(asymmetric_quantize_inputs); |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 7322 | builder_.add_adj_y(adj_y); |
| 7323 | builder_.add_adj_x(adj_x); |
| 7324 | return builder_.Finish(); |
| 7325 | } |
| 7326 | |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 7327 | struct CumsumOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 7328 | typedef CumsumOptionsBuilder Builder; |
| 7329 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 7330 | VT_EXCLUSIVE = 4, |
| 7331 | VT_REVERSE = 6 |
| 7332 | }; |
| 7333 | bool exclusive() const { |
| 7334 | return GetField<uint8_t>(VT_EXCLUSIVE, 0) != 0; |
| 7335 | } |
| 7336 | bool reverse() const { |
| 7337 | return GetField<uint8_t>(VT_REVERSE, 0) != 0; |
| 7338 | } |
| 7339 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 7340 | return VerifyTableStart(verifier) && |
| 7341 | VerifyField<uint8_t>(verifier, VT_EXCLUSIVE, 1) && |
| 7342 | VerifyField<uint8_t>(verifier, VT_REVERSE, 1) && |
| 7343 | verifier.EndTable(); |
| 7344 | } |
| 7345 | }; |
| 7346 | |
| 7347 | struct CumsumOptionsBuilder { |
| 7348 | typedef CumsumOptions Table; |
| 7349 | flatbuffers::FlatBufferBuilder &fbb_; |
| 7350 | flatbuffers::uoffset_t start_; |
| 7351 | void add_exclusive(bool exclusive) { |
| 7352 | fbb_.AddElement<uint8_t>(CumsumOptions::VT_EXCLUSIVE, static_cast<uint8_t>(exclusive), 0); |
| 7353 | } |
| 7354 | void add_reverse(bool reverse) { |
| 7355 | fbb_.AddElement<uint8_t>(CumsumOptions::VT_REVERSE, static_cast<uint8_t>(reverse), 0); |
| 7356 | } |
| 7357 | explicit CumsumOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 7358 | : fbb_(_fbb) { |
| 7359 | start_ = fbb_.StartTable(); |
| 7360 | } |
| 7361 | flatbuffers::Offset<CumsumOptions> Finish() { |
| 7362 | const auto end = fbb_.EndTable(start_); |
| 7363 | auto o = flatbuffers::Offset<CumsumOptions>(end); |
| 7364 | return o; |
| 7365 | } |
| 7366 | }; |
| 7367 | |
| 7368 | inline flatbuffers::Offset<CumsumOptions> CreateCumsumOptions( |
| 7369 | flatbuffers::FlatBufferBuilder &_fbb, |
| 7370 | bool exclusive = false, |
| 7371 | bool reverse = false) { |
| 7372 | CumsumOptionsBuilder builder_(_fbb); |
| 7373 | builder_.add_reverse(reverse); |
| 7374 | builder_.add_exclusive(exclusive); |
| 7375 | return builder_.Finish(); |
| 7376 | } |
| 7377 | |
| 7378 | struct BroadcastToOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 7379 | typedef BroadcastToOptionsBuilder Builder; |
| 7380 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 7381 | return VerifyTableStart(verifier) && |
| 7382 | verifier.EndTable(); |
| 7383 | } |
| 7384 | }; |
| 7385 | |
| 7386 | struct BroadcastToOptionsBuilder { |
| 7387 | typedef BroadcastToOptions Table; |
| 7388 | flatbuffers::FlatBufferBuilder &fbb_; |
| 7389 | flatbuffers::uoffset_t start_; |
| 7390 | explicit BroadcastToOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 7391 | : fbb_(_fbb) { |
| 7392 | start_ = fbb_.StartTable(); |
| 7393 | } |
| 7394 | flatbuffers::Offset<BroadcastToOptions> Finish() { |
| 7395 | const auto end = fbb_.EndTable(start_); |
| 7396 | auto o = flatbuffers::Offset<BroadcastToOptions>(end); |
| 7397 | return o; |
| 7398 | } |
| 7399 | }; |
| 7400 | |
| 7401 | inline flatbuffers::Offset<BroadcastToOptions> CreateBroadcastToOptions( |
| 7402 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 7403 | BroadcastToOptionsBuilder builder_(_fbb); |
| 7404 | return builder_.Finish(); |
| 7405 | } |
| 7406 | |
| 7407 | struct Rfft2dOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 7408 | typedef Rfft2dOptionsBuilder Builder; |
| 7409 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 7410 | return VerifyTableStart(verifier) && |
| 7411 | verifier.EndTable(); |
| 7412 | } |
| 7413 | }; |
| 7414 | |
| 7415 | struct Rfft2dOptionsBuilder { |
| 7416 | typedef Rfft2dOptions Table; |
| 7417 | flatbuffers::FlatBufferBuilder &fbb_; |
| 7418 | flatbuffers::uoffset_t start_; |
| 7419 | explicit Rfft2dOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 7420 | : fbb_(_fbb) { |
| 7421 | start_ = fbb_.StartTable(); |
| 7422 | } |
| 7423 | flatbuffers::Offset<Rfft2dOptions> Finish() { |
| 7424 | const auto end = fbb_.EndTable(start_); |
| 7425 | auto o = flatbuffers::Offset<Rfft2dOptions>(end); |
| 7426 | return o; |
| 7427 | } |
| 7428 | }; |
| 7429 | |
| 7430 | inline flatbuffers::Offset<Rfft2dOptions> CreateRfft2dOptions( |
| 7431 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 7432 | Rfft2dOptionsBuilder builder_(_fbb); |
| 7433 | return builder_.Finish(); |
| 7434 | } |
| 7435 | |
| 7436 | struct HashtableOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 7437 | typedef HashtableOptionsBuilder Builder; |
| 7438 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 7439 | VT_TABLE_ID = 4, |
| 7440 | VT_KEY_DTYPE = 6, |
| 7441 | VT_VALUE_DTYPE = 8 |
| 7442 | }; |
| 7443 | int32_t table_id() const { |
| 7444 | return GetField<int32_t>(VT_TABLE_ID, 0); |
| 7445 | } |
| 7446 | tflite::TensorType key_dtype() const { |
| 7447 | return static_cast<tflite::TensorType>(GetField<int8_t>(VT_KEY_DTYPE, 0)); |
| 7448 | } |
| 7449 | tflite::TensorType value_dtype() const { |
| 7450 | return static_cast<tflite::TensorType>(GetField<int8_t>(VT_VALUE_DTYPE, 0)); |
| 7451 | } |
| 7452 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 7453 | return VerifyTableStart(verifier) && |
| 7454 | VerifyField<int32_t>(verifier, VT_TABLE_ID, 4) && |
| 7455 | VerifyField<int8_t>(verifier, VT_KEY_DTYPE, 1) && |
| 7456 | VerifyField<int8_t>(verifier, VT_VALUE_DTYPE, 1) && |
| 7457 | verifier.EndTable(); |
| 7458 | } |
| 7459 | }; |
| 7460 | |
| 7461 | struct HashtableOptionsBuilder { |
| 7462 | typedef HashtableOptions Table; |
| 7463 | flatbuffers::FlatBufferBuilder &fbb_; |
| 7464 | flatbuffers::uoffset_t start_; |
| 7465 | void add_table_id(int32_t table_id) { |
| 7466 | fbb_.AddElement<int32_t>(HashtableOptions::VT_TABLE_ID, table_id, 0); |
| 7467 | } |
| 7468 | void add_key_dtype(tflite::TensorType key_dtype) { |
| 7469 | fbb_.AddElement<int8_t>(HashtableOptions::VT_KEY_DTYPE, static_cast<int8_t>(key_dtype), 0); |
| 7470 | } |
| 7471 | void add_value_dtype(tflite::TensorType value_dtype) { |
| 7472 | fbb_.AddElement<int8_t>(HashtableOptions::VT_VALUE_DTYPE, static_cast<int8_t>(value_dtype), 0); |
| 7473 | } |
| 7474 | explicit HashtableOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 7475 | : fbb_(_fbb) { |
| 7476 | start_ = fbb_.StartTable(); |
| 7477 | } |
| 7478 | flatbuffers::Offset<HashtableOptions> Finish() { |
| 7479 | const auto end = fbb_.EndTable(start_); |
| 7480 | auto o = flatbuffers::Offset<HashtableOptions>(end); |
| 7481 | return o; |
| 7482 | } |
| 7483 | }; |
| 7484 | |
| 7485 | inline flatbuffers::Offset<HashtableOptions> CreateHashtableOptions( |
| 7486 | flatbuffers::FlatBufferBuilder &_fbb, |
| 7487 | int32_t table_id = 0, |
| 7488 | tflite::TensorType key_dtype = tflite::TensorType_FLOAT32, |
| 7489 | tflite::TensorType value_dtype = tflite::TensorType_FLOAT32) { |
| 7490 | HashtableOptionsBuilder builder_(_fbb); |
| 7491 | builder_.add_table_id(table_id); |
| 7492 | builder_.add_value_dtype(value_dtype); |
| 7493 | builder_.add_key_dtype(key_dtype); |
| 7494 | return builder_.Finish(); |
| 7495 | } |
| 7496 | |
| 7497 | struct HashtableFindOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 7498 | typedef HashtableFindOptionsBuilder Builder; |
| 7499 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 7500 | return VerifyTableStart(verifier) && |
| 7501 | verifier.EndTable(); |
| 7502 | } |
| 7503 | }; |
| 7504 | |
| 7505 | struct HashtableFindOptionsBuilder { |
| 7506 | typedef HashtableFindOptions Table; |
| 7507 | flatbuffers::FlatBufferBuilder &fbb_; |
| 7508 | flatbuffers::uoffset_t start_; |
| 7509 | explicit HashtableFindOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 7510 | : fbb_(_fbb) { |
| 7511 | start_ = fbb_.StartTable(); |
| 7512 | } |
| 7513 | flatbuffers::Offset<HashtableFindOptions> Finish() { |
| 7514 | const auto end = fbb_.EndTable(start_); |
| 7515 | auto o = flatbuffers::Offset<HashtableFindOptions>(end); |
| 7516 | return o; |
| 7517 | } |
| 7518 | }; |
| 7519 | |
| 7520 | inline flatbuffers::Offset<HashtableFindOptions> CreateHashtableFindOptions( |
| 7521 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 7522 | HashtableFindOptionsBuilder builder_(_fbb); |
| 7523 | return builder_.Finish(); |
| 7524 | } |
| 7525 | |
| 7526 | struct HashtableImportOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 7527 | typedef HashtableImportOptionsBuilder Builder; |
| 7528 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 7529 | return VerifyTableStart(verifier) && |
| 7530 | verifier.EndTable(); |
| 7531 | } |
| 7532 | }; |
| 7533 | |
| 7534 | struct HashtableImportOptionsBuilder { |
| 7535 | typedef HashtableImportOptions Table; |
| 7536 | flatbuffers::FlatBufferBuilder &fbb_; |
| 7537 | flatbuffers::uoffset_t start_; |
| 7538 | explicit HashtableImportOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 7539 | : fbb_(_fbb) { |
| 7540 | start_ = fbb_.StartTable(); |
| 7541 | } |
| 7542 | flatbuffers::Offset<HashtableImportOptions> Finish() { |
| 7543 | const auto end = fbb_.EndTable(start_); |
| 7544 | auto o = flatbuffers::Offset<HashtableImportOptions>(end); |
| 7545 | return o; |
| 7546 | } |
| 7547 | }; |
| 7548 | |
| 7549 | inline flatbuffers::Offset<HashtableImportOptions> CreateHashtableImportOptions( |
| 7550 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 7551 | HashtableImportOptionsBuilder builder_(_fbb); |
| 7552 | return builder_.Finish(); |
| 7553 | } |
| 7554 | |
| 7555 | struct HashtableSizeOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 7556 | typedef HashtableSizeOptionsBuilder Builder; |
| 7557 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 7558 | return VerifyTableStart(verifier) && |
| 7559 | verifier.EndTable(); |
| 7560 | } |
| 7561 | }; |
| 7562 | |
| 7563 | struct HashtableSizeOptionsBuilder { |
| 7564 | typedef HashtableSizeOptions Table; |
| 7565 | flatbuffers::FlatBufferBuilder &fbb_; |
| 7566 | flatbuffers::uoffset_t start_; |
| 7567 | explicit HashtableSizeOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 7568 | : fbb_(_fbb) { |
| 7569 | start_ = fbb_.StartTable(); |
| 7570 | } |
| 7571 | flatbuffers::Offset<HashtableSizeOptions> Finish() { |
| 7572 | const auto end = fbb_.EndTable(start_); |
| 7573 | auto o = flatbuffers::Offset<HashtableSizeOptions>(end); |
| 7574 | return o; |
| 7575 | } |
| 7576 | }; |
| 7577 | |
| 7578 | inline flatbuffers::Offset<HashtableSizeOptions> CreateHashtableSizeOptions( |
| 7579 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 7580 | HashtableSizeOptionsBuilder builder_(_fbb); |
| 7581 | return builder_.Finish(); |
| 7582 | } |
| 7583 | |
| 7584 | struct VarHandleOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 7585 | typedef VarHandleOptionsBuilder Builder; |
| 7586 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 7587 | VT_CONTAINER = 4, |
| 7588 | VT_SHARED_NAME = 6 |
| 7589 | }; |
| 7590 | const flatbuffers::String *container() const { |
| 7591 | return GetPointer<const flatbuffers::String *>(VT_CONTAINER); |
| 7592 | } |
| 7593 | const flatbuffers::String *shared_name() const { |
| 7594 | return GetPointer<const flatbuffers::String *>(VT_SHARED_NAME); |
| 7595 | } |
| 7596 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 7597 | return VerifyTableStart(verifier) && |
| 7598 | VerifyOffset(verifier, VT_CONTAINER) && |
| 7599 | verifier.VerifyString(container()) && |
| 7600 | VerifyOffset(verifier, VT_SHARED_NAME) && |
| 7601 | verifier.VerifyString(shared_name()) && |
| 7602 | verifier.EndTable(); |
| 7603 | } |
| 7604 | }; |
| 7605 | |
| 7606 | struct VarHandleOptionsBuilder { |
| 7607 | typedef VarHandleOptions Table; |
| 7608 | flatbuffers::FlatBufferBuilder &fbb_; |
| 7609 | flatbuffers::uoffset_t start_; |
| 7610 | void add_container(flatbuffers::Offset<flatbuffers::String> container) { |
| 7611 | fbb_.AddOffset(VarHandleOptions::VT_CONTAINER, container); |
| 7612 | } |
| 7613 | void add_shared_name(flatbuffers::Offset<flatbuffers::String> shared_name) { |
| 7614 | fbb_.AddOffset(VarHandleOptions::VT_SHARED_NAME, shared_name); |
| 7615 | } |
| 7616 | explicit VarHandleOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 7617 | : fbb_(_fbb) { |
| 7618 | start_ = fbb_.StartTable(); |
| 7619 | } |
| 7620 | flatbuffers::Offset<VarHandleOptions> Finish() { |
| 7621 | const auto end = fbb_.EndTable(start_); |
| 7622 | auto o = flatbuffers::Offset<VarHandleOptions>(end); |
| 7623 | return o; |
| 7624 | } |
| 7625 | }; |
| 7626 | |
| 7627 | inline flatbuffers::Offset<VarHandleOptions> CreateVarHandleOptions( |
| 7628 | flatbuffers::FlatBufferBuilder &_fbb, |
| 7629 | flatbuffers::Offset<flatbuffers::String> container = 0, |
| 7630 | flatbuffers::Offset<flatbuffers::String> shared_name = 0) { |
| 7631 | VarHandleOptionsBuilder builder_(_fbb); |
| 7632 | builder_.add_shared_name(shared_name); |
| 7633 | builder_.add_container(container); |
| 7634 | return builder_.Finish(); |
| 7635 | } |
| 7636 | |
| 7637 | inline flatbuffers::Offset<VarHandleOptions> CreateVarHandleOptionsDirect( |
| 7638 | flatbuffers::FlatBufferBuilder &_fbb, |
| 7639 | const char *container = nullptr, |
| 7640 | const char *shared_name = nullptr) { |
| 7641 | auto container__ = container ? _fbb.CreateString(container) : 0; |
| 7642 | auto shared_name__ = shared_name ? _fbb.CreateString(shared_name) : 0; |
| 7643 | return tflite::CreateVarHandleOptions( |
| 7644 | _fbb, |
| 7645 | container__, |
| 7646 | shared_name__); |
| 7647 | } |
| 7648 | |
| 7649 | struct ReadVariableOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 7650 | typedef ReadVariableOptionsBuilder Builder; |
| 7651 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 7652 | return VerifyTableStart(verifier) && |
| 7653 | verifier.EndTable(); |
| 7654 | } |
| 7655 | }; |
| 7656 | |
| 7657 | struct ReadVariableOptionsBuilder { |
| 7658 | typedef ReadVariableOptions Table; |
| 7659 | flatbuffers::FlatBufferBuilder &fbb_; |
| 7660 | flatbuffers::uoffset_t start_; |
| 7661 | explicit ReadVariableOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 7662 | : fbb_(_fbb) { |
| 7663 | start_ = fbb_.StartTable(); |
| 7664 | } |
| 7665 | flatbuffers::Offset<ReadVariableOptions> Finish() { |
| 7666 | const auto end = fbb_.EndTable(start_); |
| 7667 | auto o = flatbuffers::Offset<ReadVariableOptions>(end); |
| 7668 | return o; |
| 7669 | } |
| 7670 | }; |
| 7671 | |
| 7672 | inline flatbuffers::Offset<ReadVariableOptions> CreateReadVariableOptions( |
| 7673 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 7674 | ReadVariableOptionsBuilder builder_(_fbb); |
| 7675 | return builder_.Finish(); |
| 7676 | } |
| 7677 | |
| 7678 | struct AssignVariableOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 7679 | typedef AssignVariableOptionsBuilder Builder; |
| 7680 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 7681 | return VerifyTableStart(verifier) && |
| 7682 | verifier.EndTable(); |
| 7683 | } |
| 7684 | }; |
| 7685 | |
| 7686 | struct AssignVariableOptionsBuilder { |
| 7687 | typedef AssignVariableOptions Table; |
| 7688 | flatbuffers::FlatBufferBuilder &fbb_; |
| 7689 | flatbuffers::uoffset_t start_; |
| 7690 | explicit AssignVariableOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 7691 | : fbb_(_fbb) { |
| 7692 | start_ = fbb_.StartTable(); |
| 7693 | } |
| 7694 | flatbuffers::Offset<AssignVariableOptions> Finish() { |
| 7695 | const auto end = fbb_.EndTable(start_); |
| 7696 | auto o = flatbuffers::Offset<AssignVariableOptions>(end); |
| 7697 | return o; |
| 7698 | } |
| 7699 | }; |
| 7700 | |
| 7701 | inline flatbuffers::Offset<AssignVariableOptions> CreateAssignVariableOptions( |
| 7702 | flatbuffers::FlatBufferBuilder &_fbb) { |
| 7703 | AssignVariableOptionsBuilder builder_(_fbb); |
| 7704 | return builder_.Finish(); |
| 7705 | } |
| 7706 | |
| 7707 | struct RandomOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 7708 | typedef RandomOptionsBuilder Builder; |
| 7709 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 7710 | VT_SEED = 4, |
| 7711 | VT_SEED2 = 6 |
| 7712 | }; |
| 7713 | int64_t seed() const { |
| 7714 | return GetField<int64_t>(VT_SEED, 0); |
| 7715 | } |
| 7716 | int64_t seed2() const { |
| 7717 | return GetField<int64_t>(VT_SEED2, 0); |
| 7718 | } |
| 7719 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 7720 | return VerifyTableStart(verifier) && |
| 7721 | VerifyField<int64_t>(verifier, VT_SEED, 8) && |
| 7722 | VerifyField<int64_t>(verifier, VT_SEED2, 8) && |
| 7723 | verifier.EndTable(); |
| 7724 | } |
| 7725 | }; |
| 7726 | |
| 7727 | struct RandomOptionsBuilder { |
| 7728 | typedef RandomOptions Table; |
| 7729 | flatbuffers::FlatBufferBuilder &fbb_; |
| 7730 | flatbuffers::uoffset_t start_; |
| 7731 | void add_seed(int64_t seed) { |
| 7732 | fbb_.AddElement<int64_t>(RandomOptions::VT_SEED, seed, 0); |
| 7733 | } |
| 7734 | void add_seed2(int64_t seed2) { |
| 7735 | fbb_.AddElement<int64_t>(RandomOptions::VT_SEED2, seed2, 0); |
| 7736 | } |
| 7737 | explicit RandomOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 7738 | : fbb_(_fbb) { |
| 7739 | start_ = fbb_.StartTable(); |
| 7740 | } |
| 7741 | flatbuffers::Offset<RandomOptions> Finish() { |
| 7742 | const auto end = fbb_.EndTable(start_); |
| 7743 | auto o = flatbuffers::Offset<RandomOptions>(end); |
| 7744 | return o; |
| 7745 | } |
| 7746 | }; |
| 7747 | |
| 7748 | inline flatbuffers::Offset<RandomOptions> CreateRandomOptions( |
| 7749 | flatbuffers::FlatBufferBuilder &_fbb, |
| 7750 | int64_t seed = 0, |
| 7751 | int64_t seed2 = 0) { |
| 7752 | RandomOptionsBuilder builder_(_fbb); |
| 7753 | builder_.add_seed2(seed2); |
| 7754 | builder_.add_seed(seed); |
| 7755 | return builder_.Finish(); |
| 7756 | } |
| 7757 | |
| 7758 | struct BucketizeOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 7759 | typedef BucketizeOptionsBuilder Builder; |
| 7760 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 7761 | VT_BOUNDARIES = 4 |
| 7762 | }; |
| 7763 | const flatbuffers::Vector<float> *boundaries() const { |
| 7764 | return GetPointer<const flatbuffers::Vector<float> *>(VT_BOUNDARIES); |
| 7765 | } |
| 7766 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 7767 | return VerifyTableStart(verifier) && |
| 7768 | VerifyOffset(verifier, VT_BOUNDARIES) && |
| 7769 | verifier.VerifyVector(boundaries()) && |
| 7770 | verifier.EndTable(); |
| 7771 | } |
| 7772 | }; |
| 7773 | |
| 7774 | struct BucketizeOptionsBuilder { |
| 7775 | typedef BucketizeOptions Table; |
| 7776 | flatbuffers::FlatBufferBuilder &fbb_; |
| 7777 | flatbuffers::uoffset_t start_; |
| 7778 | void add_boundaries(flatbuffers::Offset<flatbuffers::Vector<float>> boundaries) { |
| 7779 | fbb_.AddOffset(BucketizeOptions::VT_BOUNDARIES, boundaries); |
| 7780 | } |
| 7781 | explicit BucketizeOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 7782 | : fbb_(_fbb) { |
| 7783 | start_ = fbb_.StartTable(); |
| 7784 | } |
| 7785 | flatbuffers::Offset<BucketizeOptions> Finish() { |
| 7786 | const auto end = fbb_.EndTable(start_); |
| 7787 | auto o = flatbuffers::Offset<BucketizeOptions>(end); |
| 7788 | return o; |
| 7789 | } |
| 7790 | }; |
| 7791 | |
| 7792 | inline flatbuffers::Offset<BucketizeOptions> CreateBucketizeOptions( |
| 7793 | flatbuffers::FlatBufferBuilder &_fbb, |
| 7794 | flatbuffers::Offset<flatbuffers::Vector<float>> boundaries = 0) { |
| 7795 | BucketizeOptionsBuilder builder_(_fbb); |
| 7796 | builder_.add_boundaries(boundaries); |
| 7797 | return builder_.Finish(); |
| 7798 | } |
| 7799 | |
| 7800 | inline flatbuffers::Offset<BucketizeOptions> CreateBucketizeOptionsDirect( |
| 7801 | flatbuffers::FlatBufferBuilder &_fbb, |
| 7802 | const std::vector<float> *boundaries = nullptr) { |
| 7803 | auto boundaries__ = boundaries ? _fbb.CreateVector<float>(*boundaries) : 0; |
| 7804 | return tflite::CreateBucketizeOptions( |
| 7805 | _fbb, |
| 7806 | boundaries__); |
| 7807 | } |
| 7808 | |
| 7809 | struct GeluOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 7810 | typedef GeluOptionsBuilder Builder; |
| 7811 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 7812 | VT_APPROXIMATE = 4 |
| 7813 | }; |
| 7814 | bool approximate() const { |
| 7815 | return GetField<uint8_t>(VT_APPROXIMATE, 0) != 0; |
| 7816 | } |
| 7817 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 7818 | return VerifyTableStart(verifier) && |
| 7819 | VerifyField<uint8_t>(verifier, VT_APPROXIMATE, 1) && |
| 7820 | verifier.EndTable(); |
| 7821 | } |
| 7822 | }; |
| 7823 | |
| 7824 | struct GeluOptionsBuilder { |
| 7825 | typedef GeluOptions Table; |
| 7826 | flatbuffers::FlatBufferBuilder &fbb_; |
| 7827 | flatbuffers::uoffset_t start_; |
| 7828 | void add_approximate(bool approximate) { |
| 7829 | fbb_.AddElement<uint8_t>(GeluOptions::VT_APPROXIMATE, static_cast<uint8_t>(approximate), 0); |
| 7830 | } |
| 7831 | explicit GeluOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 7832 | : fbb_(_fbb) { |
| 7833 | start_ = fbb_.StartTable(); |
| 7834 | } |
| 7835 | flatbuffers::Offset<GeluOptions> Finish() { |
| 7836 | const auto end = fbb_.EndTable(start_); |
| 7837 | auto o = flatbuffers::Offset<GeluOptions>(end); |
| 7838 | return o; |
| 7839 | } |
| 7840 | }; |
| 7841 | |
| 7842 | inline flatbuffers::Offset<GeluOptions> CreateGeluOptions( |
| 7843 | flatbuffers::FlatBufferBuilder &_fbb, |
| 7844 | bool approximate = false) { |
| 7845 | GeluOptionsBuilder builder_(_fbb); |
| 7846 | builder_.add_approximate(approximate); |
| 7847 | return builder_.Finish(); |
| 7848 | } |
| 7849 | |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 7850 | struct OperatorCode FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 7851 | typedef OperatorCodeBuilder Builder; |
| 7852 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 7853 | VT_DEPRECATED_BUILTIN_CODE = 4, |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 7854 | VT_CUSTOM_CODE = 6, |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 7855 | VT_VERSION = 8, |
| 7856 | VT_BUILTIN_CODE = 10 |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 7857 | }; |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 7858 | int8_t deprecated_builtin_code() const { |
| 7859 | return GetField<int8_t>(VT_DEPRECATED_BUILTIN_CODE, 0); |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 7860 | } |
| 7861 | const flatbuffers::String *custom_code() const { |
| 7862 | return GetPointer<const flatbuffers::String *>(VT_CUSTOM_CODE); |
| 7863 | } |
| 7864 | int32_t version() const { |
| 7865 | return GetField<int32_t>(VT_VERSION, 1); |
| 7866 | } |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 7867 | tflite::BuiltinOperator builtin_code() const { |
| 7868 | return static_cast<tflite::BuiltinOperator>(GetField<int32_t>(VT_BUILTIN_CODE, 0)); |
| 7869 | } |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 7870 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 7871 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 7872 | VerifyField<int8_t>(verifier, VT_DEPRECATED_BUILTIN_CODE, 1) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 7873 | VerifyOffset(verifier, VT_CUSTOM_CODE) && |
| 7874 | verifier.VerifyString(custom_code()) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 7875 | VerifyField<int32_t>(verifier, VT_VERSION, 4) && |
| 7876 | VerifyField<int32_t>(verifier, VT_BUILTIN_CODE, 4) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 7877 | verifier.EndTable(); |
| 7878 | } |
| 7879 | }; |
| 7880 | |
| 7881 | struct OperatorCodeBuilder { |
| 7882 | typedef OperatorCode Table; |
| 7883 | flatbuffers::FlatBufferBuilder &fbb_; |
| 7884 | flatbuffers::uoffset_t start_; |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 7885 | void add_deprecated_builtin_code(int8_t deprecated_builtin_code) { |
| 7886 | fbb_.AddElement<int8_t>(OperatorCode::VT_DEPRECATED_BUILTIN_CODE, deprecated_builtin_code, 0); |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 7887 | } |
| 7888 | void add_custom_code(flatbuffers::Offset<flatbuffers::String> custom_code) { |
| 7889 | fbb_.AddOffset(OperatorCode::VT_CUSTOM_CODE, custom_code); |
| 7890 | } |
| 7891 | void add_version(int32_t version) { |
| 7892 | fbb_.AddElement<int32_t>(OperatorCode::VT_VERSION, version, 1); |
| 7893 | } |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 7894 | void add_builtin_code(tflite::BuiltinOperator builtin_code) { |
| 7895 | fbb_.AddElement<int32_t>(OperatorCode::VT_BUILTIN_CODE, static_cast<int32_t>(builtin_code), 0); |
| 7896 | } |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 7897 | explicit OperatorCodeBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 7898 | : fbb_(_fbb) { |
| 7899 | start_ = fbb_.StartTable(); |
| 7900 | } |
| 7901 | flatbuffers::Offset<OperatorCode> Finish() { |
| 7902 | const auto end = fbb_.EndTable(start_); |
| 7903 | auto o = flatbuffers::Offset<OperatorCode>(end); |
| 7904 | return o; |
| 7905 | } |
| 7906 | }; |
| 7907 | |
| 7908 | inline flatbuffers::Offset<OperatorCode> CreateOperatorCode( |
| 7909 | flatbuffers::FlatBufferBuilder &_fbb, |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 7910 | int8_t deprecated_builtin_code = 0, |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 7911 | flatbuffers::Offset<flatbuffers::String> custom_code = 0, |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 7912 | int32_t version = 1, |
| 7913 | tflite::BuiltinOperator builtin_code = tflite::BuiltinOperator_ADD) { |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 7914 | OperatorCodeBuilder builder_(_fbb); |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 7915 | builder_.add_builtin_code(builtin_code); |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 7916 | builder_.add_version(version); |
| 7917 | builder_.add_custom_code(custom_code); |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 7918 | builder_.add_deprecated_builtin_code(deprecated_builtin_code); |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 7919 | return builder_.Finish(); |
| 7920 | } |
| 7921 | |
| 7922 | inline flatbuffers::Offset<OperatorCode> CreateOperatorCodeDirect( |
| 7923 | flatbuffers::FlatBufferBuilder &_fbb, |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 7924 | int8_t deprecated_builtin_code = 0, |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 7925 | const char *custom_code = nullptr, |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 7926 | int32_t version = 1, |
| 7927 | tflite::BuiltinOperator builtin_code = tflite::BuiltinOperator_ADD) { |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 7928 | auto custom_code__ = custom_code ? _fbb.CreateString(custom_code) : 0; |
| 7929 | return tflite::CreateOperatorCode( |
| 7930 | _fbb, |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 7931 | deprecated_builtin_code, |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 7932 | custom_code__, |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 7933 | version, |
| 7934 | builtin_code); |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 7935 | } |
| 7936 | |
| 7937 | struct Operator FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 7938 | typedef OperatorBuilder Builder; |
| 7939 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 7940 | VT_OPCODE_INDEX = 4, |
| 7941 | VT_INPUTS = 6, |
| 7942 | VT_OUTPUTS = 8, |
| 7943 | VT_BUILTIN_OPTIONS_TYPE = 10, |
| 7944 | VT_BUILTIN_OPTIONS = 12, |
| 7945 | VT_CUSTOM_OPTIONS = 14, |
| 7946 | VT_CUSTOM_OPTIONS_FORMAT = 16, |
| 7947 | VT_MUTATING_VARIABLE_INPUTS = 18, |
| 7948 | VT_INTERMEDIATES = 20 |
| 7949 | }; |
| 7950 | uint32_t opcode_index() const { |
| 7951 | return GetField<uint32_t>(VT_OPCODE_INDEX, 0); |
| 7952 | } |
| 7953 | const flatbuffers::Vector<int32_t> *inputs() const { |
| 7954 | return GetPointer<const flatbuffers::Vector<int32_t> *>(VT_INPUTS); |
| 7955 | } |
| 7956 | const flatbuffers::Vector<int32_t> *outputs() const { |
| 7957 | return GetPointer<const flatbuffers::Vector<int32_t> *>(VT_OUTPUTS); |
| 7958 | } |
| 7959 | tflite::BuiltinOptions builtin_options_type() const { |
| 7960 | return static_cast<tflite::BuiltinOptions>(GetField<uint8_t>(VT_BUILTIN_OPTIONS_TYPE, 0)); |
| 7961 | } |
| 7962 | const void *builtin_options() const { |
| 7963 | return GetPointer<const void *>(VT_BUILTIN_OPTIONS); |
| 7964 | } |
| 7965 | template<typename T> const T *builtin_options_as() const; |
| 7966 | const tflite::Conv2DOptions *builtin_options_as_Conv2DOptions() const { |
| 7967 | return builtin_options_type() == tflite::BuiltinOptions_Conv2DOptions ? static_cast<const tflite::Conv2DOptions *>(builtin_options()) : nullptr; |
| 7968 | } |
| 7969 | const tflite::DepthwiseConv2DOptions *builtin_options_as_DepthwiseConv2DOptions() const { |
| 7970 | return builtin_options_type() == tflite::BuiltinOptions_DepthwiseConv2DOptions ? static_cast<const tflite::DepthwiseConv2DOptions *>(builtin_options()) : nullptr; |
| 7971 | } |
| 7972 | const tflite::ConcatEmbeddingsOptions *builtin_options_as_ConcatEmbeddingsOptions() const { |
| 7973 | return builtin_options_type() == tflite::BuiltinOptions_ConcatEmbeddingsOptions ? static_cast<const tflite::ConcatEmbeddingsOptions *>(builtin_options()) : nullptr; |
| 7974 | } |
| 7975 | const tflite::LSHProjectionOptions *builtin_options_as_LSHProjectionOptions() const { |
| 7976 | return builtin_options_type() == tflite::BuiltinOptions_LSHProjectionOptions ? static_cast<const tflite::LSHProjectionOptions *>(builtin_options()) : nullptr; |
| 7977 | } |
| 7978 | const tflite::Pool2DOptions *builtin_options_as_Pool2DOptions() const { |
| 7979 | return builtin_options_type() == tflite::BuiltinOptions_Pool2DOptions ? static_cast<const tflite::Pool2DOptions *>(builtin_options()) : nullptr; |
| 7980 | } |
| 7981 | const tflite::SVDFOptions *builtin_options_as_SVDFOptions() const { |
| 7982 | return builtin_options_type() == tflite::BuiltinOptions_SVDFOptions ? static_cast<const tflite::SVDFOptions *>(builtin_options()) : nullptr; |
| 7983 | } |
| 7984 | const tflite::RNNOptions *builtin_options_as_RNNOptions() const { |
| 7985 | return builtin_options_type() == tflite::BuiltinOptions_RNNOptions ? static_cast<const tflite::RNNOptions *>(builtin_options()) : nullptr; |
| 7986 | } |
| 7987 | const tflite::FullyConnectedOptions *builtin_options_as_FullyConnectedOptions() const { |
| 7988 | return builtin_options_type() == tflite::BuiltinOptions_FullyConnectedOptions ? static_cast<const tflite::FullyConnectedOptions *>(builtin_options()) : nullptr; |
| 7989 | } |
| 7990 | const tflite::SoftmaxOptions *builtin_options_as_SoftmaxOptions() const { |
| 7991 | return builtin_options_type() == tflite::BuiltinOptions_SoftmaxOptions ? static_cast<const tflite::SoftmaxOptions *>(builtin_options()) : nullptr; |
| 7992 | } |
| 7993 | const tflite::ConcatenationOptions *builtin_options_as_ConcatenationOptions() const { |
| 7994 | return builtin_options_type() == tflite::BuiltinOptions_ConcatenationOptions ? static_cast<const tflite::ConcatenationOptions *>(builtin_options()) : nullptr; |
| 7995 | } |
| 7996 | const tflite::AddOptions *builtin_options_as_AddOptions() const { |
| 7997 | return builtin_options_type() == tflite::BuiltinOptions_AddOptions ? static_cast<const tflite::AddOptions *>(builtin_options()) : nullptr; |
| 7998 | } |
| 7999 | const tflite::L2NormOptions *builtin_options_as_L2NormOptions() const { |
| 8000 | return builtin_options_type() == tflite::BuiltinOptions_L2NormOptions ? static_cast<const tflite::L2NormOptions *>(builtin_options()) : nullptr; |
| 8001 | } |
| 8002 | const tflite::LocalResponseNormalizationOptions *builtin_options_as_LocalResponseNormalizationOptions() const { |
| 8003 | return builtin_options_type() == tflite::BuiltinOptions_LocalResponseNormalizationOptions ? static_cast<const tflite::LocalResponseNormalizationOptions *>(builtin_options()) : nullptr; |
| 8004 | } |
| 8005 | const tflite::LSTMOptions *builtin_options_as_LSTMOptions() const { |
| 8006 | return builtin_options_type() == tflite::BuiltinOptions_LSTMOptions ? static_cast<const tflite::LSTMOptions *>(builtin_options()) : nullptr; |
| 8007 | } |
| 8008 | const tflite::ResizeBilinearOptions *builtin_options_as_ResizeBilinearOptions() const { |
| 8009 | return builtin_options_type() == tflite::BuiltinOptions_ResizeBilinearOptions ? static_cast<const tflite::ResizeBilinearOptions *>(builtin_options()) : nullptr; |
| 8010 | } |
| 8011 | const tflite::CallOptions *builtin_options_as_CallOptions() const { |
| 8012 | return builtin_options_type() == tflite::BuiltinOptions_CallOptions ? static_cast<const tflite::CallOptions *>(builtin_options()) : nullptr; |
| 8013 | } |
| 8014 | const tflite::ReshapeOptions *builtin_options_as_ReshapeOptions() const { |
| 8015 | return builtin_options_type() == tflite::BuiltinOptions_ReshapeOptions ? static_cast<const tflite::ReshapeOptions *>(builtin_options()) : nullptr; |
| 8016 | } |
| 8017 | const tflite::SkipGramOptions *builtin_options_as_SkipGramOptions() const { |
| 8018 | return builtin_options_type() == tflite::BuiltinOptions_SkipGramOptions ? static_cast<const tflite::SkipGramOptions *>(builtin_options()) : nullptr; |
| 8019 | } |
| 8020 | const tflite::SpaceToDepthOptions *builtin_options_as_SpaceToDepthOptions() const { |
| 8021 | return builtin_options_type() == tflite::BuiltinOptions_SpaceToDepthOptions ? static_cast<const tflite::SpaceToDepthOptions *>(builtin_options()) : nullptr; |
| 8022 | } |
| 8023 | const tflite::EmbeddingLookupSparseOptions *builtin_options_as_EmbeddingLookupSparseOptions() const { |
| 8024 | return builtin_options_type() == tflite::BuiltinOptions_EmbeddingLookupSparseOptions ? static_cast<const tflite::EmbeddingLookupSparseOptions *>(builtin_options()) : nullptr; |
| 8025 | } |
| 8026 | const tflite::MulOptions *builtin_options_as_MulOptions() const { |
| 8027 | return builtin_options_type() == tflite::BuiltinOptions_MulOptions ? static_cast<const tflite::MulOptions *>(builtin_options()) : nullptr; |
| 8028 | } |
| 8029 | const tflite::PadOptions *builtin_options_as_PadOptions() const { |
| 8030 | return builtin_options_type() == tflite::BuiltinOptions_PadOptions ? static_cast<const tflite::PadOptions *>(builtin_options()) : nullptr; |
| 8031 | } |
| 8032 | const tflite::GatherOptions *builtin_options_as_GatherOptions() const { |
| 8033 | return builtin_options_type() == tflite::BuiltinOptions_GatherOptions ? static_cast<const tflite::GatherOptions *>(builtin_options()) : nullptr; |
| 8034 | } |
| 8035 | const tflite::BatchToSpaceNDOptions *builtin_options_as_BatchToSpaceNDOptions() const { |
| 8036 | return builtin_options_type() == tflite::BuiltinOptions_BatchToSpaceNDOptions ? static_cast<const tflite::BatchToSpaceNDOptions *>(builtin_options()) : nullptr; |
| 8037 | } |
| 8038 | const tflite::SpaceToBatchNDOptions *builtin_options_as_SpaceToBatchNDOptions() const { |
| 8039 | return builtin_options_type() == tflite::BuiltinOptions_SpaceToBatchNDOptions ? static_cast<const tflite::SpaceToBatchNDOptions *>(builtin_options()) : nullptr; |
| 8040 | } |
| 8041 | const tflite::TransposeOptions *builtin_options_as_TransposeOptions() const { |
| 8042 | return builtin_options_type() == tflite::BuiltinOptions_TransposeOptions ? static_cast<const tflite::TransposeOptions *>(builtin_options()) : nullptr; |
| 8043 | } |
| 8044 | const tflite::ReducerOptions *builtin_options_as_ReducerOptions() const { |
| 8045 | return builtin_options_type() == tflite::BuiltinOptions_ReducerOptions ? static_cast<const tflite::ReducerOptions *>(builtin_options()) : nullptr; |
| 8046 | } |
| 8047 | const tflite::SubOptions *builtin_options_as_SubOptions() const { |
| 8048 | return builtin_options_type() == tflite::BuiltinOptions_SubOptions ? static_cast<const tflite::SubOptions *>(builtin_options()) : nullptr; |
| 8049 | } |
| 8050 | const tflite::DivOptions *builtin_options_as_DivOptions() const { |
| 8051 | return builtin_options_type() == tflite::BuiltinOptions_DivOptions ? static_cast<const tflite::DivOptions *>(builtin_options()) : nullptr; |
| 8052 | } |
| 8053 | const tflite::SqueezeOptions *builtin_options_as_SqueezeOptions() const { |
| 8054 | return builtin_options_type() == tflite::BuiltinOptions_SqueezeOptions ? static_cast<const tflite::SqueezeOptions *>(builtin_options()) : nullptr; |
| 8055 | } |
| 8056 | const tflite::SequenceRNNOptions *builtin_options_as_SequenceRNNOptions() const { |
| 8057 | return builtin_options_type() == tflite::BuiltinOptions_SequenceRNNOptions ? static_cast<const tflite::SequenceRNNOptions *>(builtin_options()) : nullptr; |
| 8058 | } |
| 8059 | const tflite::StridedSliceOptions *builtin_options_as_StridedSliceOptions() const { |
| 8060 | return builtin_options_type() == tflite::BuiltinOptions_StridedSliceOptions ? static_cast<const tflite::StridedSliceOptions *>(builtin_options()) : nullptr; |
| 8061 | } |
| 8062 | const tflite::ExpOptions *builtin_options_as_ExpOptions() const { |
| 8063 | return builtin_options_type() == tflite::BuiltinOptions_ExpOptions ? static_cast<const tflite::ExpOptions *>(builtin_options()) : nullptr; |
| 8064 | } |
| 8065 | const tflite::TopKV2Options *builtin_options_as_TopKV2Options() const { |
| 8066 | return builtin_options_type() == tflite::BuiltinOptions_TopKV2Options ? static_cast<const tflite::TopKV2Options *>(builtin_options()) : nullptr; |
| 8067 | } |
| 8068 | const tflite::SplitOptions *builtin_options_as_SplitOptions() const { |
| 8069 | return builtin_options_type() == tflite::BuiltinOptions_SplitOptions ? static_cast<const tflite::SplitOptions *>(builtin_options()) : nullptr; |
| 8070 | } |
| 8071 | const tflite::LogSoftmaxOptions *builtin_options_as_LogSoftmaxOptions() const { |
| 8072 | return builtin_options_type() == tflite::BuiltinOptions_LogSoftmaxOptions ? static_cast<const tflite::LogSoftmaxOptions *>(builtin_options()) : nullptr; |
| 8073 | } |
| 8074 | const tflite::CastOptions *builtin_options_as_CastOptions() const { |
| 8075 | return builtin_options_type() == tflite::BuiltinOptions_CastOptions ? static_cast<const tflite::CastOptions *>(builtin_options()) : nullptr; |
| 8076 | } |
| 8077 | const tflite::DequantizeOptions *builtin_options_as_DequantizeOptions() const { |
| 8078 | return builtin_options_type() == tflite::BuiltinOptions_DequantizeOptions ? static_cast<const tflite::DequantizeOptions *>(builtin_options()) : nullptr; |
| 8079 | } |
| 8080 | const tflite::MaximumMinimumOptions *builtin_options_as_MaximumMinimumOptions() const { |
| 8081 | return builtin_options_type() == tflite::BuiltinOptions_MaximumMinimumOptions ? static_cast<const tflite::MaximumMinimumOptions *>(builtin_options()) : nullptr; |
| 8082 | } |
| 8083 | const tflite::ArgMaxOptions *builtin_options_as_ArgMaxOptions() const { |
| 8084 | return builtin_options_type() == tflite::BuiltinOptions_ArgMaxOptions ? static_cast<const tflite::ArgMaxOptions *>(builtin_options()) : nullptr; |
| 8085 | } |
| 8086 | const tflite::LessOptions *builtin_options_as_LessOptions() const { |
| 8087 | return builtin_options_type() == tflite::BuiltinOptions_LessOptions ? static_cast<const tflite::LessOptions *>(builtin_options()) : nullptr; |
| 8088 | } |
| 8089 | const tflite::NegOptions *builtin_options_as_NegOptions() const { |
| 8090 | return builtin_options_type() == tflite::BuiltinOptions_NegOptions ? static_cast<const tflite::NegOptions *>(builtin_options()) : nullptr; |
| 8091 | } |
| 8092 | const tflite::PadV2Options *builtin_options_as_PadV2Options() const { |
| 8093 | return builtin_options_type() == tflite::BuiltinOptions_PadV2Options ? static_cast<const tflite::PadV2Options *>(builtin_options()) : nullptr; |
| 8094 | } |
| 8095 | const tflite::GreaterOptions *builtin_options_as_GreaterOptions() const { |
| 8096 | return builtin_options_type() == tflite::BuiltinOptions_GreaterOptions ? static_cast<const tflite::GreaterOptions *>(builtin_options()) : nullptr; |
| 8097 | } |
| 8098 | const tflite::GreaterEqualOptions *builtin_options_as_GreaterEqualOptions() const { |
| 8099 | return builtin_options_type() == tflite::BuiltinOptions_GreaterEqualOptions ? static_cast<const tflite::GreaterEqualOptions *>(builtin_options()) : nullptr; |
| 8100 | } |
| 8101 | const tflite::LessEqualOptions *builtin_options_as_LessEqualOptions() const { |
| 8102 | return builtin_options_type() == tflite::BuiltinOptions_LessEqualOptions ? static_cast<const tflite::LessEqualOptions *>(builtin_options()) : nullptr; |
| 8103 | } |
| 8104 | const tflite::SelectOptions *builtin_options_as_SelectOptions() const { |
| 8105 | return builtin_options_type() == tflite::BuiltinOptions_SelectOptions ? static_cast<const tflite::SelectOptions *>(builtin_options()) : nullptr; |
| 8106 | } |
| 8107 | const tflite::SliceOptions *builtin_options_as_SliceOptions() const { |
| 8108 | return builtin_options_type() == tflite::BuiltinOptions_SliceOptions ? static_cast<const tflite::SliceOptions *>(builtin_options()) : nullptr; |
| 8109 | } |
| 8110 | const tflite::TransposeConvOptions *builtin_options_as_TransposeConvOptions() const { |
| 8111 | return builtin_options_type() == tflite::BuiltinOptions_TransposeConvOptions ? static_cast<const tflite::TransposeConvOptions *>(builtin_options()) : nullptr; |
| 8112 | } |
| 8113 | const tflite::SparseToDenseOptions *builtin_options_as_SparseToDenseOptions() const { |
| 8114 | return builtin_options_type() == tflite::BuiltinOptions_SparseToDenseOptions ? static_cast<const tflite::SparseToDenseOptions *>(builtin_options()) : nullptr; |
| 8115 | } |
| 8116 | const tflite::TileOptions *builtin_options_as_TileOptions() const { |
| 8117 | return builtin_options_type() == tflite::BuiltinOptions_TileOptions ? static_cast<const tflite::TileOptions *>(builtin_options()) : nullptr; |
| 8118 | } |
| 8119 | const tflite::ExpandDimsOptions *builtin_options_as_ExpandDimsOptions() const { |
| 8120 | return builtin_options_type() == tflite::BuiltinOptions_ExpandDimsOptions ? static_cast<const tflite::ExpandDimsOptions *>(builtin_options()) : nullptr; |
| 8121 | } |
| 8122 | const tflite::EqualOptions *builtin_options_as_EqualOptions() const { |
| 8123 | return builtin_options_type() == tflite::BuiltinOptions_EqualOptions ? static_cast<const tflite::EqualOptions *>(builtin_options()) : nullptr; |
| 8124 | } |
| 8125 | const tflite::NotEqualOptions *builtin_options_as_NotEqualOptions() const { |
| 8126 | return builtin_options_type() == tflite::BuiltinOptions_NotEqualOptions ? static_cast<const tflite::NotEqualOptions *>(builtin_options()) : nullptr; |
| 8127 | } |
| 8128 | const tflite::ShapeOptions *builtin_options_as_ShapeOptions() const { |
| 8129 | return builtin_options_type() == tflite::BuiltinOptions_ShapeOptions ? static_cast<const tflite::ShapeOptions *>(builtin_options()) : nullptr; |
| 8130 | } |
| 8131 | const tflite::PowOptions *builtin_options_as_PowOptions() const { |
| 8132 | return builtin_options_type() == tflite::BuiltinOptions_PowOptions ? static_cast<const tflite::PowOptions *>(builtin_options()) : nullptr; |
| 8133 | } |
| 8134 | const tflite::ArgMinOptions *builtin_options_as_ArgMinOptions() const { |
| 8135 | return builtin_options_type() == tflite::BuiltinOptions_ArgMinOptions ? static_cast<const tflite::ArgMinOptions *>(builtin_options()) : nullptr; |
| 8136 | } |
| 8137 | const tflite::FakeQuantOptions *builtin_options_as_FakeQuantOptions() const { |
| 8138 | return builtin_options_type() == tflite::BuiltinOptions_FakeQuantOptions ? static_cast<const tflite::FakeQuantOptions *>(builtin_options()) : nullptr; |
| 8139 | } |
| 8140 | const tflite::PackOptions *builtin_options_as_PackOptions() const { |
| 8141 | return builtin_options_type() == tflite::BuiltinOptions_PackOptions ? static_cast<const tflite::PackOptions *>(builtin_options()) : nullptr; |
| 8142 | } |
| 8143 | const tflite::LogicalOrOptions *builtin_options_as_LogicalOrOptions() const { |
| 8144 | return builtin_options_type() == tflite::BuiltinOptions_LogicalOrOptions ? static_cast<const tflite::LogicalOrOptions *>(builtin_options()) : nullptr; |
| 8145 | } |
| 8146 | const tflite::OneHotOptions *builtin_options_as_OneHotOptions() const { |
| 8147 | return builtin_options_type() == tflite::BuiltinOptions_OneHotOptions ? static_cast<const tflite::OneHotOptions *>(builtin_options()) : nullptr; |
| 8148 | } |
| 8149 | const tflite::LogicalAndOptions *builtin_options_as_LogicalAndOptions() const { |
| 8150 | return builtin_options_type() == tflite::BuiltinOptions_LogicalAndOptions ? static_cast<const tflite::LogicalAndOptions *>(builtin_options()) : nullptr; |
| 8151 | } |
| 8152 | const tflite::LogicalNotOptions *builtin_options_as_LogicalNotOptions() const { |
| 8153 | return builtin_options_type() == tflite::BuiltinOptions_LogicalNotOptions ? static_cast<const tflite::LogicalNotOptions *>(builtin_options()) : nullptr; |
| 8154 | } |
| 8155 | const tflite::UnpackOptions *builtin_options_as_UnpackOptions() const { |
| 8156 | return builtin_options_type() == tflite::BuiltinOptions_UnpackOptions ? static_cast<const tflite::UnpackOptions *>(builtin_options()) : nullptr; |
| 8157 | } |
| 8158 | const tflite::FloorDivOptions *builtin_options_as_FloorDivOptions() const { |
| 8159 | return builtin_options_type() == tflite::BuiltinOptions_FloorDivOptions ? static_cast<const tflite::FloorDivOptions *>(builtin_options()) : nullptr; |
| 8160 | } |
| 8161 | const tflite::SquareOptions *builtin_options_as_SquareOptions() const { |
| 8162 | return builtin_options_type() == tflite::BuiltinOptions_SquareOptions ? static_cast<const tflite::SquareOptions *>(builtin_options()) : nullptr; |
| 8163 | } |
| 8164 | const tflite::ZerosLikeOptions *builtin_options_as_ZerosLikeOptions() const { |
| 8165 | return builtin_options_type() == tflite::BuiltinOptions_ZerosLikeOptions ? static_cast<const tflite::ZerosLikeOptions *>(builtin_options()) : nullptr; |
| 8166 | } |
| 8167 | const tflite::FillOptions *builtin_options_as_FillOptions() const { |
| 8168 | return builtin_options_type() == tflite::BuiltinOptions_FillOptions ? static_cast<const tflite::FillOptions *>(builtin_options()) : nullptr; |
| 8169 | } |
| 8170 | const tflite::BidirectionalSequenceLSTMOptions *builtin_options_as_BidirectionalSequenceLSTMOptions() const { |
| 8171 | return builtin_options_type() == tflite::BuiltinOptions_BidirectionalSequenceLSTMOptions ? static_cast<const tflite::BidirectionalSequenceLSTMOptions *>(builtin_options()) : nullptr; |
| 8172 | } |
| 8173 | const tflite::BidirectionalSequenceRNNOptions *builtin_options_as_BidirectionalSequenceRNNOptions() const { |
| 8174 | return builtin_options_type() == tflite::BuiltinOptions_BidirectionalSequenceRNNOptions ? static_cast<const tflite::BidirectionalSequenceRNNOptions *>(builtin_options()) : nullptr; |
| 8175 | } |
| 8176 | const tflite::UnidirectionalSequenceLSTMOptions *builtin_options_as_UnidirectionalSequenceLSTMOptions() const { |
| 8177 | return builtin_options_type() == tflite::BuiltinOptions_UnidirectionalSequenceLSTMOptions ? static_cast<const tflite::UnidirectionalSequenceLSTMOptions *>(builtin_options()) : nullptr; |
| 8178 | } |
| 8179 | const tflite::FloorModOptions *builtin_options_as_FloorModOptions() const { |
| 8180 | return builtin_options_type() == tflite::BuiltinOptions_FloorModOptions ? static_cast<const tflite::FloorModOptions *>(builtin_options()) : nullptr; |
| 8181 | } |
| 8182 | const tflite::RangeOptions *builtin_options_as_RangeOptions() const { |
| 8183 | return builtin_options_type() == tflite::BuiltinOptions_RangeOptions ? static_cast<const tflite::RangeOptions *>(builtin_options()) : nullptr; |
| 8184 | } |
| 8185 | const tflite::ResizeNearestNeighborOptions *builtin_options_as_ResizeNearestNeighborOptions() const { |
| 8186 | return builtin_options_type() == tflite::BuiltinOptions_ResizeNearestNeighborOptions ? static_cast<const tflite::ResizeNearestNeighborOptions *>(builtin_options()) : nullptr; |
| 8187 | } |
| 8188 | const tflite::LeakyReluOptions *builtin_options_as_LeakyReluOptions() const { |
| 8189 | return builtin_options_type() == tflite::BuiltinOptions_LeakyReluOptions ? static_cast<const tflite::LeakyReluOptions *>(builtin_options()) : nullptr; |
| 8190 | } |
| 8191 | const tflite::SquaredDifferenceOptions *builtin_options_as_SquaredDifferenceOptions() const { |
| 8192 | return builtin_options_type() == tflite::BuiltinOptions_SquaredDifferenceOptions ? static_cast<const tflite::SquaredDifferenceOptions *>(builtin_options()) : nullptr; |
| 8193 | } |
| 8194 | const tflite::MirrorPadOptions *builtin_options_as_MirrorPadOptions() const { |
| 8195 | return builtin_options_type() == tflite::BuiltinOptions_MirrorPadOptions ? static_cast<const tflite::MirrorPadOptions *>(builtin_options()) : nullptr; |
| 8196 | } |
| 8197 | const tflite::AbsOptions *builtin_options_as_AbsOptions() const { |
| 8198 | return builtin_options_type() == tflite::BuiltinOptions_AbsOptions ? static_cast<const tflite::AbsOptions *>(builtin_options()) : nullptr; |
| 8199 | } |
| 8200 | const tflite::SplitVOptions *builtin_options_as_SplitVOptions() const { |
| 8201 | return builtin_options_type() == tflite::BuiltinOptions_SplitVOptions ? static_cast<const tflite::SplitVOptions *>(builtin_options()) : nullptr; |
| 8202 | } |
| 8203 | const tflite::UniqueOptions *builtin_options_as_UniqueOptions() const { |
| 8204 | return builtin_options_type() == tflite::BuiltinOptions_UniqueOptions ? static_cast<const tflite::UniqueOptions *>(builtin_options()) : nullptr; |
| 8205 | } |
| 8206 | const tflite::ReverseV2Options *builtin_options_as_ReverseV2Options() const { |
| 8207 | return builtin_options_type() == tflite::BuiltinOptions_ReverseV2Options ? static_cast<const tflite::ReverseV2Options *>(builtin_options()) : nullptr; |
| 8208 | } |
| 8209 | const tflite::AddNOptions *builtin_options_as_AddNOptions() const { |
| 8210 | return builtin_options_type() == tflite::BuiltinOptions_AddNOptions ? static_cast<const tflite::AddNOptions *>(builtin_options()) : nullptr; |
| 8211 | } |
| 8212 | const tflite::GatherNdOptions *builtin_options_as_GatherNdOptions() const { |
| 8213 | return builtin_options_type() == tflite::BuiltinOptions_GatherNdOptions ? static_cast<const tflite::GatherNdOptions *>(builtin_options()) : nullptr; |
| 8214 | } |
| 8215 | const tflite::CosOptions *builtin_options_as_CosOptions() const { |
| 8216 | return builtin_options_type() == tflite::BuiltinOptions_CosOptions ? static_cast<const tflite::CosOptions *>(builtin_options()) : nullptr; |
| 8217 | } |
| 8218 | const tflite::WhereOptions *builtin_options_as_WhereOptions() const { |
| 8219 | return builtin_options_type() == tflite::BuiltinOptions_WhereOptions ? static_cast<const tflite::WhereOptions *>(builtin_options()) : nullptr; |
| 8220 | } |
| 8221 | const tflite::RankOptions *builtin_options_as_RankOptions() const { |
| 8222 | return builtin_options_type() == tflite::BuiltinOptions_RankOptions ? static_cast<const tflite::RankOptions *>(builtin_options()) : nullptr; |
| 8223 | } |
| 8224 | const tflite::ReverseSequenceOptions *builtin_options_as_ReverseSequenceOptions() const { |
| 8225 | return builtin_options_type() == tflite::BuiltinOptions_ReverseSequenceOptions ? static_cast<const tflite::ReverseSequenceOptions *>(builtin_options()) : nullptr; |
| 8226 | } |
| 8227 | const tflite::MatrixDiagOptions *builtin_options_as_MatrixDiagOptions() const { |
| 8228 | return builtin_options_type() == tflite::BuiltinOptions_MatrixDiagOptions ? static_cast<const tflite::MatrixDiagOptions *>(builtin_options()) : nullptr; |
| 8229 | } |
| 8230 | const tflite::QuantizeOptions *builtin_options_as_QuantizeOptions() const { |
| 8231 | return builtin_options_type() == tflite::BuiltinOptions_QuantizeOptions ? static_cast<const tflite::QuantizeOptions *>(builtin_options()) : nullptr; |
| 8232 | } |
| 8233 | const tflite::MatrixSetDiagOptions *builtin_options_as_MatrixSetDiagOptions() const { |
| 8234 | return builtin_options_type() == tflite::BuiltinOptions_MatrixSetDiagOptions ? static_cast<const tflite::MatrixSetDiagOptions *>(builtin_options()) : nullptr; |
| 8235 | } |
| 8236 | const tflite::HardSwishOptions *builtin_options_as_HardSwishOptions() const { |
| 8237 | return builtin_options_type() == tflite::BuiltinOptions_HardSwishOptions ? static_cast<const tflite::HardSwishOptions *>(builtin_options()) : nullptr; |
| 8238 | } |
| 8239 | const tflite::IfOptions *builtin_options_as_IfOptions() const { |
| 8240 | return builtin_options_type() == tflite::BuiltinOptions_IfOptions ? static_cast<const tflite::IfOptions *>(builtin_options()) : nullptr; |
| 8241 | } |
| 8242 | const tflite::WhileOptions *builtin_options_as_WhileOptions() const { |
| 8243 | return builtin_options_type() == tflite::BuiltinOptions_WhileOptions ? static_cast<const tflite::WhileOptions *>(builtin_options()) : nullptr; |
| 8244 | } |
| 8245 | const tflite::DepthToSpaceOptions *builtin_options_as_DepthToSpaceOptions() const { |
| 8246 | return builtin_options_type() == tflite::BuiltinOptions_DepthToSpaceOptions ? static_cast<const tflite::DepthToSpaceOptions *>(builtin_options()) : nullptr; |
| 8247 | } |
| 8248 | const tflite::NonMaxSuppressionV4Options *builtin_options_as_NonMaxSuppressionV4Options() const { |
| 8249 | return builtin_options_type() == tflite::BuiltinOptions_NonMaxSuppressionV4Options ? static_cast<const tflite::NonMaxSuppressionV4Options *>(builtin_options()) : nullptr; |
| 8250 | } |
| 8251 | const tflite::NonMaxSuppressionV5Options *builtin_options_as_NonMaxSuppressionV5Options() const { |
| 8252 | return builtin_options_type() == tflite::BuiltinOptions_NonMaxSuppressionV5Options ? static_cast<const tflite::NonMaxSuppressionV5Options *>(builtin_options()) : nullptr; |
| 8253 | } |
| 8254 | const tflite::ScatterNdOptions *builtin_options_as_ScatterNdOptions() const { |
| 8255 | return builtin_options_type() == tflite::BuiltinOptions_ScatterNdOptions ? static_cast<const tflite::ScatterNdOptions *>(builtin_options()) : nullptr; |
| 8256 | } |
| 8257 | const tflite::SelectV2Options *builtin_options_as_SelectV2Options() const { |
| 8258 | return builtin_options_type() == tflite::BuiltinOptions_SelectV2Options ? static_cast<const tflite::SelectV2Options *>(builtin_options()) : nullptr; |
| 8259 | } |
| 8260 | const tflite::DensifyOptions *builtin_options_as_DensifyOptions() const { |
| 8261 | return builtin_options_type() == tflite::BuiltinOptions_DensifyOptions ? static_cast<const tflite::DensifyOptions *>(builtin_options()) : nullptr; |
| 8262 | } |
| 8263 | const tflite::SegmentSumOptions *builtin_options_as_SegmentSumOptions() const { |
| 8264 | return builtin_options_type() == tflite::BuiltinOptions_SegmentSumOptions ? static_cast<const tflite::SegmentSumOptions *>(builtin_options()) : nullptr; |
| 8265 | } |
| 8266 | const tflite::BatchMatMulOptions *builtin_options_as_BatchMatMulOptions() const { |
| 8267 | return builtin_options_type() == tflite::BuiltinOptions_BatchMatMulOptions ? static_cast<const tflite::BatchMatMulOptions *>(builtin_options()) : nullptr; |
| 8268 | } |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 8269 | const tflite::CumsumOptions *builtin_options_as_CumsumOptions() const { |
| 8270 | return builtin_options_type() == tflite::BuiltinOptions_CumsumOptions ? static_cast<const tflite::CumsumOptions *>(builtin_options()) : nullptr; |
| 8271 | } |
| 8272 | const tflite::CallOnceOptions *builtin_options_as_CallOnceOptions() const { |
| 8273 | return builtin_options_type() == tflite::BuiltinOptions_CallOnceOptions ? static_cast<const tflite::CallOnceOptions *>(builtin_options()) : nullptr; |
| 8274 | } |
| 8275 | const tflite::BroadcastToOptions *builtin_options_as_BroadcastToOptions() const { |
| 8276 | return builtin_options_type() == tflite::BuiltinOptions_BroadcastToOptions ? static_cast<const tflite::BroadcastToOptions *>(builtin_options()) : nullptr; |
| 8277 | } |
| 8278 | const tflite::Rfft2dOptions *builtin_options_as_Rfft2dOptions() const { |
| 8279 | return builtin_options_type() == tflite::BuiltinOptions_Rfft2dOptions ? static_cast<const tflite::Rfft2dOptions *>(builtin_options()) : nullptr; |
| 8280 | } |
| 8281 | const tflite::Conv3DOptions *builtin_options_as_Conv3DOptions() const { |
| 8282 | return builtin_options_type() == tflite::BuiltinOptions_Conv3DOptions ? static_cast<const tflite::Conv3DOptions *>(builtin_options()) : nullptr; |
| 8283 | } |
| 8284 | const tflite::HashtableOptions *builtin_options_as_HashtableOptions() const { |
| 8285 | return builtin_options_type() == tflite::BuiltinOptions_HashtableOptions ? static_cast<const tflite::HashtableOptions *>(builtin_options()) : nullptr; |
| 8286 | } |
| 8287 | const tflite::HashtableFindOptions *builtin_options_as_HashtableFindOptions() const { |
| 8288 | return builtin_options_type() == tflite::BuiltinOptions_HashtableFindOptions ? static_cast<const tflite::HashtableFindOptions *>(builtin_options()) : nullptr; |
| 8289 | } |
| 8290 | const tflite::HashtableImportOptions *builtin_options_as_HashtableImportOptions() const { |
| 8291 | return builtin_options_type() == tflite::BuiltinOptions_HashtableImportOptions ? static_cast<const tflite::HashtableImportOptions *>(builtin_options()) : nullptr; |
| 8292 | } |
| 8293 | const tflite::HashtableSizeOptions *builtin_options_as_HashtableSizeOptions() const { |
| 8294 | return builtin_options_type() == tflite::BuiltinOptions_HashtableSizeOptions ? static_cast<const tflite::HashtableSizeOptions *>(builtin_options()) : nullptr; |
| 8295 | } |
| 8296 | const tflite::VarHandleOptions *builtin_options_as_VarHandleOptions() const { |
| 8297 | return builtin_options_type() == tflite::BuiltinOptions_VarHandleOptions ? static_cast<const tflite::VarHandleOptions *>(builtin_options()) : nullptr; |
| 8298 | } |
| 8299 | const tflite::ReadVariableOptions *builtin_options_as_ReadVariableOptions() const { |
| 8300 | return builtin_options_type() == tflite::BuiltinOptions_ReadVariableOptions ? static_cast<const tflite::ReadVariableOptions *>(builtin_options()) : nullptr; |
| 8301 | } |
| 8302 | const tflite::AssignVariableOptions *builtin_options_as_AssignVariableOptions() const { |
| 8303 | return builtin_options_type() == tflite::BuiltinOptions_AssignVariableOptions ? static_cast<const tflite::AssignVariableOptions *>(builtin_options()) : nullptr; |
| 8304 | } |
| 8305 | const tflite::RandomOptions *builtin_options_as_RandomOptions() const { |
| 8306 | return builtin_options_type() == tflite::BuiltinOptions_RandomOptions ? static_cast<const tflite::RandomOptions *>(builtin_options()) : nullptr; |
| 8307 | } |
| 8308 | const tflite::BucketizeOptions *builtin_options_as_BucketizeOptions() const { |
| 8309 | return builtin_options_type() == tflite::BuiltinOptions_BucketizeOptions ? static_cast<const tflite::BucketizeOptions *>(builtin_options()) : nullptr; |
| 8310 | } |
| 8311 | const tflite::GeluOptions *builtin_options_as_GeluOptions() const { |
| 8312 | return builtin_options_type() == tflite::BuiltinOptions_GeluOptions ? static_cast<const tflite::GeluOptions *>(builtin_options()) : nullptr; |
| 8313 | } |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 8314 | const flatbuffers::Vector<uint8_t> *custom_options() const { |
| 8315 | return GetPointer<const flatbuffers::Vector<uint8_t> *>(VT_CUSTOM_OPTIONS); |
| 8316 | } |
| 8317 | tflite::CustomOptionsFormat custom_options_format() const { |
| 8318 | return static_cast<tflite::CustomOptionsFormat>(GetField<int8_t>(VT_CUSTOM_OPTIONS_FORMAT, 0)); |
| 8319 | } |
| 8320 | const flatbuffers::Vector<uint8_t> *mutating_variable_inputs() const { |
| 8321 | return GetPointer<const flatbuffers::Vector<uint8_t> *>(VT_MUTATING_VARIABLE_INPUTS); |
| 8322 | } |
| 8323 | const flatbuffers::Vector<int32_t> *intermediates() const { |
| 8324 | return GetPointer<const flatbuffers::Vector<int32_t> *>(VT_INTERMEDIATES); |
| 8325 | } |
| 8326 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 8327 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 8328 | VerifyField<uint32_t>(verifier, VT_OPCODE_INDEX, 4) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 8329 | VerifyOffset(verifier, VT_INPUTS) && |
| 8330 | verifier.VerifyVector(inputs()) && |
| 8331 | VerifyOffset(verifier, VT_OUTPUTS) && |
| 8332 | verifier.VerifyVector(outputs()) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 8333 | VerifyField<uint8_t>(verifier, VT_BUILTIN_OPTIONS_TYPE, 1) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 8334 | VerifyOffset(verifier, VT_BUILTIN_OPTIONS) && |
| 8335 | VerifyBuiltinOptions(verifier, builtin_options(), builtin_options_type()) && |
| 8336 | VerifyOffset(verifier, VT_CUSTOM_OPTIONS) && |
| 8337 | verifier.VerifyVector(custom_options()) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 8338 | VerifyField<int8_t>(verifier, VT_CUSTOM_OPTIONS_FORMAT, 1) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 8339 | VerifyOffset(verifier, VT_MUTATING_VARIABLE_INPUTS) && |
| 8340 | verifier.VerifyVector(mutating_variable_inputs()) && |
| 8341 | VerifyOffset(verifier, VT_INTERMEDIATES) && |
| 8342 | verifier.VerifyVector(intermediates()) && |
| 8343 | verifier.EndTable(); |
| 8344 | } |
| 8345 | }; |
| 8346 | |
| 8347 | template<> inline const tflite::Conv2DOptions *Operator::builtin_options_as<tflite::Conv2DOptions>() const { |
| 8348 | return builtin_options_as_Conv2DOptions(); |
| 8349 | } |
| 8350 | |
| 8351 | template<> inline const tflite::DepthwiseConv2DOptions *Operator::builtin_options_as<tflite::DepthwiseConv2DOptions>() const { |
| 8352 | return builtin_options_as_DepthwiseConv2DOptions(); |
| 8353 | } |
| 8354 | |
| 8355 | template<> inline const tflite::ConcatEmbeddingsOptions *Operator::builtin_options_as<tflite::ConcatEmbeddingsOptions>() const { |
| 8356 | return builtin_options_as_ConcatEmbeddingsOptions(); |
| 8357 | } |
| 8358 | |
| 8359 | template<> inline const tflite::LSHProjectionOptions *Operator::builtin_options_as<tflite::LSHProjectionOptions>() const { |
| 8360 | return builtin_options_as_LSHProjectionOptions(); |
| 8361 | } |
| 8362 | |
| 8363 | template<> inline const tflite::Pool2DOptions *Operator::builtin_options_as<tflite::Pool2DOptions>() const { |
| 8364 | return builtin_options_as_Pool2DOptions(); |
| 8365 | } |
| 8366 | |
| 8367 | template<> inline const tflite::SVDFOptions *Operator::builtin_options_as<tflite::SVDFOptions>() const { |
| 8368 | return builtin_options_as_SVDFOptions(); |
| 8369 | } |
| 8370 | |
| 8371 | template<> inline const tflite::RNNOptions *Operator::builtin_options_as<tflite::RNNOptions>() const { |
| 8372 | return builtin_options_as_RNNOptions(); |
| 8373 | } |
| 8374 | |
| 8375 | template<> inline const tflite::FullyConnectedOptions *Operator::builtin_options_as<tflite::FullyConnectedOptions>() const { |
| 8376 | return builtin_options_as_FullyConnectedOptions(); |
| 8377 | } |
| 8378 | |
| 8379 | template<> inline const tflite::SoftmaxOptions *Operator::builtin_options_as<tflite::SoftmaxOptions>() const { |
| 8380 | return builtin_options_as_SoftmaxOptions(); |
| 8381 | } |
| 8382 | |
| 8383 | template<> inline const tflite::ConcatenationOptions *Operator::builtin_options_as<tflite::ConcatenationOptions>() const { |
| 8384 | return builtin_options_as_ConcatenationOptions(); |
| 8385 | } |
| 8386 | |
| 8387 | template<> inline const tflite::AddOptions *Operator::builtin_options_as<tflite::AddOptions>() const { |
| 8388 | return builtin_options_as_AddOptions(); |
| 8389 | } |
| 8390 | |
| 8391 | template<> inline const tflite::L2NormOptions *Operator::builtin_options_as<tflite::L2NormOptions>() const { |
| 8392 | return builtin_options_as_L2NormOptions(); |
| 8393 | } |
| 8394 | |
| 8395 | template<> inline const tflite::LocalResponseNormalizationOptions *Operator::builtin_options_as<tflite::LocalResponseNormalizationOptions>() const { |
| 8396 | return builtin_options_as_LocalResponseNormalizationOptions(); |
| 8397 | } |
| 8398 | |
| 8399 | template<> inline const tflite::LSTMOptions *Operator::builtin_options_as<tflite::LSTMOptions>() const { |
| 8400 | return builtin_options_as_LSTMOptions(); |
| 8401 | } |
| 8402 | |
| 8403 | template<> inline const tflite::ResizeBilinearOptions *Operator::builtin_options_as<tflite::ResizeBilinearOptions>() const { |
| 8404 | return builtin_options_as_ResizeBilinearOptions(); |
| 8405 | } |
| 8406 | |
| 8407 | template<> inline const tflite::CallOptions *Operator::builtin_options_as<tflite::CallOptions>() const { |
| 8408 | return builtin_options_as_CallOptions(); |
| 8409 | } |
| 8410 | |
| 8411 | template<> inline const tflite::ReshapeOptions *Operator::builtin_options_as<tflite::ReshapeOptions>() const { |
| 8412 | return builtin_options_as_ReshapeOptions(); |
| 8413 | } |
| 8414 | |
| 8415 | template<> inline const tflite::SkipGramOptions *Operator::builtin_options_as<tflite::SkipGramOptions>() const { |
| 8416 | return builtin_options_as_SkipGramOptions(); |
| 8417 | } |
| 8418 | |
| 8419 | template<> inline const tflite::SpaceToDepthOptions *Operator::builtin_options_as<tflite::SpaceToDepthOptions>() const { |
| 8420 | return builtin_options_as_SpaceToDepthOptions(); |
| 8421 | } |
| 8422 | |
| 8423 | template<> inline const tflite::EmbeddingLookupSparseOptions *Operator::builtin_options_as<tflite::EmbeddingLookupSparseOptions>() const { |
| 8424 | return builtin_options_as_EmbeddingLookupSparseOptions(); |
| 8425 | } |
| 8426 | |
| 8427 | template<> inline const tflite::MulOptions *Operator::builtin_options_as<tflite::MulOptions>() const { |
| 8428 | return builtin_options_as_MulOptions(); |
| 8429 | } |
| 8430 | |
| 8431 | template<> inline const tflite::PadOptions *Operator::builtin_options_as<tflite::PadOptions>() const { |
| 8432 | return builtin_options_as_PadOptions(); |
| 8433 | } |
| 8434 | |
| 8435 | template<> inline const tflite::GatherOptions *Operator::builtin_options_as<tflite::GatherOptions>() const { |
| 8436 | return builtin_options_as_GatherOptions(); |
| 8437 | } |
| 8438 | |
| 8439 | template<> inline const tflite::BatchToSpaceNDOptions *Operator::builtin_options_as<tflite::BatchToSpaceNDOptions>() const { |
| 8440 | return builtin_options_as_BatchToSpaceNDOptions(); |
| 8441 | } |
| 8442 | |
| 8443 | template<> inline const tflite::SpaceToBatchNDOptions *Operator::builtin_options_as<tflite::SpaceToBatchNDOptions>() const { |
| 8444 | return builtin_options_as_SpaceToBatchNDOptions(); |
| 8445 | } |
| 8446 | |
| 8447 | template<> inline const tflite::TransposeOptions *Operator::builtin_options_as<tflite::TransposeOptions>() const { |
| 8448 | return builtin_options_as_TransposeOptions(); |
| 8449 | } |
| 8450 | |
| 8451 | template<> inline const tflite::ReducerOptions *Operator::builtin_options_as<tflite::ReducerOptions>() const { |
| 8452 | return builtin_options_as_ReducerOptions(); |
| 8453 | } |
| 8454 | |
| 8455 | template<> inline const tflite::SubOptions *Operator::builtin_options_as<tflite::SubOptions>() const { |
| 8456 | return builtin_options_as_SubOptions(); |
| 8457 | } |
| 8458 | |
| 8459 | template<> inline const tflite::DivOptions *Operator::builtin_options_as<tflite::DivOptions>() const { |
| 8460 | return builtin_options_as_DivOptions(); |
| 8461 | } |
| 8462 | |
| 8463 | template<> inline const tflite::SqueezeOptions *Operator::builtin_options_as<tflite::SqueezeOptions>() const { |
| 8464 | return builtin_options_as_SqueezeOptions(); |
| 8465 | } |
| 8466 | |
| 8467 | template<> inline const tflite::SequenceRNNOptions *Operator::builtin_options_as<tflite::SequenceRNNOptions>() const { |
| 8468 | return builtin_options_as_SequenceRNNOptions(); |
| 8469 | } |
| 8470 | |
| 8471 | template<> inline const tflite::StridedSliceOptions *Operator::builtin_options_as<tflite::StridedSliceOptions>() const { |
| 8472 | return builtin_options_as_StridedSliceOptions(); |
| 8473 | } |
| 8474 | |
| 8475 | template<> inline const tflite::ExpOptions *Operator::builtin_options_as<tflite::ExpOptions>() const { |
| 8476 | return builtin_options_as_ExpOptions(); |
| 8477 | } |
| 8478 | |
| 8479 | template<> inline const tflite::TopKV2Options *Operator::builtin_options_as<tflite::TopKV2Options>() const { |
| 8480 | return builtin_options_as_TopKV2Options(); |
| 8481 | } |
| 8482 | |
| 8483 | template<> inline const tflite::SplitOptions *Operator::builtin_options_as<tflite::SplitOptions>() const { |
| 8484 | return builtin_options_as_SplitOptions(); |
| 8485 | } |
| 8486 | |
| 8487 | template<> inline const tflite::LogSoftmaxOptions *Operator::builtin_options_as<tflite::LogSoftmaxOptions>() const { |
| 8488 | return builtin_options_as_LogSoftmaxOptions(); |
| 8489 | } |
| 8490 | |
| 8491 | template<> inline const tflite::CastOptions *Operator::builtin_options_as<tflite::CastOptions>() const { |
| 8492 | return builtin_options_as_CastOptions(); |
| 8493 | } |
| 8494 | |
| 8495 | template<> inline const tflite::DequantizeOptions *Operator::builtin_options_as<tflite::DequantizeOptions>() const { |
| 8496 | return builtin_options_as_DequantizeOptions(); |
| 8497 | } |
| 8498 | |
| 8499 | template<> inline const tflite::MaximumMinimumOptions *Operator::builtin_options_as<tflite::MaximumMinimumOptions>() const { |
| 8500 | return builtin_options_as_MaximumMinimumOptions(); |
| 8501 | } |
| 8502 | |
| 8503 | template<> inline const tflite::ArgMaxOptions *Operator::builtin_options_as<tflite::ArgMaxOptions>() const { |
| 8504 | return builtin_options_as_ArgMaxOptions(); |
| 8505 | } |
| 8506 | |
| 8507 | template<> inline const tflite::LessOptions *Operator::builtin_options_as<tflite::LessOptions>() const { |
| 8508 | return builtin_options_as_LessOptions(); |
| 8509 | } |
| 8510 | |
| 8511 | template<> inline const tflite::NegOptions *Operator::builtin_options_as<tflite::NegOptions>() const { |
| 8512 | return builtin_options_as_NegOptions(); |
| 8513 | } |
| 8514 | |
| 8515 | template<> inline const tflite::PadV2Options *Operator::builtin_options_as<tflite::PadV2Options>() const { |
| 8516 | return builtin_options_as_PadV2Options(); |
| 8517 | } |
| 8518 | |
| 8519 | template<> inline const tflite::GreaterOptions *Operator::builtin_options_as<tflite::GreaterOptions>() const { |
| 8520 | return builtin_options_as_GreaterOptions(); |
| 8521 | } |
| 8522 | |
| 8523 | template<> inline const tflite::GreaterEqualOptions *Operator::builtin_options_as<tflite::GreaterEqualOptions>() const { |
| 8524 | return builtin_options_as_GreaterEqualOptions(); |
| 8525 | } |
| 8526 | |
| 8527 | template<> inline const tflite::LessEqualOptions *Operator::builtin_options_as<tflite::LessEqualOptions>() const { |
| 8528 | return builtin_options_as_LessEqualOptions(); |
| 8529 | } |
| 8530 | |
| 8531 | template<> inline const tflite::SelectOptions *Operator::builtin_options_as<tflite::SelectOptions>() const { |
| 8532 | return builtin_options_as_SelectOptions(); |
| 8533 | } |
| 8534 | |
| 8535 | template<> inline const tflite::SliceOptions *Operator::builtin_options_as<tflite::SliceOptions>() const { |
| 8536 | return builtin_options_as_SliceOptions(); |
| 8537 | } |
| 8538 | |
| 8539 | template<> inline const tflite::TransposeConvOptions *Operator::builtin_options_as<tflite::TransposeConvOptions>() const { |
| 8540 | return builtin_options_as_TransposeConvOptions(); |
| 8541 | } |
| 8542 | |
| 8543 | template<> inline const tflite::SparseToDenseOptions *Operator::builtin_options_as<tflite::SparseToDenseOptions>() const { |
| 8544 | return builtin_options_as_SparseToDenseOptions(); |
| 8545 | } |
| 8546 | |
| 8547 | template<> inline const tflite::TileOptions *Operator::builtin_options_as<tflite::TileOptions>() const { |
| 8548 | return builtin_options_as_TileOptions(); |
| 8549 | } |
| 8550 | |
| 8551 | template<> inline const tflite::ExpandDimsOptions *Operator::builtin_options_as<tflite::ExpandDimsOptions>() const { |
| 8552 | return builtin_options_as_ExpandDimsOptions(); |
| 8553 | } |
| 8554 | |
| 8555 | template<> inline const tflite::EqualOptions *Operator::builtin_options_as<tflite::EqualOptions>() const { |
| 8556 | return builtin_options_as_EqualOptions(); |
| 8557 | } |
| 8558 | |
| 8559 | template<> inline const tflite::NotEqualOptions *Operator::builtin_options_as<tflite::NotEqualOptions>() const { |
| 8560 | return builtin_options_as_NotEqualOptions(); |
| 8561 | } |
| 8562 | |
| 8563 | template<> inline const tflite::ShapeOptions *Operator::builtin_options_as<tflite::ShapeOptions>() const { |
| 8564 | return builtin_options_as_ShapeOptions(); |
| 8565 | } |
| 8566 | |
| 8567 | template<> inline const tflite::PowOptions *Operator::builtin_options_as<tflite::PowOptions>() const { |
| 8568 | return builtin_options_as_PowOptions(); |
| 8569 | } |
| 8570 | |
| 8571 | template<> inline const tflite::ArgMinOptions *Operator::builtin_options_as<tflite::ArgMinOptions>() const { |
| 8572 | return builtin_options_as_ArgMinOptions(); |
| 8573 | } |
| 8574 | |
| 8575 | template<> inline const tflite::FakeQuantOptions *Operator::builtin_options_as<tflite::FakeQuantOptions>() const { |
| 8576 | return builtin_options_as_FakeQuantOptions(); |
| 8577 | } |
| 8578 | |
| 8579 | template<> inline const tflite::PackOptions *Operator::builtin_options_as<tflite::PackOptions>() const { |
| 8580 | return builtin_options_as_PackOptions(); |
| 8581 | } |
| 8582 | |
| 8583 | template<> inline const tflite::LogicalOrOptions *Operator::builtin_options_as<tflite::LogicalOrOptions>() const { |
| 8584 | return builtin_options_as_LogicalOrOptions(); |
| 8585 | } |
| 8586 | |
| 8587 | template<> inline const tflite::OneHotOptions *Operator::builtin_options_as<tflite::OneHotOptions>() const { |
| 8588 | return builtin_options_as_OneHotOptions(); |
| 8589 | } |
| 8590 | |
| 8591 | template<> inline const tflite::LogicalAndOptions *Operator::builtin_options_as<tflite::LogicalAndOptions>() const { |
| 8592 | return builtin_options_as_LogicalAndOptions(); |
| 8593 | } |
| 8594 | |
| 8595 | template<> inline const tflite::LogicalNotOptions *Operator::builtin_options_as<tflite::LogicalNotOptions>() const { |
| 8596 | return builtin_options_as_LogicalNotOptions(); |
| 8597 | } |
| 8598 | |
| 8599 | template<> inline const tflite::UnpackOptions *Operator::builtin_options_as<tflite::UnpackOptions>() const { |
| 8600 | return builtin_options_as_UnpackOptions(); |
| 8601 | } |
| 8602 | |
| 8603 | template<> inline const tflite::FloorDivOptions *Operator::builtin_options_as<tflite::FloorDivOptions>() const { |
| 8604 | return builtin_options_as_FloorDivOptions(); |
| 8605 | } |
| 8606 | |
| 8607 | template<> inline const tflite::SquareOptions *Operator::builtin_options_as<tflite::SquareOptions>() const { |
| 8608 | return builtin_options_as_SquareOptions(); |
| 8609 | } |
| 8610 | |
| 8611 | template<> inline const tflite::ZerosLikeOptions *Operator::builtin_options_as<tflite::ZerosLikeOptions>() const { |
| 8612 | return builtin_options_as_ZerosLikeOptions(); |
| 8613 | } |
| 8614 | |
| 8615 | template<> inline const tflite::FillOptions *Operator::builtin_options_as<tflite::FillOptions>() const { |
| 8616 | return builtin_options_as_FillOptions(); |
| 8617 | } |
| 8618 | |
| 8619 | template<> inline const tflite::BidirectionalSequenceLSTMOptions *Operator::builtin_options_as<tflite::BidirectionalSequenceLSTMOptions>() const { |
| 8620 | return builtin_options_as_BidirectionalSequenceLSTMOptions(); |
| 8621 | } |
| 8622 | |
| 8623 | template<> inline const tflite::BidirectionalSequenceRNNOptions *Operator::builtin_options_as<tflite::BidirectionalSequenceRNNOptions>() const { |
| 8624 | return builtin_options_as_BidirectionalSequenceRNNOptions(); |
| 8625 | } |
| 8626 | |
| 8627 | template<> inline const tflite::UnidirectionalSequenceLSTMOptions *Operator::builtin_options_as<tflite::UnidirectionalSequenceLSTMOptions>() const { |
| 8628 | return builtin_options_as_UnidirectionalSequenceLSTMOptions(); |
| 8629 | } |
| 8630 | |
| 8631 | template<> inline const tflite::FloorModOptions *Operator::builtin_options_as<tflite::FloorModOptions>() const { |
| 8632 | return builtin_options_as_FloorModOptions(); |
| 8633 | } |
| 8634 | |
| 8635 | template<> inline const tflite::RangeOptions *Operator::builtin_options_as<tflite::RangeOptions>() const { |
| 8636 | return builtin_options_as_RangeOptions(); |
| 8637 | } |
| 8638 | |
| 8639 | template<> inline const tflite::ResizeNearestNeighborOptions *Operator::builtin_options_as<tflite::ResizeNearestNeighborOptions>() const { |
| 8640 | return builtin_options_as_ResizeNearestNeighborOptions(); |
| 8641 | } |
| 8642 | |
| 8643 | template<> inline const tflite::LeakyReluOptions *Operator::builtin_options_as<tflite::LeakyReluOptions>() const { |
| 8644 | return builtin_options_as_LeakyReluOptions(); |
| 8645 | } |
| 8646 | |
| 8647 | template<> inline const tflite::SquaredDifferenceOptions *Operator::builtin_options_as<tflite::SquaredDifferenceOptions>() const { |
| 8648 | return builtin_options_as_SquaredDifferenceOptions(); |
| 8649 | } |
| 8650 | |
| 8651 | template<> inline const tflite::MirrorPadOptions *Operator::builtin_options_as<tflite::MirrorPadOptions>() const { |
| 8652 | return builtin_options_as_MirrorPadOptions(); |
| 8653 | } |
| 8654 | |
| 8655 | template<> inline const tflite::AbsOptions *Operator::builtin_options_as<tflite::AbsOptions>() const { |
| 8656 | return builtin_options_as_AbsOptions(); |
| 8657 | } |
| 8658 | |
| 8659 | template<> inline const tflite::SplitVOptions *Operator::builtin_options_as<tflite::SplitVOptions>() const { |
| 8660 | return builtin_options_as_SplitVOptions(); |
| 8661 | } |
| 8662 | |
| 8663 | template<> inline const tflite::UniqueOptions *Operator::builtin_options_as<tflite::UniqueOptions>() const { |
| 8664 | return builtin_options_as_UniqueOptions(); |
| 8665 | } |
| 8666 | |
| 8667 | template<> inline const tflite::ReverseV2Options *Operator::builtin_options_as<tflite::ReverseV2Options>() const { |
| 8668 | return builtin_options_as_ReverseV2Options(); |
| 8669 | } |
| 8670 | |
| 8671 | template<> inline const tflite::AddNOptions *Operator::builtin_options_as<tflite::AddNOptions>() const { |
| 8672 | return builtin_options_as_AddNOptions(); |
| 8673 | } |
| 8674 | |
| 8675 | template<> inline const tflite::GatherNdOptions *Operator::builtin_options_as<tflite::GatherNdOptions>() const { |
| 8676 | return builtin_options_as_GatherNdOptions(); |
| 8677 | } |
| 8678 | |
| 8679 | template<> inline const tflite::CosOptions *Operator::builtin_options_as<tflite::CosOptions>() const { |
| 8680 | return builtin_options_as_CosOptions(); |
| 8681 | } |
| 8682 | |
| 8683 | template<> inline const tflite::WhereOptions *Operator::builtin_options_as<tflite::WhereOptions>() const { |
| 8684 | return builtin_options_as_WhereOptions(); |
| 8685 | } |
| 8686 | |
| 8687 | template<> inline const tflite::RankOptions *Operator::builtin_options_as<tflite::RankOptions>() const { |
| 8688 | return builtin_options_as_RankOptions(); |
| 8689 | } |
| 8690 | |
| 8691 | template<> inline const tflite::ReverseSequenceOptions *Operator::builtin_options_as<tflite::ReverseSequenceOptions>() const { |
| 8692 | return builtin_options_as_ReverseSequenceOptions(); |
| 8693 | } |
| 8694 | |
| 8695 | template<> inline const tflite::MatrixDiagOptions *Operator::builtin_options_as<tflite::MatrixDiagOptions>() const { |
| 8696 | return builtin_options_as_MatrixDiagOptions(); |
| 8697 | } |
| 8698 | |
| 8699 | template<> inline const tflite::QuantizeOptions *Operator::builtin_options_as<tflite::QuantizeOptions>() const { |
| 8700 | return builtin_options_as_QuantizeOptions(); |
| 8701 | } |
| 8702 | |
| 8703 | template<> inline const tflite::MatrixSetDiagOptions *Operator::builtin_options_as<tflite::MatrixSetDiagOptions>() const { |
| 8704 | return builtin_options_as_MatrixSetDiagOptions(); |
| 8705 | } |
| 8706 | |
| 8707 | template<> inline const tflite::HardSwishOptions *Operator::builtin_options_as<tflite::HardSwishOptions>() const { |
| 8708 | return builtin_options_as_HardSwishOptions(); |
| 8709 | } |
| 8710 | |
| 8711 | template<> inline const tflite::IfOptions *Operator::builtin_options_as<tflite::IfOptions>() const { |
| 8712 | return builtin_options_as_IfOptions(); |
| 8713 | } |
| 8714 | |
| 8715 | template<> inline const tflite::WhileOptions *Operator::builtin_options_as<tflite::WhileOptions>() const { |
| 8716 | return builtin_options_as_WhileOptions(); |
| 8717 | } |
| 8718 | |
| 8719 | template<> inline const tflite::DepthToSpaceOptions *Operator::builtin_options_as<tflite::DepthToSpaceOptions>() const { |
| 8720 | return builtin_options_as_DepthToSpaceOptions(); |
| 8721 | } |
| 8722 | |
| 8723 | template<> inline const tflite::NonMaxSuppressionV4Options *Operator::builtin_options_as<tflite::NonMaxSuppressionV4Options>() const { |
| 8724 | return builtin_options_as_NonMaxSuppressionV4Options(); |
| 8725 | } |
| 8726 | |
| 8727 | template<> inline const tflite::NonMaxSuppressionV5Options *Operator::builtin_options_as<tflite::NonMaxSuppressionV5Options>() const { |
| 8728 | return builtin_options_as_NonMaxSuppressionV5Options(); |
| 8729 | } |
| 8730 | |
| 8731 | template<> inline const tflite::ScatterNdOptions *Operator::builtin_options_as<tflite::ScatterNdOptions>() const { |
| 8732 | return builtin_options_as_ScatterNdOptions(); |
| 8733 | } |
| 8734 | |
| 8735 | template<> inline const tflite::SelectV2Options *Operator::builtin_options_as<tflite::SelectV2Options>() const { |
| 8736 | return builtin_options_as_SelectV2Options(); |
| 8737 | } |
| 8738 | |
| 8739 | template<> inline const tflite::DensifyOptions *Operator::builtin_options_as<tflite::DensifyOptions>() const { |
| 8740 | return builtin_options_as_DensifyOptions(); |
| 8741 | } |
| 8742 | |
| 8743 | template<> inline const tflite::SegmentSumOptions *Operator::builtin_options_as<tflite::SegmentSumOptions>() const { |
| 8744 | return builtin_options_as_SegmentSumOptions(); |
| 8745 | } |
| 8746 | |
| 8747 | template<> inline const tflite::BatchMatMulOptions *Operator::builtin_options_as<tflite::BatchMatMulOptions>() const { |
| 8748 | return builtin_options_as_BatchMatMulOptions(); |
| 8749 | } |
| 8750 | |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 8751 | template<> inline const tflite::CumsumOptions *Operator::builtin_options_as<tflite::CumsumOptions>() const { |
| 8752 | return builtin_options_as_CumsumOptions(); |
| 8753 | } |
| 8754 | |
| 8755 | template<> inline const tflite::CallOnceOptions *Operator::builtin_options_as<tflite::CallOnceOptions>() const { |
| 8756 | return builtin_options_as_CallOnceOptions(); |
| 8757 | } |
| 8758 | |
| 8759 | template<> inline const tflite::BroadcastToOptions *Operator::builtin_options_as<tflite::BroadcastToOptions>() const { |
| 8760 | return builtin_options_as_BroadcastToOptions(); |
| 8761 | } |
| 8762 | |
| 8763 | template<> inline const tflite::Rfft2dOptions *Operator::builtin_options_as<tflite::Rfft2dOptions>() const { |
| 8764 | return builtin_options_as_Rfft2dOptions(); |
| 8765 | } |
| 8766 | |
| 8767 | template<> inline const tflite::Conv3DOptions *Operator::builtin_options_as<tflite::Conv3DOptions>() const { |
| 8768 | return builtin_options_as_Conv3DOptions(); |
| 8769 | } |
| 8770 | |
| 8771 | template<> inline const tflite::HashtableOptions *Operator::builtin_options_as<tflite::HashtableOptions>() const { |
| 8772 | return builtin_options_as_HashtableOptions(); |
| 8773 | } |
| 8774 | |
| 8775 | template<> inline const tflite::HashtableFindOptions *Operator::builtin_options_as<tflite::HashtableFindOptions>() const { |
| 8776 | return builtin_options_as_HashtableFindOptions(); |
| 8777 | } |
| 8778 | |
| 8779 | template<> inline const tflite::HashtableImportOptions *Operator::builtin_options_as<tflite::HashtableImportOptions>() const { |
| 8780 | return builtin_options_as_HashtableImportOptions(); |
| 8781 | } |
| 8782 | |
| 8783 | template<> inline const tflite::HashtableSizeOptions *Operator::builtin_options_as<tflite::HashtableSizeOptions>() const { |
| 8784 | return builtin_options_as_HashtableSizeOptions(); |
| 8785 | } |
| 8786 | |
| 8787 | template<> inline const tflite::VarHandleOptions *Operator::builtin_options_as<tflite::VarHandleOptions>() const { |
| 8788 | return builtin_options_as_VarHandleOptions(); |
| 8789 | } |
| 8790 | |
| 8791 | template<> inline const tflite::ReadVariableOptions *Operator::builtin_options_as<tflite::ReadVariableOptions>() const { |
| 8792 | return builtin_options_as_ReadVariableOptions(); |
| 8793 | } |
| 8794 | |
| 8795 | template<> inline const tflite::AssignVariableOptions *Operator::builtin_options_as<tflite::AssignVariableOptions>() const { |
| 8796 | return builtin_options_as_AssignVariableOptions(); |
| 8797 | } |
| 8798 | |
| 8799 | template<> inline const tflite::RandomOptions *Operator::builtin_options_as<tflite::RandomOptions>() const { |
| 8800 | return builtin_options_as_RandomOptions(); |
| 8801 | } |
| 8802 | |
| 8803 | template<> inline const tflite::BucketizeOptions *Operator::builtin_options_as<tflite::BucketizeOptions>() const { |
| 8804 | return builtin_options_as_BucketizeOptions(); |
| 8805 | } |
| 8806 | |
| 8807 | template<> inline const tflite::GeluOptions *Operator::builtin_options_as<tflite::GeluOptions>() const { |
| 8808 | return builtin_options_as_GeluOptions(); |
| 8809 | } |
| 8810 | |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 8811 | struct OperatorBuilder { |
| 8812 | typedef Operator Table; |
| 8813 | flatbuffers::FlatBufferBuilder &fbb_; |
| 8814 | flatbuffers::uoffset_t start_; |
| 8815 | void add_opcode_index(uint32_t opcode_index) { |
| 8816 | fbb_.AddElement<uint32_t>(Operator::VT_OPCODE_INDEX, opcode_index, 0); |
| 8817 | } |
| 8818 | void add_inputs(flatbuffers::Offset<flatbuffers::Vector<int32_t>> inputs) { |
| 8819 | fbb_.AddOffset(Operator::VT_INPUTS, inputs); |
| 8820 | } |
| 8821 | void add_outputs(flatbuffers::Offset<flatbuffers::Vector<int32_t>> outputs) { |
| 8822 | fbb_.AddOffset(Operator::VT_OUTPUTS, outputs); |
| 8823 | } |
| 8824 | void add_builtin_options_type(tflite::BuiltinOptions builtin_options_type) { |
| 8825 | fbb_.AddElement<uint8_t>(Operator::VT_BUILTIN_OPTIONS_TYPE, static_cast<uint8_t>(builtin_options_type), 0); |
| 8826 | } |
| 8827 | void add_builtin_options(flatbuffers::Offset<void> builtin_options) { |
| 8828 | fbb_.AddOffset(Operator::VT_BUILTIN_OPTIONS, builtin_options); |
| 8829 | } |
| 8830 | void add_custom_options(flatbuffers::Offset<flatbuffers::Vector<uint8_t>> custom_options) { |
| 8831 | fbb_.AddOffset(Operator::VT_CUSTOM_OPTIONS, custom_options); |
| 8832 | } |
| 8833 | void add_custom_options_format(tflite::CustomOptionsFormat custom_options_format) { |
| 8834 | fbb_.AddElement<int8_t>(Operator::VT_CUSTOM_OPTIONS_FORMAT, static_cast<int8_t>(custom_options_format), 0); |
| 8835 | } |
| 8836 | void add_mutating_variable_inputs(flatbuffers::Offset<flatbuffers::Vector<uint8_t>> mutating_variable_inputs) { |
| 8837 | fbb_.AddOffset(Operator::VT_MUTATING_VARIABLE_INPUTS, mutating_variable_inputs); |
| 8838 | } |
| 8839 | void add_intermediates(flatbuffers::Offset<flatbuffers::Vector<int32_t>> intermediates) { |
| 8840 | fbb_.AddOffset(Operator::VT_INTERMEDIATES, intermediates); |
| 8841 | } |
| 8842 | explicit OperatorBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 8843 | : fbb_(_fbb) { |
| 8844 | start_ = fbb_.StartTable(); |
| 8845 | } |
| 8846 | flatbuffers::Offset<Operator> Finish() { |
| 8847 | const auto end = fbb_.EndTable(start_); |
| 8848 | auto o = flatbuffers::Offset<Operator>(end); |
| 8849 | return o; |
| 8850 | } |
| 8851 | }; |
| 8852 | |
| 8853 | inline flatbuffers::Offset<Operator> CreateOperator( |
| 8854 | flatbuffers::FlatBufferBuilder &_fbb, |
| 8855 | uint32_t opcode_index = 0, |
| 8856 | flatbuffers::Offset<flatbuffers::Vector<int32_t>> inputs = 0, |
| 8857 | flatbuffers::Offset<flatbuffers::Vector<int32_t>> outputs = 0, |
| 8858 | tflite::BuiltinOptions builtin_options_type = tflite::BuiltinOptions_NONE, |
| 8859 | flatbuffers::Offset<void> builtin_options = 0, |
| 8860 | flatbuffers::Offset<flatbuffers::Vector<uint8_t>> custom_options = 0, |
| 8861 | tflite::CustomOptionsFormat custom_options_format = tflite::CustomOptionsFormat_FLEXBUFFERS, |
| 8862 | flatbuffers::Offset<flatbuffers::Vector<uint8_t>> mutating_variable_inputs = 0, |
| 8863 | flatbuffers::Offset<flatbuffers::Vector<int32_t>> intermediates = 0) { |
| 8864 | OperatorBuilder builder_(_fbb); |
| 8865 | builder_.add_intermediates(intermediates); |
| 8866 | builder_.add_mutating_variable_inputs(mutating_variable_inputs); |
| 8867 | builder_.add_custom_options(custom_options); |
| 8868 | builder_.add_builtin_options(builtin_options); |
| 8869 | builder_.add_outputs(outputs); |
| 8870 | builder_.add_inputs(inputs); |
| 8871 | builder_.add_opcode_index(opcode_index); |
| 8872 | builder_.add_custom_options_format(custom_options_format); |
| 8873 | builder_.add_builtin_options_type(builtin_options_type); |
| 8874 | return builder_.Finish(); |
| 8875 | } |
| 8876 | |
| 8877 | inline flatbuffers::Offset<Operator> CreateOperatorDirect( |
| 8878 | flatbuffers::FlatBufferBuilder &_fbb, |
| 8879 | uint32_t opcode_index = 0, |
| 8880 | const std::vector<int32_t> *inputs = nullptr, |
| 8881 | const std::vector<int32_t> *outputs = nullptr, |
| 8882 | tflite::BuiltinOptions builtin_options_type = tflite::BuiltinOptions_NONE, |
| 8883 | flatbuffers::Offset<void> builtin_options = 0, |
| 8884 | const std::vector<uint8_t> *custom_options = nullptr, |
| 8885 | tflite::CustomOptionsFormat custom_options_format = tflite::CustomOptionsFormat_FLEXBUFFERS, |
| 8886 | const std::vector<uint8_t> *mutating_variable_inputs = nullptr, |
| 8887 | const std::vector<int32_t> *intermediates = nullptr) { |
| 8888 | auto inputs__ = inputs ? _fbb.CreateVector<int32_t>(*inputs) : 0; |
| 8889 | auto outputs__ = outputs ? _fbb.CreateVector<int32_t>(*outputs) : 0; |
| 8890 | auto custom_options__ = custom_options ? _fbb.CreateVector<uint8_t>(*custom_options) : 0; |
| 8891 | auto mutating_variable_inputs__ = mutating_variable_inputs ? _fbb.CreateVector<uint8_t>(*mutating_variable_inputs) : 0; |
| 8892 | auto intermediates__ = intermediates ? _fbb.CreateVector<int32_t>(*intermediates) : 0; |
| 8893 | return tflite::CreateOperator( |
| 8894 | _fbb, |
| 8895 | opcode_index, |
| 8896 | inputs__, |
| 8897 | outputs__, |
| 8898 | builtin_options_type, |
| 8899 | builtin_options, |
| 8900 | custom_options__, |
| 8901 | custom_options_format, |
| 8902 | mutating_variable_inputs__, |
| 8903 | intermediates__); |
| 8904 | } |
| 8905 | |
| 8906 | struct SubGraph FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 8907 | typedef SubGraphBuilder Builder; |
| 8908 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 8909 | VT_TENSORS = 4, |
| 8910 | VT_INPUTS = 6, |
| 8911 | VT_OUTPUTS = 8, |
| 8912 | VT_OPERATORS = 10, |
| 8913 | VT_NAME = 12 |
| 8914 | }; |
| 8915 | const flatbuffers::Vector<flatbuffers::Offset<tflite::Tensor>> *tensors() const { |
| 8916 | return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<tflite::Tensor>> *>(VT_TENSORS); |
| 8917 | } |
| 8918 | const flatbuffers::Vector<int32_t> *inputs() const { |
| 8919 | return GetPointer<const flatbuffers::Vector<int32_t> *>(VT_INPUTS); |
| 8920 | } |
| 8921 | const flatbuffers::Vector<int32_t> *outputs() const { |
| 8922 | return GetPointer<const flatbuffers::Vector<int32_t> *>(VT_OUTPUTS); |
| 8923 | } |
| 8924 | const flatbuffers::Vector<flatbuffers::Offset<tflite::Operator>> *operators() const { |
| 8925 | return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<tflite::Operator>> *>(VT_OPERATORS); |
| 8926 | } |
| 8927 | const flatbuffers::String *name() const { |
| 8928 | return GetPointer<const flatbuffers::String *>(VT_NAME); |
| 8929 | } |
| 8930 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 8931 | return VerifyTableStart(verifier) && |
| 8932 | VerifyOffset(verifier, VT_TENSORS) && |
| 8933 | verifier.VerifyVector(tensors()) && |
| 8934 | verifier.VerifyVectorOfTables(tensors()) && |
| 8935 | VerifyOffset(verifier, VT_INPUTS) && |
| 8936 | verifier.VerifyVector(inputs()) && |
| 8937 | VerifyOffset(verifier, VT_OUTPUTS) && |
| 8938 | verifier.VerifyVector(outputs()) && |
| 8939 | VerifyOffset(verifier, VT_OPERATORS) && |
| 8940 | verifier.VerifyVector(operators()) && |
| 8941 | verifier.VerifyVectorOfTables(operators()) && |
| 8942 | VerifyOffset(verifier, VT_NAME) && |
| 8943 | verifier.VerifyString(name()) && |
| 8944 | verifier.EndTable(); |
| 8945 | } |
| 8946 | }; |
| 8947 | |
| 8948 | struct SubGraphBuilder { |
| 8949 | typedef SubGraph Table; |
| 8950 | flatbuffers::FlatBufferBuilder &fbb_; |
| 8951 | flatbuffers::uoffset_t start_; |
| 8952 | void add_tensors(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::Tensor>>> tensors) { |
| 8953 | fbb_.AddOffset(SubGraph::VT_TENSORS, tensors); |
| 8954 | } |
| 8955 | void add_inputs(flatbuffers::Offset<flatbuffers::Vector<int32_t>> inputs) { |
| 8956 | fbb_.AddOffset(SubGraph::VT_INPUTS, inputs); |
| 8957 | } |
| 8958 | void add_outputs(flatbuffers::Offset<flatbuffers::Vector<int32_t>> outputs) { |
| 8959 | fbb_.AddOffset(SubGraph::VT_OUTPUTS, outputs); |
| 8960 | } |
| 8961 | void add_operators(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::Operator>>> operators) { |
| 8962 | fbb_.AddOffset(SubGraph::VT_OPERATORS, operators); |
| 8963 | } |
| 8964 | void add_name(flatbuffers::Offset<flatbuffers::String> name) { |
| 8965 | fbb_.AddOffset(SubGraph::VT_NAME, name); |
| 8966 | } |
| 8967 | explicit SubGraphBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 8968 | : fbb_(_fbb) { |
| 8969 | start_ = fbb_.StartTable(); |
| 8970 | } |
| 8971 | flatbuffers::Offset<SubGraph> Finish() { |
| 8972 | const auto end = fbb_.EndTable(start_); |
| 8973 | auto o = flatbuffers::Offset<SubGraph>(end); |
| 8974 | return o; |
| 8975 | } |
| 8976 | }; |
| 8977 | |
| 8978 | inline flatbuffers::Offset<SubGraph> CreateSubGraph( |
| 8979 | flatbuffers::FlatBufferBuilder &_fbb, |
| 8980 | flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::Tensor>>> tensors = 0, |
| 8981 | flatbuffers::Offset<flatbuffers::Vector<int32_t>> inputs = 0, |
| 8982 | flatbuffers::Offset<flatbuffers::Vector<int32_t>> outputs = 0, |
| 8983 | flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::Operator>>> operators = 0, |
| 8984 | flatbuffers::Offset<flatbuffers::String> name = 0) { |
| 8985 | SubGraphBuilder builder_(_fbb); |
| 8986 | builder_.add_name(name); |
| 8987 | builder_.add_operators(operators); |
| 8988 | builder_.add_outputs(outputs); |
| 8989 | builder_.add_inputs(inputs); |
| 8990 | builder_.add_tensors(tensors); |
| 8991 | return builder_.Finish(); |
| 8992 | } |
| 8993 | |
| 8994 | inline flatbuffers::Offset<SubGraph> CreateSubGraphDirect( |
| 8995 | flatbuffers::FlatBufferBuilder &_fbb, |
| 8996 | const std::vector<flatbuffers::Offset<tflite::Tensor>> *tensors = nullptr, |
| 8997 | const std::vector<int32_t> *inputs = nullptr, |
| 8998 | const std::vector<int32_t> *outputs = nullptr, |
| 8999 | const std::vector<flatbuffers::Offset<tflite::Operator>> *operators = nullptr, |
| 9000 | const char *name = nullptr) { |
| 9001 | auto tensors__ = tensors ? _fbb.CreateVector<flatbuffers::Offset<tflite::Tensor>>(*tensors) : 0; |
| 9002 | auto inputs__ = inputs ? _fbb.CreateVector<int32_t>(*inputs) : 0; |
| 9003 | auto outputs__ = outputs ? _fbb.CreateVector<int32_t>(*outputs) : 0; |
| 9004 | auto operators__ = operators ? _fbb.CreateVector<flatbuffers::Offset<tflite::Operator>>(*operators) : 0; |
| 9005 | auto name__ = name ? _fbb.CreateString(name) : 0; |
| 9006 | return tflite::CreateSubGraph( |
| 9007 | _fbb, |
| 9008 | tensors__, |
| 9009 | inputs__, |
| 9010 | outputs__, |
| 9011 | operators__, |
| 9012 | name__); |
| 9013 | } |
| 9014 | |
| 9015 | struct Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 9016 | typedef BufferBuilder Builder; |
| 9017 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 9018 | VT_DATA = 4 |
| 9019 | }; |
| 9020 | const flatbuffers::Vector<uint8_t> *data() const { |
| 9021 | return GetPointer<const flatbuffers::Vector<uint8_t> *>(VT_DATA); |
| 9022 | } |
| 9023 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 9024 | return VerifyTableStart(verifier) && |
| 9025 | VerifyOffset(verifier, VT_DATA) && |
| 9026 | verifier.VerifyVector(data()) && |
| 9027 | verifier.EndTable(); |
| 9028 | } |
| 9029 | }; |
| 9030 | |
| 9031 | struct BufferBuilder { |
| 9032 | typedef Buffer Table; |
| 9033 | flatbuffers::FlatBufferBuilder &fbb_; |
| 9034 | flatbuffers::uoffset_t start_; |
| 9035 | void add_data(flatbuffers::Offset<flatbuffers::Vector<uint8_t>> data) { |
| 9036 | fbb_.AddOffset(Buffer::VT_DATA, data); |
| 9037 | } |
| 9038 | explicit BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 9039 | : fbb_(_fbb) { |
| 9040 | start_ = fbb_.StartTable(); |
| 9041 | } |
| 9042 | flatbuffers::Offset<Buffer> Finish() { |
| 9043 | const auto end = fbb_.EndTable(start_); |
| 9044 | auto o = flatbuffers::Offset<Buffer>(end); |
| 9045 | return o; |
| 9046 | } |
| 9047 | }; |
| 9048 | |
| 9049 | inline flatbuffers::Offset<Buffer> CreateBuffer( |
| 9050 | flatbuffers::FlatBufferBuilder &_fbb, |
| 9051 | flatbuffers::Offset<flatbuffers::Vector<uint8_t>> data = 0) { |
| 9052 | BufferBuilder builder_(_fbb); |
| 9053 | builder_.add_data(data); |
| 9054 | return builder_.Finish(); |
| 9055 | } |
| 9056 | |
| 9057 | inline flatbuffers::Offset<Buffer> CreateBufferDirect( |
| 9058 | flatbuffers::FlatBufferBuilder &_fbb, |
| 9059 | const std::vector<uint8_t> *data = nullptr) { |
| 9060 | if (data) { _fbb.ForceVectorAlignment(data->size(), sizeof(uint8_t), 16); } |
| 9061 | auto data__ = data ? _fbb.CreateVector<uint8_t>(*data) : 0; |
| 9062 | return tflite::CreateBuffer( |
| 9063 | _fbb, |
| 9064 | data__); |
| 9065 | } |
| 9066 | |
| 9067 | struct Metadata FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 9068 | typedef MetadataBuilder Builder; |
| 9069 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 9070 | VT_NAME = 4, |
| 9071 | VT_BUFFER = 6 |
| 9072 | }; |
| 9073 | const flatbuffers::String *name() const { |
| 9074 | return GetPointer<const flatbuffers::String *>(VT_NAME); |
| 9075 | } |
| 9076 | uint32_t buffer() const { |
| 9077 | return GetField<uint32_t>(VT_BUFFER, 0); |
| 9078 | } |
| 9079 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 9080 | return VerifyTableStart(verifier) && |
| 9081 | VerifyOffset(verifier, VT_NAME) && |
| 9082 | verifier.VerifyString(name()) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 9083 | VerifyField<uint32_t>(verifier, VT_BUFFER, 4) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 9084 | verifier.EndTable(); |
| 9085 | } |
| 9086 | }; |
| 9087 | |
| 9088 | struct MetadataBuilder { |
| 9089 | typedef Metadata Table; |
| 9090 | flatbuffers::FlatBufferBuilder &fbb_; |
| 9091 | flatbuffers::uoffset_t start_; |
| 9092 | void add_name(flatbuffers::Offset<flatbuffers::String> name) { |
| 9093 | fbb_.AddOffset(Metadata::VT_NAME, name); |
| 9094 | } |
| 9095 | void add_buffer(uint32_t buffer) { |
| 9096 | fbb_.AddElement<uint32_t>(Metadata::VT_BUFFER, buffer, 0); |
| 9097 | } |
| 9098 | explicit MetadataBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 9099 | : fbb_(_fbb) { |
| 9100 | start_ = fbb_.StartTable(); |
| 9101 | } |
| 9102 | flatbuffers::Offset<Metadata> Finish() { |
| 9103 | const auto end = fbb_.EndTable(start_); |
| 9104 | auto o = flatbuffers::Offset<Metadata>(end); |
| 9105 | return o; |
| 9106 | } |
| 9107 | }; |
| 9108 | |
| 9109 | inline flatbuffers::Offset<Metadata> CreateMetadata( |
| 9110 | flatbuffers::FlatBufferBuilder &_fbb, |
| 9111 | flatbuffers::Offset<flatbuffers::String> name = 0, |
| 9112 | uint32_t buffer = 0) { |
| 9113 | MetadataBuilder builder_(_fbb); |
| 9114 | builder_.add_buffer(buffer); |
| 9115 | builder_.add_name(name); |
| 9116 | return builder_.Finish(); |
| 9117 | } |
| 9118 | |
| 9119 | inline flatbuffers::Offset<Metadata> CreateMetadataDirect( |
| 9120 | flatbuffers::FlatBufferBuilder &_fbb, |
| 9121 | const char *name = nullptr, |
| 9122 | uint32_t buffer = 0) { |
| 9123 | auto name__ = name ? _fbb.CreateString(name) : 0; |
| 9124 | return tflite::CreateMetadata( |
| 9125 | _fbb, |
| 9126 | name__, |
| 9127 | buffer); |
| 9128 | } |
| 9129 | |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 9130 | struct TensorMap FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 9131 | typedef TensorMapBuilder Builder; |
| 9132 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 9133 | VT_NAME = 4, |
| 9134 | VT_TENSOR_INDEX = 6 |
| 9135 | }; |
| 9136 | const flatbuffers::String *name() const { |
| 9137 | return GetPointer<const flatbuffers::String *>(VT_NAME); |
| 9138 | } |
| 9139 | uint32_t tensor_index() const { |
| 9140 | return GetField<uint32_t>(VT_TENSOR_INDEX, 0); |
| 9141 | } |
| 9142 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 9143 | return VerifyTableStart(verifier) && |
| 9144 | VerifyOffset(verifier, VT_NAME) && |
| 9145 | verifier.VerifyString(name()) && |
| 9146 | VerifyField<uint32_t>(verifier, VT_TENSOR_INDEX, 4) && |
| 9147 | verifier.EndTable(); |
| 9148 | } |
| 9149 | }; |
| 9150 | |
| 9151 | struct TensorMapBuilder { |
| 9152 | typedef TensorMap Table; |
| 9153 | flatbuffers::FlatBufferBuilder &fbb_; |
| 9154 | flatbuffers::uoffset_t start_; |
| 9155 | void add_name(flatbuffers::Offset<flatbuffers::String> name) { |
| 9156 | fbb_.AddOffset(TensorMap::VT_NAME, name); |
| 9157 | } |
| 9158 | void add_tensor_index(uint32_t tensor_index) { |
| 9159 | fbb_.AddElement<uint32_t>(TensorMap::VT_TENSOR_INDEX, tensor_index, 0); |
| 9160 | } |
| 9161 | explicit TensorMapBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 9162 | : fbb_(_fbb) { |
| 9163 | start_ = fbb_.StartTable(); |
| 9164 | } |
| 9165 | flatbuffers::Offset<TensorMap> Finish() { |
| 9166 | const auto end = fbb_.EndTable(start_); |
| 9167 | auto o = flatbuffers::Offset<TensorMap>(end); |
| 9168 | return o; |
| 9169 | } |
| 9170 | }; |
| 9171 | |
| 9172 | inline flatbuffers::Offset<TensorMap> CreateTensorMap( |
| 9173 | flatbuffers::FlatBufferBuilder &_fbb, |
| 9174 | flatbuffers::Offset<flatbuffers::String> name = 0, |
| 9175 | uint32_t tensor_index = 0) { |
| 9176 | TensorMapBuilder builder_(_fbb); |
| 9177 | builder_.add_tensor_index(tensor_index); |
| 9178 | builder_.add_name(name); |
| 9179 | return builder_.Finish(); |
| 9180 | } |
| 9181 | |
| 9182 | inline flatbuffers::Offset<TensorMap> CreateTensorMapDirect( |
| 9183 | flatbuffers::FlatBufferBuilder &_fbb, |
| 9184 | const char *name = nullptr, |
| 9185 | uint32_t tensor_index = 0) { |
| 9186 | auto name__ = name ? _fbb.CreateString(name) : 0; |
| 9187 | return tflite::CreateTensorMap( |
| 9188 | _fbb, |
| 9189 | name__, |
| 9190 | tensor_index); |
| 9191 | } |
| 9192 | |
| 9193 | struct SignatureDef FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 9194 | typedef SignatureDefBuilder Builder; |
| 9195 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 9196 | VT_INPUTS = 4, |
| 9197 | VT_OUTPUTS = 6, |
| 9198 | VT_SIGNATURE_KEY = 8, |
| 9199 | VT_SUBGRAPH_INDEX = 12 |
| 9200 | }; |
| 9201 | const flatbuffers::Vector<flatbuffers::Offset<tflite::TensorMap>> *inputs() const { |
| 9202 | return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<tflite::TensorMap>> *>(VT_INPUTS); |
| 9203 | } |
| 9204 | const flatbuffers::Vector<flatbuffers::Offset<tflite::TensorMap>> *outputs() const { |
| 9205 | return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<tflite::TensorMap>> *>(VT_OUTPUTS); |
| 9206 | } |
| 9207 | const flatbuffers::String *signature_key() const { |
| 9208 | return GetPointer<const flatbuffers::String *>(VT_SIGNATURE_KEY); |
| 9209 | } |
| 9210 | uint32_t subgraph_index() const { |
| 9211 | return GetField<uint32_t>(VT_SUBGRAPH_INDEX, 0); |
| 9212 | } |
| 9213 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 9214 | return VerifyTableStart(verifier) && |
| 9215 | VerifyOffset(verifier, VT_INPUTS) && |
| 9216 | verifier.VerifyVector(inputs()) && |
| 9217 | verifier.VerifyVectorOfTables(inputs()) && |
| 9218 | VerifyOffset(verifier, VT_OUTPUTS) && |
| 9219 | verifier.VerifyVector(outputs()) && |
| 9220 | verifier.VerifyVectorOfTables(outputs()) && |
| 9221 | VerifyOffset(verifier, VT_SIGNATURE_KEY) && |
| 9222 | verifier.VerifyString(signature_key()) && |
| 9223 | VerifyField<uint32_t>(verifier, VT_SUBGRAPH_INDEX, 4) && |
| 9224 | verifier.EndTable(); |
| 9225 | } |
| 9226 | }; |
| 9227 | |
| 9228 | struct SignatureDefBuilder { |
| 9229 | typedef SignatureDef Table; |
| 9230 | flatbuffers::FlatBufferBuilder &fbb_; |
| 9231 | flatbuffers::uoffset_t start_; |
| 9232 | void add_inputs(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::TensorMap>>> inputs) { |
| 9233 | fbb_.AddOffset(SignatureDef::VT_INPUTS, inputs); |
| 9234 | } |
| 9235 | void add_outputs(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::TensorMap>>> outputs) { |
| 9236 | fbb_.AddOffset(SignatureDef::VT_OUTPUTS, outputs); |
| 9237 | } |
| 9238 | void add_signature_key(flatbuffers::Offset<flatbuffers::String> signature_key) { |
| 9239 | fbb_.AddOffset(SignatureDef::VT_SIGNATURE_KEY, signature_key); |
| 9240 | } |
| 9241 | void add_subgraph_index(uint32_t subgraph_index) { |
| 9242 | fbb_.AddElement<uint32_t>(SignatureDef::VT_SUBGRAPH_INDEX, subgraph_index, 0); |
| 9243 | } |
| 9244 | explicit SignatureDefBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 9245 | : fbb_(_fbb) { |
| 9246 | start_ = fbb_.StartTable(); |
| 9247 | } |
| 9248 | flatbuffers::Offset<SignatureDef> Finish() { |
| 9249 | const auto end = fbb_.EndTable(start_); |
| 9250 | auto o = flatbuffers::Offset<SignatureDef>(end); |
| 9251 | return o; |
| 9252 | } |
| 9253 | }; |
| 9254 | |
| 9255 | inline flatbuffers::Offset<SignatureDef> CreateSignatureDef( |
| 9256 | flatbuffers::FlatBufferBuilder &_fbb, |
| 9257 | flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::TensorMap>>> inputs = 0, |
| 9258 | flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::TensorMap>>> outputs = 0, |
| 9259 | flatbuffers::Offset<flatbuffers::String> signature_key = 0, |
| 9260 | uint32_t subgraph_index = 0) { |
| 9261 | SignatureDefBuilder builder_(_fbb); |
| 9262 | builder_.add_subgraph_index(subgraph_index); |
| 9263 | builder_.add_signature_key(signature_key); |
| 9264 | builder_.add_outputs(outputs); |
| 9265 | builder_.add_inputs(inputs); |
| 9266 | return builder_.Finish(); |
| 9267 | } |
| 9268 | |
| 9269 | inline flatbuffers::Offset<SignatureDef> CreateSignatureDefDirect( |
| 9270 | flatbuffers::FlatBufferBuilder &_fbb, |
| 9271 | const std::vector<flatbuffers::Offset<tflite::TensorMap>> *inputs = nullptr, |
| 9272 | const std::vector<flatbuffers::Offset<tflite::TensorMap>> *outputs = nullptr, |
| 9273 | const char *signature_key = nullptr, |
| 9274 | uint32_t subgraph_index = 0) { |
| 9275 | auto inputs__ = inputs ? _fbb.CreateVector<flatbuffers::Offset<tflite::TensorMap>>(*inputs) : 0; |
| 9276 | auto outputs__ = outputs ? _fbb.CreateVector<flatbuffers::Offset<tflite::TensorMap>>(*outputs) : 0; |
| 9277 | auto signature_key__ = signature_key ? _fbb.CreateString(signature_key) : 0; |
| 9278 | return tflite::CreateSignatureDef( |
| 9279 | _fbb, |
| 9280 | inputs__, |
| 9281 | outputs__, |
| 9282 | signature_key__, |
| 9283 | subgraph_index); |
| 9284 | } |
| 9285 | |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 9286 | struct Model FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 9287 | typedef ModelBuilder Builder; |
| 9288 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 9289 | VT_VERSION = 4, |
| 9290 | VT_OPERATOR_CODES = 6, |
| 9291 | VT_SUBGRAPHS = 8, |
| 9292 | VT_DESCRIPTION = 10, |
| 9293 | VT_BUFFERS = 12, |
| 9294 | VT_METADATA_BUFFER = 14, |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 9295 | VT_METADATA = 16, |
| 9296 | VT_SIGNATURE_DEFS = 18 |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 9297 | }; |
| 9298 | uint32_t version() const { |
| 9299 | return GetField<uint32_t>(VT_VERSION, 0); |
| 9300 | } |
| 9301 | const flatbuffers::Vector<flatbuffers::Offset<tflite::OperatorCode>> *operator_codes() const { |
| 9302 | return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<tflite::OperatorCode>> *>(VT_OPERATOR_CODES); |
| 9303 | } |
| 9304 | const flatbuffers::Vector<flatbuffers::Offset<tflite::SubGraph>> *subgraphs() const { |
| 9305 | return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<tflite::SubGraph>> *>(VT_SUBGRAPHS); |
| 9306 | } |
| 9307 | const flatbuffers::String *description() const { |
| 9308 | return GetPointer<const flatbuffers::String *>(VT_DESCRIPTION); |
| 9309 | } |
| 9310 | const flatbuffers::Vector<flatbuffers::Offset<tflite::Buffer>> *buffers() const { |
| 9311 | return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<tflite::Buffer>> *>(VT_BUFFERS); |
| 9312 | } |
| 9313 | const flatbuffers::Vector<int32_t> *metadata_buffer() const { |
| 9314 | return GetPointer<const flatbuffers::Vector<int32_t> *>(VT_METADATA_BUFFER); |
| 9315 | } |
| 9316 | const flatbuffers::Vector<flatbuffers::Offset<tflite::Metadata>> *metadata() const { |
| 9317 | return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<tflite::Metadata>> *>(VT_METADATA); |
| 9318 | } |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 9319 | const flatbuffers::Vector<flatbuffers::Offset<tflite::SignatureDef>> *signature_defs() const { |
| 9320 | return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<tflite::SignatureDef>> *>(VT_SIGNATURE_DEFS); |
| 9321 | } |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 9322 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 9323 | return VerifyTableStart(verifier) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 9324 | VerifyField<uint32_t>(verifier, VT_VERSION, 4) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 9325 | VerifyOffset(verifier, VT_OPERATOR_CODES) && |
| 9326 | verifier.VerifyVector(operator_codes()) && |
| 9327 | verifier.VerifyVectorOfTables(operator_codes()) && |
| 9328 | VerifyOffset(verifier, VT_SUBGRAPHS) && |
| 9329 | verifier.VerifyVector(subgraphs()) && |
| 9330 | verifier.VerifyVectorOfTables(subgraphs()) && |
| 9331 | VerifyOffset(verifier, VT_DESCRIPTION) && |
| 9332 | verifier.VerifyString(description()) && |
| 9333 | VerifyOffset(verifier, VT_BUFFERS) && |
| 9334 | verifier.VerifyVector(buffers()) && |
| 9335 | verifier.VerifyVectorOfTables(buffers()) && |
| 9336 | VerifyOffset(verifier, VT_METADATA_BUFFER) && |
| 9337 | verifier.VerifyVector(metadata_buffer()) && |
| 9338 | VerifyOffset(verifier, VT_METADATA) && |
| 9339 | verifier.VerifyVector(metadata()) && |
| 9340 | verifier.VerifyVectorOfTables(metadata()) && |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 9341 | VerifyOffset(verifier, VT_SIGNATURE_DEFS) && |
| 9342 | verifier.VerifyVector(signature_defs()) && |
| 9343 | verifier.VerifyVectorOfTables(signature_defs()) && |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 9344 | verifier.EndTable(); |
| 9345 | } |
| 9346 | }; |
| 9347 | |
| 9348 | struct ModelBuilder { |
| 9349 | typedef Model Table; |
| 9350 | flatbuffers::FlatBufferBuilder &fbb_; |
| 9351 | flatbuffers::uoffset_t start_; |
| 9352 | void add_version(uint32_t version) { |
| 9353 | fbb_.AddElement<uint32_t>(Model::VT_VERSION, version, 0); |
| 9354 | } |
| 9355 | void add_operator_codes(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::OperatorCode>>> operator_codes) { |
| 9356 | fbb_.AddOffset(Model::VT_OPERATOR_CODES, operator_codes); |
| 9357 | } |
| 9358 | void add_subgraphs(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::SubGraph>>> subgraphs) { |
| 9359 | fbb_.AddOffset(Model::VT_SUBGRAPHS, subgraphs); |
| 9360 | } |
| 9361 | void add_description(flatbuffers::Offset<flatbuffers::String> description) { |
| 9362 | fbb_.AddOffset(Model::VT_DESCRIPTION, description); |
| 9363 | } |
| 9364 | void add_buffers(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::Buffer>>> buffers) { |
| 9365 | fbb_.AddOffset(Model::VT_BUFFERS, buffers); |
| 9366 | } |
| 9367 | void add_metadata_buffer(flatbuffers::Offset<flatbuffers::Vector<int32_t>> metadata_buffer) { |
| 9368 | fbb_.AddOffset(Model::VT_METADATA_BUFFER, metadata_buffer); |
| 9369 | } |
| 9370 | void add_metadata(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::Metadata>>> metadata) { |
| 9371 | fbb_.AddOffset(Model::VT_METADATA, metadata); |
| 9372 | } |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 9373 | void add_signature_defs(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::SignatureDef>>> signature_defs) { |
| 9374 | fbb_.AddOffset(Model::VT_SIGNATURE_DEFS, signature_defs); |
| 9375 | } |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 9376 | explicit ModelBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 9377 | : fbb_(_fbb) { |
| 9378 | start_ = fbb_.StartTable(); |
| 9379 | } |
| 9380 | flatbuffers::Offset<Model> Finish() { |
| 9381 | const auto end = fbb_.EndTable(start_); |
| 9382 | auto o = flatbuffers::Offset<Model>(end); |
| 9383 | return o; |
| 9384 | } |
| 9385 | }; |
| 9386 | |
| 9387 | inline flatbuffers::Offset<Model> CreateModel( |
| 9388 | flatbuffers::FlatBufferBuilder &_fbb, |
| 9389 | uint32_t version = 0, |
| 9390 | flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::OperatorCode>>> operator_codes = 0, |
| 9391 | flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::SubGraph>>> subgraphs = 0, |
| 9392 | flatbuffers::Offset<flatbuffers::String> description = 0, |
| 9393 | flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::Buffer>>> buffers = 0, |
| 9394 | flatbuffers::Offset<flatbuffers::Vector<int32_t>> metadata_buffer = 0, |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 9395 | flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::Metadata>>> metadata = 0, |
| 9396 | flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::SignatureDef>>> signature_defs = 0) { |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 9397 | ModelBuilder builder_(_fbb); |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 9398 | builder_.add_signature_defs(signature_defs); |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 9399 | builder_.add_metadata(metadata); |
| 9400 | builder_.add_metadata_buffer(metadata_buffer); |
| 9401 | builder_.add_buffers(buffers); |
| 9402 | builder_.add_description(description); |
| 9403 | builder_.add_subgraphs(subgraphs); |
| 9404 | builder_.add_operator_codes(operator_codes); |
| 9405 | builder_.add_version(version); |
| 9406 | return builder_.Finish(); |
| 9407 | } |
| 9408 | |
| 9409 | inline flatbuffers::Offset<Model> CreateModelDirect( |
| 9410 | flatbuffers::FlatBufferBuilder &_fbb, |
| 9411 | uint32_t version = 0, |
| 9412 | const std::vector<flatbuffers::Offset<tflite::OperatorCode>> *operator_codes = nullptr, |
| 9413 | const std::vector<flatbuffers::Offset<tflite::SubGraph>> *subgraphs = nullptr, |
| 9414 | const char *description = nullptr, |
| 9415 | const std::vector<flatbuffers::Offset<tflite::Buffer>> *buffers = nullptr, |
| 9416 | const std::vector<int32_t> *metadata_buffer = nullptr, |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 9417 | const std::vector<flatbuffers::Offset<tflite::Metadata>> *metadata = nullptr, |
| 9418 | const std::vector<flatbuffers::Offset<tflite::SignatureDef>> *signature_defs = nullptr) { |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 9419 | auto operator_codes__ = operator_codes ? _fbb.CreateVector<flatbuffers::Offset<tflite::OperatorCode>>(*operator_codes) : 0; |
| 9420 | auto subgraphs__ = subgraphs ? _fbb.CreateVector<flatbuffers::Offset<tflite::SubGraph>>(*subgraphs) : 0; |
| 9421 | auto description__ = description ? _fbb.CreateString(description) : 0; |
| 9422 | auto buffers__ = buffers ? _fbb.CreateVector<flatbuffers::Offset<tflite::Buffer>>(*buffers) : 0; |
| 9423 | auto metadata_buffer__ = metadata_buffer ? _fbb.CreateVector<int32_t>(*metadata_buffer) : 0; |
| 9424 | auto metadata__ = metadata ? _fbb.CreateVector<flatbuffers::Offset<tflite::Metadata>>(*metadata) : 0; |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 9425 | auto signature_defs__ = signature_defs ? _fbb.CreateVector<flatbuffers::Offset<tflite::SignatureDef>>(*signature_defs) : 0; |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 9426 | return tflite::CreateModel( |
| 9427 | _fbb, |
| 9428 | version, |
| 9429 | operator_codes__, |
| 9430 | subgraphs__, |
| 9431 | description__, |
| 9432 | buffers__, |
| 9433 | metadata_buffer__, |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 9434 | metadata__, |
| 9435 | signature_defs__); |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 9436 | } |
| 9437 | |
| 9438 | inline bool VerifyQuantizationDetails(flatbuffers::Verifier &verifier, const void *obj, QuantizationDetails type) { |
| 9439 | switch (type) { |
| 9440 | case QuantizationDetails_NONE: { |
| 9441 | return true; |
| 9442 | } |
| 9443 | case QuantizationDetails_CustomQuantization: { |
| 9444 | auto ptr = reinterpret_cast<const tflite::CustomQuantization *>(obj); |
| 9445 | return verifier.VerifyTable(ptr); |
| 9446 | } |
| 9447 | default: return true; |
| 9448 | } |
| 9449 | } |
| 9450 | |
| 9451 | inline bool VerifyQuantizationDetailsVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector<flatbuffers::Offset<void>> *values, const flatbuffers::Vector<uint8_t> *types) { |
| 9452 | if (!values || !types) return !values && !types; |
| 9453 | if (values->size() != types->size()) return false; |
| 9454 | for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { |
| 9455 | if (!VerifyQuantizationDetails( |
| 9456 | verifier, values->Get(i), types->GetEnum<QuantizationDetails>(i))) { |
| 9457 | return false; |
| 9458 | } |
| 9459 | } |
| 9460 | return true; |
| 9461 | } |
| 9462 | |
| 9463 | inline bool VerifySparseIndexVector(flatbuffers::Verifier &verifier, const void *obj, SparseIndexVector type) { |
| 9464 | switch (type) { |
| 9465 | case SparseIndexVector_NONE: { |
| 9466 | return true; |
| 9467 | } |
| 9468 | case SparseIndexVector_Int32Vector: { |
| 9469 | auto ptr = reinterpret_cast<const tflite::Int32Vector *>(obj); |
| 9470 | return verifier.VerifyTable(ptr); |
| 9471 | } |
| 9472 | case SparseIndexVector_Uint16Vector: { |
| 9473 | auto ptr = reinterpret_cast<const tflite::Uint16Vector *>(obj); |
| 9474 | return verifier.VerifyTable(ptr); |
| 9475 | } |
| 9476 | case SparseIndexVector_Uint8Vector: { |
| 9477 | auto ptr = reinterpret_cast<const tflite::Uint8Vector *>(obj); |
| 9478 | return verifier.VerifyTable(ptr); |
| 9479 | } |
| 9480 | default: return true; |
| 9481 | } |
| 9482 | } |
| 9483 | |
| 9484 | inline bool VerifySparseIndexVectorVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector<flatbuffers::Offset<void>> *values, const flatbuffers::Vector<uint8_t> *types) { |
| 9485 | if (!values || !types) return !values && !types; |
| 9486 | if (values->size() != types->size()) return false; |
| 9487 | for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { |
| 9488 | if (!VerifySparseIndexVector( |
| 9489 | verifier, values->Get(i), types->GetEnum<SparseIndexVector>(i))) { |
| 9490 | return false; |
| 9491 | } |
| 9492 | } |
| 9493 | return true; |
| 9494 | } |
| 9495 | |
| 9496 | inline bool VerifyBuiltinOptions(flatbuffers::Verifier &verifier, const void *obj, BuiltinOptions type) { |
| 9497 | switch (type) { |
| 9498 | case BuiltinOptions_NONE: { |
| 9499 | return true; |
| 9500 | } |
| 9501 | case BuiltinOptions_Conv2DOptions: { |
| 9502 | auto ptr = reinterpret_cast<const tflite::Conv2DOptions *>(obj); |
| 9503 | return verifier.VerifyTable(ptr); |
| 9504 | } |
| 9505 | case BuiltinOptions_DepthwiseConv2DOptions: { |
| 9506 | auto ptr = reinterpret_cast<const tflite::DepthwiseConv2DOptions *>(obj); |
| 9507 | return verifier.VerifyTable(ptr); |
| 9508 | } |
| 9509 | case BuiltinOptions_ConcatEmbeddingsOptions: { |
| 9510 | auto ptr = reinterpret_cast<const tflite::ConcatEmbeddingsOptions *>(obj); |
| 9511 | return verifier.VerifyTable(ptr); |
| 9512 | } |
| 9513 | case BuiltinOptions_LSHProjectionOptions: { |
| 9514 | auto ptr = reinterpret_cast<const tflite::LSHProjectionOptions *>(obj); |
| 9515 | return verifier.VerifyTable(ptr); |
| 9516 | } |
| 9517 | case BuiltinOptions_Pool2DOptions: { |
| 9518 | auto ptr = reinterpret_cast<const tflite::Pool2DOptions *>(obj); |
| 9519 | return verifier.VerifyTable(ptr); |
| 9520 | } |
| 9521 | case BuiltinOptions_SVDFOptions: { |
| 9522 | auto ptr = reinterpret_cast<const tflite::SVDFOptions *>(obj); |
| 9523 | return verifier.VerifyTable(ptr); |
| 9524 | } |
| 9525 | case BuiltinOptions_RNNOptions: { |
| 9526 | auto ptr = reinterpret_cast<const tflite::RNNOptions *>(obj); |
| 9527 | return verifier.VerifyTable(ptr); |
| 9528 | } |
| 9529 | case BuiltinOptions_FullyConnectedOptions: { |
| 9530 | auto ptr = reinterpret_cast<const tflite::FullyConnectedOptions *>(obj); |
| 9531 | return verifier.VerifyTable(ptr); |
| 9532 | } |
| 9533 | case BuiltinOptions_SoftmaxOptions: { |
| 9534 | auto ptr = reinterpret_cast<const tflite::SoftmaxOptions *>(obj); |
| 9535 | return verifier.VerifyTable(ptr); |
| 9536 | } |
| 9537 | case BuiltinOptions_ConcatenationOptions: { |
| 9538 | auto ptr = reinterpret_cast<const tflite::ConcatenationOptions *>(obj); |
| 9539 | return verifier.VerifyTable(ptr); |
| 9540 | } |
| 9541 | case BuiltinOptions_AddOptions: { |
| 9542 | auto ptr = reinterpret_cast<const tflite::AddOptions *>(obj); |
| 9543 | return verifier.VerifyTable(ptr); |
| 9544 | } |
| 9545 | case BuiltinOptions_L2NormOptions: { |
| 9546 | auto ptr = reinterpret_cast<const tflite::L2NormOptions *>(obj); |
| 9547 | return verifier.VerifyTable(ptr); |
| 9548 | } |
| 9549 | case BuiltinOptions_LocalResponseNormalizationOptions: { |
| 9550 | auto ptr = reinterpret_cast<const tflite::LocalResponseNormalizationOptions *>(obj); |
| 9551 | return verifier.VerifyTable(ptr); |
| 9552 | } |
| 9553 | case BuiltinOptions_LSTMOptions: { |
| 9554 | auto ptr = reinterpret_cast<const tflite::LSTMOptions *>(obj); |
| 9555 | return verifier.VerifyTable(ptr); |
| 9556 | } |
| 9557 | case BuiltinOptions_ResizeBilinearOptions: { |
| 9558 | auto ptr = reinterpret_cast<const tflite::ResizeBilinearOptions *>(obj); |
| 9559 | return verifier.VerifyTable(ptr); |
| 9560 | } |
| 9561 | case BuiltinOptions_CallOptions: { |
| 9562 | auto ptr = reinterpret_cast<const tflite::CallOptions *>(obj); |
| 9563 | return verifier.VerifyTable(ptr); |
| 9564 | } |
| 9565 | case BuiltinOptions_ReshapeOptions: { |
| 9566 | auto ptr = reinterpret_cast<const tflite::ReshapeOptions *>(obj); |
| 9567 | return verifier.VerifyTable(ptr); |
| 9568 | } |
| 9569 | case BuiltinOptions_SkipGramOptions: { |
| 9570 | auto ptr = reinterpret_cast<const tflite::SkipGramOptions *>(obj); |
| 9571 | return verifier.VerifyTable(ptr); |
| 9572 | } |
| 9573 | case BuiltinOptions_SpaceToDepthOptions: { |
| 9574 | auto ptr = reinterpret_cast<const tflite::SpaceToDepthOptions *>(obj); |
| 9575 | return verifier.VerifyTable(ptr); |
| 9576 | } |
| 9577 | case BuiltinOptions_EmbeddingLookupSparseOptions: { |
| 9578 | auto ptr = reinterpret_cast<const tflite::EmbeddingLookupSparseOptions *>(obj); |
| 9579 | return verifier.VerifyTable(ptr); |
| 9580 | } |
| 9581 | case BuiltinOptions_MulOptions: { |
| 9582 | auto ptr = reinterpret_cast<const tflite::MulOptions *>(obj); |
| 9583 | return verifier.VerifyTable(ptr); |
| 9584 | } |
| 9585 | case BuiltinOptions_PadOptions: { |
| 9586 | auto ptr = reinterpret_cast<const tflite::PadOptions *>(obj); |
| 9587 | return verifier.VerifyTable(ptr); |
| 9588 | } |
| 9589 | case BuiltinOptions_GatherOptions: { |
| 9590 | auto ptr = reinterpret_cast<const tflite::GatherOptions *>(obj); |
| 9591 | return verifier.VerifyTable(ptr); |
| 9592 | } |
| 9593 | case BuiltinOptions_BatchToSpaceNDOptions: { |
| 9594 | auto ptr = reinterpret_cast<const tflite::BatchToSpaceNDOptions *>(obj); |
| 9595 | return verifier.VerifyTable(ptr); |
| 9596 | } |
| 9597 | case BuiltinOptions_SpaceToBatchNDOptions: { |
| 9598 | auto ptr = reinterpret_cast<const tflite::SpaceToBatchNDOptions *>(obj); |
| 9599 | return verifier.VerifyTable(ptr); |
| 9600 | } |
| 9601 | case BuiltinOptions_TransposeOptions: { |
| 9602 | auto ptr = reinterpret_cast<const tflite::TransposeOptions *>(obj); |
| 9603 | return verifier.VerifyTable(ptr); |
| 9604 | } |
| 9605 | case BuiltinOptions_ReducerOptions: { |
| 9606 | auto ptr = reinterpret_cast<const tflite::ReducerOptions *>(obj); |
| 9607 | return verifier.VerifyTable(ptr); |
| 9608 | } |
| 9609 | case BuiltinOptions_SubOptions: { |
| 9610 | auto ptr = reinterpret_cast<const tflite::SubOptions *>(obj); |
| 9611 | return verifier.VerifyTable(ptr); |
| 9612 | } |
| 9613 | case BuiltinOptions_DivOptions: { |
| 9614 | auto ptr = reinterpret_cast<const tflite::DivOptions *>(obj); |
| 9615 | return verifier.VerifyTable(ptr); |
| 9616 | } |
| 9617 | case BuiltinOptions_SqueezeOptions: { |
| 9618 | auto ptr = reinterpret_cast<const tflite::SqueezeOptions *>(obj); |
| 9619 | return verifier.VerifyTable(ptr); |
| 9620 | } |
| 9621 | case BuiltinOptions_SequenceRNNOptions: { |
| 9622 | auto ptr = reinterpret_cast<const tflite::SequenceRNNOptions *>(obj); |
| 9623 | return verifier.VerifyTable(ptr); |
| 9624 | } |
| 9625 | case BuiltinOptions_StridedSliceOptions: { |
| 9626 | auto ptr = reinterpret_cast<const tflite::StridedSliceOptions *>(obj); |
| 9627 | return verifier.VerifyTable(ptr); |
| 9628 | } |
| 9629 | case BuiltinOptions_ExpOptions: { |
| 9630 | auto ptr = reinterpret_cast<const tflite::ExpOptions *>(obj); |
| 9631 | return verifier.VerifyTable(ptr); |
| 9632 | } |
| 9633 | case BuiltinOptions_TopKV2Options: { |
| 9634 | auto ptr = reinterpret_cast<const tflite::TopKV2Options *>(obj); |
| 9635 | return verifier.VerifyTable(ptr); |
| 9636 | } |
| 9637 | case BuiltinOptions_SplitOptions: { |
| 9638 | auto ptr = reinterpret_cast<const tflite::SplitOptions *>(obj); |
| 9639 | return verifier.VerifyTable(ptr); |
| 9640 | } |
| 9641 | case BuiltinOptions_LogSoftmaxOptions: { |
| 9642 | auto ptr = reinterpret_cast<const tflite::LogSoftmaxOptions *>(obj); |
| 9643 | return verifier.VerifyTable(ptr); |
| 9644 | } |
| 9645 | case BuiltinOptions_CastOptions: { |
| 9646 | auto ptr = reinterpret_cast<const tflite::CastOptions *>(obj); |
| 9647 | return verifier.VerifyTable(ptr); |
| 9648 | } |
| 9649 | case BuiltinOptions_DequantizeOptions: { |
| 9650 | auto ptr = reinterpret_cast<const tflite::DequantizeOptions *>(obj); |
| 9651 | return verifier.VerifyTable(ptr); |
| 9652 | } |
| 9653 | case BuiltinOptions_MaximumMinimumOptions: { |
| 9654 | auto ptr = reinterpret_cast<const tflite::MaximumMinimumOptions *>(obj); |
| 9655 | return verifier.VerifyTable(ptr); |
| 9656 | } |
| 9657 | case BuiltinOptions_ArgMaxOptions: { |
| 9658 | auto ptr = reinterpret_cast<const tflite::ArgMaxOptions *>(obj); |
| 9659 | return verifier.VerifyTable(ptr); |
| 9660 | } |
| 9661 | case BuiltinOptions_LessOptions: { |
| 9662 | auto ptr = reinterpret_cast<const tflite::LessOptions *>(obj); |
| 9663 | return verifier.VerifyTable(ptr); |
| 9664 | } |
| 9665 | case BuiltinOptions_NegOptions: { |
| 9666 | auto ptr = reinterpret_cast<const tflite::NegOptions *>(obj); |
| 9667 | return verifier.VerifyTable(ptr); |
| 9668 | } |
| 9669 | case BuiltinOptions_PadV2Options: { |
| 9670 | auto ptr = reinterpret_cast<const tflite::PadV2Options *>(obj); |
| 9671 | return verifier.VerifyTable(ptr); |
| 9672 | } |
| 9673 | case BuiltinOptions_GreaterOptions: { |
| 9674 | auto ptr = reinterpret_cast<const tflite::GreaterOptions *>(obj); |
| 9675 | return verifier.VerifyTable(ptr); |
| 9676 | } |
| 9677 | case BuiltinOptions_GreaterEqualOptions: { |
| 9678 | auto ptr = reinterpret_cast<const tflite::GreaterEqualOptions *>(obj); |
| 9679 | return verifier.VerifyTable(ptr); |
| 9680 | } |
| 9681 | case BuiltinOptions_LessEqualOptions: { |
| 9682 | auto ptr = reinterpret_cast<const tflite::LessEqualOptions *>(obj); |
| 9683 | return verifier.VerifyTable(ptr); |
| 9684 | } |
| 9685 | case BuiltinOptions_SelectOptions: { |
| 9686 | auto ptr = reinterpret_cast<const tflite::SelectOptions *>(obj); |
| 9687 | return verifier.VerifyTable(ptr); |
| 9688 | } |
| 9689 | case BuiltinOptions_SliceOptions: { |
| 9690 | auto ptr = reinterpret_cast<const tflite::SliceOptions *>(obj); |
| 9691 | return verifier.VerifyTable(ptr); |
| 9692 | } |
| 9693 | case BuiltinOptions_TransposeConvOptions: { |
| 9694 | auto ptr = reinterpret_cast<const tflite::TransposeConvOptions *>(obj); |
| 9695 | return verifier.VerifyTable(ptr); |
| 9696 | } |
| 9697 | case BuiltinOptions_SparseToDenseOptions: { |
| 9698 | auto ptr = reinterpret_cast<const tflite::SparseToDenseOptions *>(obj); |
| 9699 | return verifier.VerifyTable(ptr); |
| 9700 | } |
| 9701 | case BuiltinOptions_TileOptions: { |
| 9702 | auto ptr = reinterpret_cast<const tflite::TileOptions *>(obj); |
| 9703 | return verifier.VerifyTable(ptr); |
| 9704 | } |
| 9705 | case BuiltinOptions_ExpandDimsOptions: { |
| 9706 | auto ptr = reinterpret_cast<const tflite::ExpandDimsOptions *>(obj); |
| 9707 | return verifier.VerifyTable(ptr); |
| 9708 | } |
| 9709 | case BuiltinOptions_EqualOptions: { |
| 9710 | auto ptr = reinterpret_cast<const tflite::EqualOptions *>(obj); |
| 9711 | return verifier.VerifyTable(ptr); |
| 9712 | } |
| 9713 | case BuiltinOptions_NotEqualOptions: { |
| 9714 | auto ptr = reinterpret_cast<const tflite::NotEqualOptions *>(obj); |
| 9715 | return verifier.VerifyTable(ptr); |
| 9716 | } |
| 9717 | case BuiltinOptions_ShapeOptions: { |
| 9718 | auto ptr = reinterpret_cast<const tflite::ShapeOptions *>(obj); |
| 9719 | return verifier.VerifyTable(ptr); |
| 9720 | } |
| 9721 | case BuiltinOptions_PowOptions: { |
| 9722 | auto ptr = reinterpret_cast<const tflite::PowOptions *>(obj); |
| 9723 | return verifier.VerifyTable(ptr); |
| 9724 | } |
| 9725 | case BuiltinOptions_ArgMinOptions: { |
| 9726 | auto ptr = reinterpret_cast<const tflite::ArgMinOptions *>(obj); |
| 9727 | return verifier.VerifyTable(ptr); |
| 9728 | } |
| 9729 | case BuiltinOptions_FakeQuantOptions: { |
| 9730 | auto ptr = reinterpret_cast<const tflite::FakeQuantOptions *>(obj); |
| 9731 | return verifier.VerifyTable(ptr); |
| 9732 | } |
| 9733 | case BuiltinOptions_PackOptions: { |
| 9734 | auto ptr = reinterpret_cast<const tflite::PackOptions *>(obj); |
| 9735 | return verifier.VerifyTable(ptr); |
| 9736 | } |
| 9737 | case BuiltinOptions_LogicalOrOptions: { |
| 9738 | auto ptr = reinterpret_cast<const tflite::LogicalOrOptions *>(obj); |
| 9739 | return verifier.VerifyTable(ptr); |
| 9740 | } |
| 9741 | case BuiltinOptions_OneHotOptions: { |
| 9742 | auto ptr = reinterpret_cast<const tflite::OneHotOptions *>(obj); |
| 9743 | return verifier.VerifyTable(ptr); |
| 9744 | } |
| 9745 | case BuiltinOptions_LogicalAndOptions: { |
| 9746 | auto ptr = reinterpret_cast<const tflite::LogicalAndOptions *>(obj); |
| 9747 | return verifier.VerifyTable(ptr); |
| 9748 | } |
| 9749 | case BuiltinOptions_LogicalNotOptions: { |
| 9750 | auto ptr = reinterpret_cast<const tflite::LogicalNotOptions *>(obj); |
| 9751 | return verifier.VerifyTable(ptr); |
| 9752 | } |
| 9753 | case BuiltinOptions_UnpackOptions: { |
| 9754 | auto ptr = reinterpret_cast<const tflite::UnpackOptions *>(obj); |
| 9755 | return verifier.VerifyTable(ptr); |
| 9756 | } |
| 9757 | case BuiltinOptions_FloorDivOptions: { |
| 9758 | auto ptr = reinterpret_cast<const tflite::FloorDivOptions *>(obj); |
| 9759 | return verifier.VerifyTable(ptr); |
| 9760 | } |
| 9761 | case BuiltinOptions_SquareOptions: { |
| 9762 | auto ptr = reinterpret_cast<const tflite::SquareOptions *>(obj); |
| 9763 | return verifier.VerifyTable(ptr); |
| 9764 | } |
| 9765 | case BuiltinOptions_ZerosLikeOptions: { |
| 9766 | auto ptr = reinterpret_cast<const tflite::ZerosLikeOptions *>(obj); |
| 9767 | return verifier.VerifyTable(ptr); |
| 9768 | } |
| 9769 | case BuiltinOptions_FillOptions: { |
| 9770 | auto ptr = reinterpret_cast<const tflite::FillOptions *>(obj); |
| 9771 | return verifier.VerifyTable(ptr); |
| 9772 | } |
| 9773 | case BuiltinOptions_BidirectionalSequenceLSTMOptions: { |
| 9774 | auto ptr = reinterpret_cast<const tflite::BidirectionalSequenceLSTMOptions *>(obj); |
| 9775 | return verifier.VerifyTable(ptr); |
| 9776 | } |
| 9777 | case BuiltinOptions_BidirectionalSequenceRNNOptions: { |
| 9778 | auto ptr = reinterpret_cast<const tflite::BidirectionalSequenceRNNOptions *>(obj); |
| 9779 | return verifier.VerifyTable(ptr); |
| 9780 | } |
| 9781 | case BuiltinOptions_UnidirectionalSequenceLSTMOptions: { |
| 9782 | auto ptr = reinterpret_cast<const tflite::UnidirectionalSequenceLSTMOptions *>(obj); |
| 9783 | return verifier.VerifyTable(ptr); |
| 9784 | } |
| 9785 | case BuiltinOptions_FloorModOptions: { |
| 9786 | auto ptr = reinterpret_cast<const tflite::FloorModOptions *>(obj); |
| 9787 | return verifier.VerifyTable(ptr); |
| 9788 | } |
| 9789 | case BuiltinOptions_RangeOptions: { |
| 9790 | auto ptr = reinterpret_cast<const tflite::RangeOptions *>(obj); |
| 9791 | return verifier.VerifyTable(ptr); |
| 9792 | } |
| 9793 | case BuiltinOptions_ResizeNearestNeighborOptions: { |
| 9794 | auto ptr = reinterpret_cast<const tflite::ResizeNearestNeighborOptions *>(obj); |
| 9795 | return verifier.VerifyTable(ptr); |
| 9796 | } |
| 9797 | case BuiltinOptions_LeakyReluOptions: { |
| 9798 | auto ptr = reinterpret_cast<const tflite::LeakyReluOptions *>(obj); |
| 9799 | return verifier.VerifyTable(ptr); |
| 9800 | } |
| 9801 | case BuiltinOptions_SquaredDifferenceOptions: { |
| 9802 | auto ptr = reinterpret_cast<const tflite::SquaredDifferenceOptions *>(obj); |
| 9803 | return verifier.VerifyTable(ptr); |
| 9804 | } |
| 9805 | case BuiltinOptions_MirrorPadOptions: { |
| 9806 | auto ptr = reinterpret_cast<const tflite::MirrorPadOptions *>(obj); |
| 9807 | return verifier.VerifyTable(ptr); |
| 9808 | } |
| 9809 | case BuiltinOptions_AbsOptions: { |
| 9810 | auto ptr = reinterpret_cast<const tflite::AbsOptions *>(obj); |
| 9811 | return verifier.VerifyTable(ptr); |
| 9812 | } |
| 9813 | case BuiltinOptions_SplitVOptions: { |
| 9814 | auto ptr = reinterpret_cast<const tflite::SplitVOptions *>(obj); |
| 9815 | return verifier.VerifyTable(ptr); |
| 9816 | } |
| 9817 | case BuiltinOptions_UniqueOptions: { |
| 9818 | auto ptr = reinterpret_cast<const tflite::UniqueOptions *>(obj); |
| 9819 | return verifier.VerifyTable(ptr); |
| 9820 | } |
| 9821 | case BuiltinOptions_ReverseV2Options: { |
| 9822 | auto ptr = reinterpret_cast<const tflite::ReverseV2Options *>(obj); |
| 9823 | return verifier.VerifyTable(ptr); |
| 9824 | } |
| 9825 | case BuiltinOptions_AddNOptions: { |
| 9826 | auto ptr = reinterpret_cast<const tflite::AddNOptions *>(obj); |
| 9827 | return verifier.VerifyTable(ptr); |
| 9828 | } |
| 9829 | case BuiltinOptions_GatherNdOptions: { |
| 9830 | auto ptr = reinterpret_cast<const tflite::GatherNdOptions *>(obj); |
| 9831 | return verifier.VerifyTable(ptr); |
| 9832 | } |
| 9833 | case BuiltinOptions_CosOptions: { |
| 9834 | auto ptr = reinterpret_cast<const tflite::CosOptions *>(obj); |
| 9835 | return verifier.VerifyTable(ptr); |
| 9836 | } |
| 9837 | case BuiltinOptions_WhereOptions: { |
| 9838 | auto ptr = reinterpret_cast<const tflite::WhereOptions *>(obj); |
| 9839 | return verifier.VerifyTable(ptr); |
| 9840 | } |
| 9841 | case BuiltinOptions_RankOptions: { |
| 9842 | auto ptr = reinterpret_cast<const tflite::RankOptions *>(obj); |
| 9843 | return verifier.VerifyTable(ptr); |
| 9844 | } |
| 9845 | case BuiltinOptions_ReverseSequenceOptions: { |
| 9846 | auto ptr = reinterpret_cast<const tflite::ReverseSequenceOptions *>(obj); |
| 9847 | return verifier.VerifyTable(ptr); |
| 9848 | } |
| 9849 | case BuiltinOptions_MatrixDiagOptions: { |
| 9850 | auto ptr = reinterpret_cast<const tflite::MatrixDiagOptions *>(obj); |
| 9851 | return verifier.VerifyTable(ptr); |
| 9852 | } |
| 9853 | case BuiltinOptions_QuantizeOptions: { |
| 9854 | auto ptr = reinterpret_cast<const tflite::QuantizeOptions *>(obj); |
| 9855 | return verifier.VerifyTable(ptr); |
| 9856 | } |
| 9857 | case BuiltinOptions_MatrixSetDiagOptions: { |
| 9858 | auto ptr = reinterpret_cast<const tflite::MatrixSetDiagOptions *>(obj); |
| 9859 | return verifier.VerifyTable(ptr); |
| 9860 | } |
| 9861 | case BuiltinOptions_HardSwishOptions: { |
| 9862 | auto ptr = reinterpret_cast<const tflite::HardSwishOptions *>(obj); |
| 9863 | return verifier.VerifyTable(ptr); |
| 9864 | } |
| 9865 | case BuiltinOptions_IfOptions: { |
| 9866 | auto ptr = reinterpret_cast<const tflite::IfOptions *>(obj); |
| 9867 | return verifier.VerifyTable(ptr); |
| 9868 | } |
| 9869 | case BuiltinOptions_WhileOptions: { |
| 9870 | auto ptr = reinterpret_cast<const tflite::WhileOptions *>(obj); |
| 9871 | return verifier.VerifyTable(ptr); |
| 9872 | } |
| 9873 | case BuiltinOptions_DepthToSpaceOptions: { |
| 9874 | auto ptr = reinterpret_cast<const tflite::DepthToSpaceOptions *>(obj); |
| 9875 | return verifier.VerifyTable(ptr); |
| 9876 | } |
| 9877 | case BuiltinOptions_NonMaxSuppressionV4Options: { |
| 9878 | auto ptr = reinterpret_cast<const tflite::NonMaxSuppressionV4Options *>(obj); |
| 9879 | return verifier.VerifyTable(ptr); |
| 9880 | } |
| 9881 | case BuiltinOptions_NonMaxSuppressionV5Options: { |
| 9882 | auto ptr = reinterpret_cast<const tflite::NonMaxSuppressionV5Options *>(obj); |
| 9883 | return verifier.VerifyTable(ptr); |
| 9884 | } |
| 9885 | case BuiltinOptions_ScatterNdOptions: { |
| 9886 | auto ptr = reinterpret_cast<const tflite::ScatterNdOptions *>(obj); |
| 9887 | return verifier.VerifyTable(ptr); |
| 9888 | } |
| 9889 | case BuiltinOptions_SelectV2Options: { |
| 9890 | auto ptr = reinterpret_cast<const tflite::SelectV2Options *>(obj); |
| 9891 | return verifier.VerifyTable(ptr); |
| 9892 | } |
| 9893 | case BuiltinOptions_DensifyOptions: { |
| 9894 | auto ptr = reinterpret_cast<const tflite::DensifyOptions *>(obj); |
| 9895 | return verifier.VerifyTable(ptr); |
| 9896 | } |
| 9897 | case BuiltinOptions_SegmentSumOptions: { |
| 9898 | auto ptr = reinterpret_cast<const tflite::SegmentSumOptions *>(obj); |
| 9899 | return verifier.VerifyTable(ptr); |
| 9900 | } |
| 9901 | case BuiltinOptions_BatchMatMulOptions: { |
| 9902 | auto ptr = reinterpret_cast<const tflite::BatchMatMulOptions *>(obj); |
| 9903 | return verifier.VerifyTable(ptr); |
| 9904 | } |
Kristofer Jonsson | 118b059 | 2022-01-17 11:39:37 +0100 | [diff] [blame^] | 9905 | case BuiltinOptions_CumsumOptions: { |
| 9906 | auto ptr = reinterpret_cast<const tflite::CumsumOptions *>(obj); |
| 9907 | return verifier.VerifyTable(ptr); |
| 9908 | } |
| 9909 | case BuiltinOptions_CallOnceOptions: { |
| 9910 | auto ptr = reinterpret_cast<const tflite::CallOnceOptions *>(obj); |
| 9911 | return verifier.VerifyTable(ptr); |
| 9912 | } |
| 9913 | case BuiltinOptions_BroadcastToOptions: { |
| 9914 | auto ptr = reinterpret_cast<const tflite::BroadcastToOptions *>(obj); |
| 9915 | return verifier.VerifyTable(ptr); |
| 9916 | } |
| 9917 | case BuiltinOptions_Rfft2dOptions: { |
| 9918 | auto ptr = reinterpret_cast<const tflite::Rfft2dOptions *>(obj); |
| 9919 | return verifier.VerifyTable(ptr); |
| 9920 | } |
| 9921 | case BuiltinOptions_Conv3DOptions: { |
| 9922 | auto ptr = reinterpret_cast<const tflite::Conv3DOptions *>(obj); |
| 9923 | return verifier.VerifyTable(ptr); |
| 9924 | } |
| 9925 | case BuiltinOptions_HashtableOptions: { |
| 9926 | auto ptr = reinterpret_cast<const tflite::HashtableOptions *>(obj); |
| 9927 | return verifier.VerifyTable(ptr); |
| 9928 | } |
| 9929 | case BuiltinOptions_HashtableFindOptions: { |
| 9930 | auto ptr = reinterpret_cast<const tflite::HashtableFindOptions *>(obj); |
| 9931 | return verifier.VerifyTable(ptr); |
| 9932 | } |
| 9933 | case BuiltinOptions_HashtableImportOptions: { |
| 9934 | auto ptr = reinterpret_cast<const tflite::HashtableImportOptions *>(obj); |
| 9935 | return verifier.VerifyTable(ptr); |
| 9936 | } |
| 9937 | case BuiltinOptions_HashtableSizeOptions: { |
| 9938 | auto ptr = reinterpret_cast<const tflite::HashtableSizeOptions *>(obj); |
| 9939 | return verifier.VerifyTable(ptr); |
| 9940 | } |
| 9941 | case BuiltinOptions_VarHandleOptions: { |
| 9942 | auto ptr = reinterpret_cast<const tflite::VarHandleOptions *>(obj); |
| 9943 | return verifier.VerifyTable(ptr); |
| 9944 | } |
| 9945 | case BuiltinOptions_ReadVariableOptions: { |
| 9946 | auto ptr = reinterpret_cast<const tflite::ReadVariableOptions *>(obj); |
| 9947 | return verifier.VerifyTable(ptr); |
| 9948 | } |
| 9949 | case BuiltinOptions_AssignVariableOptions: { |
| 9950 | auto ptr = reinterpret_cast<const tflite::AssignVariableOptions *>(obj); |
| 9951 | return verifier.VerifyTable(ptr); |
| 9952 | } |
| 9953 | case BuiltinOptions_RandomOptions: { |
| 9954 | auto ptr = reinterpret_cast<const tflite::RandomOptions *>(obj); |
| 9955 | return verifier.VerifyTable(ptr); |
| 9956 | } |
| 9957 | case BuiltinOptions_BucketizeOptions: { |
| 9958 | auto ptr = reinterpret_cast<const tflite::BucketizeOptions *>(obj); |
| 9959 | return verifier.VerifyTable(ptr); |
| 9960 | } |
| 9961 | case BuiltinOptions_GeluOptions: { |
| 9962 | auto ptr = reinterpret_cast<const tflite::GeluOptions *>(obj); |
| 9963 | return verifier.VerifyTable(ptr); |
| 9964 | } |
Kristofer Jonsson | b74492c | 2020-09-10 13:26:01 +0200 | [diff] [blame] | 9965 | default: return true; |
| 9966 | } |
| 9967 | } |
| 9968 | |
| 9969 | inline bool VerifyBuiltinOptionsVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector<flatbuffers::Offset<void>> *values, const flatbuffers::Vector<uint8_t> *types) { |
| 9970 | if (!values || !types) return !values && !types; |
| 9971 | if (values->size() != types->size()) return false; |
| 9972 | for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { |
| 9973 | if (!VerifyBuiltinOptions( |
| 9974 | verifier, values->Get(i), types->GetEnum<BuiltinOptions>(i))) { |
| 9975 | return false; |
| 9976 | } |
| 9977 | } |
| 9978 | return true; |
| 9979 | } |
| 9980 | |
| 9981 | inline const tflite::Model *GetModel(const void *buf) { |
| 9982 | return flatbuffers::GetRoot<tflite::Model>(buf); |
| 9983 | } |
| 9984 | |
| 9985 | inline const tflite::Model *GetSizePrefixedModel(const void *buf) { |
| 9986 | return flatbuffers::GetSizePrefixedRoot<tflite::Model>(buf); |
| 9987 | } |
| 9988 | |
| 9989 | inline const char *ModelIdentifier() { |
| 9990 | return "TFL3"; |
| 9991 | } |
| 9992 | |
| 9993 | inline bool ModelBufferHasIdentifier(const void *buf) { |
| 9994 | return flatbuffers::BufferHasIdentifier( |
| 9995 | buf, ModelIdentifier()); |
| 9996 | } |
| 9997 | |
| 9998 | inline bool VerifyModelBuffer( |
| 9999 | flatbuffers::Verifier &verifier) { |
| 10000 | return verifier.VerifyBuffer<tflite::Model>(ModelIdentifier()); |
| 10001 | } |
| 10002 | |
| 10003 | inline bool VerifySizePrefixedModelBuffer( |
| 10004 | flatbuffers::Verifier &verifier) { |
| 10005 | return verifier.VerifySizePrefixedBuffer<tflite::Model>(ModelIdentifier()); |
| 10006 | } |
| 10007 | |
| 10008 | inline const char *ModelExtension() { |
| 10009 | return "tflite"; |
| 10010 | } |
| 10011 | |
| 10012 | inline void FinishModelBuffer( |
| 10013 | flatbuffers::FlatBufferBuilder &fbb, |
| 10014 | flatbuffers::Offset<tflite::Model> root) { |
| 10015 | fbb.Finish(root, ModelIdentifier()); |
| 10016 | } |
| 10017 | |
| 10018 | inline void FinishSizePrefixedModelBuffer( |
| 10019 | flatbuffers::FlatBufferBuilder &fbb, |
| 10020 | flatbuffers::Offset<tflite::Model> root) { |
| 10021 | fbb.FinishSizePrefixed(root, ModelIdentifier()); |
| 10022 | } |
| 10023 | |
| 10024 | } // namespace tflite |
| 10025 | |
| 10026 | #endif // FLATBUFFERS_GENERATED_SCHEMA_TFLITE_H_ |