1 /* Copyright 2018 The TensorFlow Authors. All Rights Reserved. 2 3 Licensed under the Apache License, Version 2.0 (the "License"); 4 you may not use this file except in compliance with the License. 5 You may obtain a copy of the License at 6 7 http://www.apache.org/licenses/LICENSE-2.0 8 9 Unless required by applicable law or agreed to in writing, software 10 distributed under the License is distributed on an "AS IS" BASIS, 11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 See the License for the specific language governing permissions and 13 limitations under the License. 14 ==============================================================================*/ 15 // automatically generated by the FlatBuffers compiler, do not modify 16 17 18 #ifndef FLATBUFFERS_GENERATED_SCHEMA_TFLITE_H_ 19 #define FLATBUFFERS_GENERATED_SCHEMA_TFLITE_H_ 20 21 #include "flatbuffers/flatbuffers.h" 22 23 namespace tflite { 24 25 struct QuantizationParameters; 26 struct QuantizationParametersT; 27 28 struct Tensor; 29 struct TensorT; 30 31 struct Conv2DOptions; 32 struct Conv2DOptionsT; 33 34 struct Pool2DOptions; 35 struct Pool2DOptionsT; 36 37 struct DepthwiseConv2DOptions; 38 struct DepthwiseConv2DOptionsT; 39 40 struct ConcatEmbeddingsOptions; 41 struct ConcatEmbeddingsOptionsT; 42 43 struct LSHProjectionOptions; 44 struct LSHProjectionOptionsT; 45 46 struct SVDFOptions; 47 struct SVDFOptionsT; 48 49 struct RNNOptions; 50 struct RNNOptionsT; 51 52 struct SequenceRNNOptions; 53 struct SequenceRNNOptionsT; 54 55 struct BidirectionalSequenceRNNOptions; 56 struct BidirectionalSequenceRNNOptionsT; 57 58 struct FullyConnectedOptions; 59 struct FullyConnectedOptionsT; 60 61 struct SoftmaxOptions; 62 struct SoftmaxOptionsT; 63 64 struct ConcatenationOptions; 65 struct ConcatenationOptionsT; 66 67 struct AddOptions; 68 struct AddOptionsT; 69 70 struct MulOptions; 71 struct MulOptionsT; 72 73 struct L2NormOptions; 74 struct L2NormOptionsT; 75 76 struct LocalResponseNormalizationOptions; 77 struct LocalResponseNormalizationOptionsT; 78 79 struct LSTMOptions; 80 struct LSTMOptionsT; 81 82 struct ResizeBilinearOptions; 83 struct ResizeBilinearOptionsT; 84 85 struct CallOptions; 86 struct CallOptionsT; 87 88 struct PadOptions; 89 struct PadOptionsT; 90 91 struct ReshapeOptions; 92 struct ReshapeOptionsT; 93 94 struct SpaceToBatchNDOptions; 95 struct SpaceToBatchNDOptionsT; 96 97 struct BatchToSpaceNDOptions; 98 struct BatchToSpaceNDOptionsT; 99 100 struct SkipGramOptions; 101 struct SkipGramOptionsT; 102 103 struct SpaceToDepthOptions; 104 struct SpaceToDepthOptionsT; 105 106 struct SubOptions; 107 struct SubOptionsT; 108 109 struct DivOptions; 110 struct DivOptionsT; 111 112 struct TopKV2Options; 113 struct TopKV2OptionsT; 114 115 struct EmbeddingLookupSparseOptions; 116 struct EmbeddingLookupSparseOptionsT; 117 118 struct GatherOptions; 119 struct GatherOptionsT; 120 121 struct TransposeOptions; 122 struct TransposeOptionsT; 123 124 struct ExpOptions; 125 struct ExpOptionsT; 126 127 struct MeanOptions; 128 struct MeanOptionsT; 129 130 struct SqueezeOptions; 131 struct SqueezeOptionsT; 132 133 struct SplitOptions; 134 struct SplitOptionsT; 135 136 struct StridedSliceOptions; 137 struct StridedSliceOptionsT; 138 139 struct OperatorCode; 140 struct OperatorCodeT; 141 142 struct Operator; 143 struct OperatorT; 144 145 struct SubGraph; 146 struct SubGraphT; 147 148 struct Buffer; 149 struct BufferT; 150 151 struct Model; 152 struct ModelT; 153 154 enum TensorType { 155 TensorType_FLOAT32 = 0, 156 TensorType_FLOAT16 = 1, 157 TensorType_INT32 = 2, 158 TensorType_UINT8 = 3, 159 TensorType_INT64 = 4, 160 TensorType_STRING = 5, 161 TensorType_MIN = TensorType_FLOAT32, 162 TensorType_MAX = TensorType_STRING 163 }; 164 165 inline TensorType (&EnumValuesTensorType())[6] { 166 static TensorType values[] = { 167 TensorType_FLOAT32, 168 TensorType_FLOAT16, 169 TensorType_INT32, 170 TensorType_UINT8, 171 TensorType_INT64, 172 TensorType_STRING 173 }; 174 return values; 175 } 176 177 inline const char **EnumNamesTensorType() { 178 static const char *names[] = { 179 "FLOAT32", 180 "FLOAT16", 181 "INT32", 182 "UINT8", 183 "INT64", 184 "STRING", 185 nullptr 186 }; 187 return names; 188 } 189 190 inline const char *EnumNameTensorType(TensorType e) { 191 const size_t index = static_cast<int>(e); 192 return EnumNamesTensorType()[index]; 193 } 194 195 enum BuiltinOperator { 196 BuiltinOperator_ADD = 0, 197 BuiltinOperator_AVERAGE_POOL_2D = 1, 198 BuiltinOperator_CONCATENATION = 2, 199 BuiltinOperator_CONV_2D = 3, 200 BuiltinOperator_DEPTHWISE_CONV_2D = 4, 201 BuiltinOperator_EMBEDDING_LOOKUP = 7, 202 BuiltinOperator_FULLY_CONNECTED = 9, 203 BuiltinOperator_HASHTABLE_LOOKUP = 10, 204 BuiltinOperator_L2_NORMALIZATION = 11, 205 BuiltinOperator_L2_POOL_2D = 12, 206 BuiltinOperator_LOCAL_RESPONSE_NORMALIZATION = 13, 207 BuiltinOperator_LOGISTIC = 14, 208 BuiltinOperator_LSH_PROJECTION = 15, 209 BuiltinOperator_LSTM = 16, 210 BuiltinOperator_MAX_POOL_2D = 17, 211 BuiltinOperator_MUL = 18, 212 BuiltinOperator_RELU = 19, 213 BuiltinOperator_RELU_N1_TO_1 = 20, 214 BuiltinOperator_RELU6 = 21, 215 BuiltinOperator_RESHAPE = 22, 216 BuiltinOperator_RESIZE_BILINEAR = 23, 217 BuiltinOperator_RNN = 24, 218 BuiltinOperator_SOFTMAX = 25, 219 BuiltinOperator_SPACE_TO_DEPTH = 26, 220 BuiltinOperator_SVDF = 27, 221 BuiltinOperator_TANH = 28, 222 BuiltinOperator_CONCAT_EMBEDDINGS = 29, 223 BuiltinOperator_SKIP_GRAM = 30, 224 BuiltinOperator_CALL = 31, 225 BuiltinOperator_CUSTOM = 32, 226 BuiltinOperator_EMBEDDING_LOOKUP_SPARSE = 33, 227 BuiltinOperator_PAD = 34, 228 BuiltinOperator_UNIDIRECTIONAL_SEQUENCE_RNN = 35, 229 BuiltinOperator_GATHER = 36, 230 BuiltinOperator_BATCH_TO_SPACE_ND = 37, 231 BuiltinOperator_SPACE_TO_BATCH_ND = 38, 232 BuiltinOperator_TRANSPOSE = 39, 233 BuiltinOperator_MEAN = 40, 234 BuiltinOperator_SUB = 41, 235 BuiltinOperator_DIV = 42, 236 BuiltinOperator_SQUEEZE = 43, 237 BuiltinOperator_UNIDIRECTIONAL_SEQUENCE_LSTM = 44, 238 BuiltinOperator_STRIDED_SLICE = 45, 239 BuiltinOperator_BIDIRECTIONAL_SEQUENCE_RNN = 46, 240 BuiltinOperator_EXP = 47, 241 BuiltinOperator_TOPK_V2 = 48, 242 BuiltinOperator_SPLIT = 49, 243 BuiltinOperator_MIN = BuiltinOperator_ADD, 244 BuiltinOperator_MAX = BuiltinOperator_SPLIT 245 }; 246 247 inline BuiltinOperator (&EnumValuesBuiltinOperator())[47] { 248 static BuiltinOperator values[] = { 249 BuiltinOperator_ADD, 250 BuiltinOperator_AVERAGE_POOL_2D, 251 BuiltinOperator_CONCATENATION, 252 BuiltinOperator_CONV_2D, 253 BuiltinOperator_DEPTHWISE_CONV_2D, 254 BuiltinOperator_EMBEDDING_LOOKUP, 255 BuiltinOperator_FULLY_CONNECTED, 256 BuiltinOperator_HASHTABLE_LOOKUP, 257 BuiltinOperator_L2_NORMALIZATION, 258 BuiltinOperator_L2_POOL_2D, 259 BuiltinOperator_LOCAL_RESPONSE_NORMALIZATION, 260 BuiltinOperator_LOGISTIC, 261 BuiltinOperator_LSH_PROJECTION, 262 BuiltinOperator_LSTM, 263 BuiltinOperator_MAX_POOL_2D, 264 BuiltinOperator_MUL, 265 BuiltinOperator_RELU, 266 BuiltinOperator_RELU_N1_TO_1, 267 BuiltinOperator_RELU6, 268 BuiltinOperator_RESHAPE, 269 BuiltinOperator_RESIZE_BILINEAR, 270 BuiltinOperator_RNN, 271 BuiltinOperator_SOFTMAX, 272 BuiltinOperator_SPACE_TO_DEPTH, 273 BuiltinOperator_SVDF, 274 BuiltinOperator_TANH, 275 BuiltinOperator_CONCAT_EMBEDDINGS, 276 BuiltinOperator_SKIP_GRAM, 277 BuiltinOperator_CALL, 278 BuiltinOperator_CUSTOM, 279 BuiltinOperator_EMBEDDING_LOOKUP_SPARSE, 280 BuiltinOperator_PAD, 281 BuiltinOperator_UNIDIRECTIONAL_SEQUENCE_RNN, 282 BuiltinOperator_GATHER, 283 BuiltinOperator_BATCH_TO_SPACE_ND, 284 BuiltinOperator_SPACE_TO_BATCH_ND, 285 BuiltinOperator_TRANSPOSE, 286 BuiltinOperator_MEAN, 287 BuiltinOperator_SUB, 288 BuiltinOperator_DIV, 289 BuiltinOperator_SQUEEZE, 290 BuiltinOperator_UNIDIRECTIONAL_SEQUENCE_LSTM, 291 BuiltinOperator_STRIDED_SLICE, 292 BuiltinOperator_BIDIRECTIONAL_SEQUENCE_RNN, 293 BuiltinOperator_EXP, 294 BuiltinOperator_TOPK_V2, 295 BuiltinOperator_SPLIT 296 }; 297 return values; 298 } 299 300 inline const char **EnumNamesBuiltinOperator() { 301 static const char *names[] = { 302 "ADD", 303 "AVERAGE_POOL_2D", 304 "CONCATENATION", 305 "CONV_2D", 306 "DEPTHWISE_CONV_2D", 307 "", 308 "", 309 "EMBEDDING_LOOKUP", 310 "", 311 "FULLY_CONNECTED", 312 "HASHTABLE_LOOKUP", 313 "L2_NORMALIZATION", 314 "L2_POOL_2D", 315 "LOCAL_RESPONSE_NORMALIZATION", 316 "LOGISTIC", 317 "LSH_PROJECTION", 318 "LSTM", 319 "MAX_POOL_2D", 320 "MUL", 321 "RELU", 322 "RELU_N1_TO_1", 323 "RELU6", 324 "RESHAPE", 325 "RESIZE_BILINEAR", 326 "RNN", 327 "SOFTMAX", 328 "SPACE_TO_DEPTH", 329 "SVDF", 330 "TANH", 331 "CONCAT_EMBEDDINGS", 332 "SKIP_GRAM", 333 "CALL", 334 "CUSTOM", 335 "EMBEDDING_LOOKUP_SPARSE", 336 "PAD", 337 "UNIDIRECTIONAL_SEQUENCE_RNN", 338 "GATHER", 339 "BATCH_TO_SPACE_ND", 340 "SPACE_TO_BATCH_ND", 341 "TRANSPOSE", 342 "MEAN", 343 "SUB", 344 "DIV", 345 "SQUEEZE", 346 "UNIDIRECTIONAL_SEQUENCE_LSTM", 347 "STRIDED_SLICE", 348 "BIDIRECTIONAL_SEQUENCE_RNN", 349 "EXP", 350 "TOPK_V2", 351 "SPLIT", 352 nullptr 353 }; 354 return names; 355 } 356 357 inline const char *EnumNameBuiltinOperator(BuiltinOperator e) { 358 const size_t index = static_cast<int>(e); 359 return EnumNamesBuiltinOperator()[index]; 360 } 361 362 enum BuiltinOptions { 363 BuiltinOptions_NONE = 0, 364 BuiltinOptions_Conv2DOptions = 1, 365 BuiltinOptions_DepthwiseConv2DOptions = 2, 366 BuiltinOptions_ConcatEmbeddingsOptions = 3, 367 BuiltinOptions_LSHProjectionOptions = 4, 368 BuiltinOptions_Pool2DOptions = 5, 369 BuiltinOptions_SVDFOptions = 6, 370 BuiltinOptions_RNNOptions = 7, 371 BuiltinOptions_FullyConnectedOptions = 8, 372 BuiltinOptions_SoftmaxOptions = 9, 373 BuiltinOptions_ConcatenationOptions = 10, 374 BuiltinOptions_AddOptions = 11, 375 BuiltinOptions_L2NormOptions = 12, 376 BuiltinOptions_LocalResponseNormalizationOptions = 13, 377 BuiltinOptions_LSTMOptions = 14, 378 BuiltinOptions_ResizeBilinearOptions = 15, 379 BuiltinOptions_CallOptions = 16, 380 BuiltinOptions_ReshapeOptions = 17, 381 BuiltinOptions_SkipGramOptions = 18, 382 BuiltinOptions_SpaceToDepthOptions = 19, 383 BuiltinOptions_EmbeddingLookupSparseOptions = 20, 384 BuiltinOptions_MulOptions = 21, 385 BuiltinOptions_PadOptions = 22, 386 BuiltinOptions_GatherOptions = 23, 387 BuiltinOptions_BatchToSpaceNDOptions = 24, 388 BuiltinOptions_SpaceToBatchNDOptions = 25, 389 BuiltinOptions_TransposeOptions = 26, 390 BuiltinOptions_MeanOptions = 27, 391 BuiltinOptions_SubOptions = 28, 392 BuiltinOptions_DivOptions = 29, 393 BuiltinOptions_SqueezeOptions = 30, 394 BuiltinOptions_SequenceRNNOptions = 31, 395 BuiltinOptions_StridedSliceOptions = 32, 396 BuiltinOptions_ExpOptions = 33, 397 BuiltinOptions_TopKV2Options = 34, 398 BuiltinOptions_SplitOptions = 35, 399 BuiltinOptions_MIN = BuiltinOptions_NONE, 400 BuiltinOptions_MAX = BuiltinOptions_SplitOptions 401 }; 402 403 inline BuiltinOptions (&EnumValuesBuiltinOptions())[36] { 404 static BuiltinOptions values[] = { 405 BuiltinOptions_NONE, 406 BuiltinOptions_Conv2DOptions, 407 BuiltinOptions_DepthwiseConv2DOptions, 408 BuiltinOptions_ConcatEmbeddingsOptions, 409 BuiltinOptions_LSHProjectionOptions, 410 BuiltinOptions_Pool2DOptions, 411 BuiltinOptions_SVDFOptions, 412 BuiltinOptions_RNNOptions, 413 BuiltinOptions_FullyConnectedOptions, 414 BuiltinOptions_SoftmaxOptions, 415 BuiltinOptions_ConcatenationOptions, 416 BuiltinOptions_AddOptions, 417 BuiltinOptions_L2NormOptions, 418 BuiltinOptions_LocalResponseNormalizationOptions, 419 BuiltinOptions_LSTMOptions, 420 BuiltinOptions_ResizeBilinearOptions, 421 BuiltinOptions_CallOptions, 422 BuiltinOptions_ReshapeOptions, 423 BuiltinOptions_SkipGramOptions, 424 BuiltinOptions_SpaceToDepthOptions, 425 BuiltinOptions_EmbeddingLookupSparseOptions, 426 BuiltinOptions_MulOptions, 427 BuiltinOptions_PadOptions, 428 BuiltinOptions_GatherOptions, 429 BuiltinOptions_BatchToSpaceNDOptions, 430 BuiltinOptions_SpaceToBatchNDOptions, 431 BuiltinOptions_TransposeOptions, 432 BuiltinOptions_MeanOptions, 433 BuiltinOptions_SubOptions, 434 BuiltinOptions_DivOptions, 435 BuiltinOptions_SqueezeOptions, 436 BuiltinOptions_SequenceRNNOptions, 437 BuiltinOptions_StridedSliceOptions, 438 BuiltinOptions_ExpOptions, 439 BuiltinOptions_TopKV2Options, 440 BuiltinOptions_SplitOptions 441 }; 442 return values; 443 } 444 445 inline const char **EnumNamesBuiltinOptions() { 446 static const char *names[] = { 447 "NONE", 448 "Conv2DOptions", 449 "DepthwiseConv2DOptions", 450 "ConcatEmbeddingsOptions", 451 "LSHProjectionOptions", 452 "Pool2DOptions", 453 "SVDFOptions", 454 "RNNOptions", 455 "FullyConnectedOptions", 456 "SoftmaxOptions", 457 "ConcatenationOptions", 458 "AddOptions", 459 "L2NormOptions", 460 "LocalResponseNormalizationOptions", 461 "LSTMOptions", 462 "ResizeBilinearOptions", 463 "CallOptions", 464 "ReshapeOptions", 465 "SkipGramOptions", 466 "SpaceToDepthOptions", 467 "EmbeddingLookupSparseOptions", 468 "MulOptions", 469 "PadOptions", 470 "GatherOptions", 471 "BatchToSpaceNDOptions", 472 "SpaceToBatchNDOptions", 473 "TransposeOptions", 474 "MeanOptions", 475 "SubOptions", 476 "DivOptions", 477 "SqueezeOptions", 478 "SequenceRNNOptions", 479 "StridedSliceOptions", 480 "ExpOptions", 481 "TopKV2Options", 482 "SplitOptions", 483 nullptr 484 }; 485 return names; 486 } 487 488 inline const char *EnumNameBuiltinOptions(BuiltinOptions e) { 489 const size_t index = static_cast<int>(e); 490 return EnumNamesBuiltinOptions()[index]; 491 } 492 493 template<typename T> struct BuiltinOptionsTraits { 494 static const BuiltinOptions enum_value = BuiltinOptions_NONE; 495 }; 496 497 template<> struct BuiltinOptionsTraits<Conv2DOptions> { 498 static const BuiltinOptions enum_value = BuiltinOptions_Conv2DOptions; 499 }; 500 501 template<> struct BuiltinOptionsTraits<DepthwiseConv2DOptions> { 502 static const BuiltinOptions enum_value = BuiltinOptions_DepthwiseConv2DOptions; 503 }; 504 505 template<> struct BuiltinOptionsTraits<ConcatEmbeddingsOptions> { 506 static const BuiltinOptions enum_value = BuiltinOptions_ConcatEmbeddingsOptions; 507 }; 508 509 template<> struct BuiltinOptionsTraits<LSHProjectionOptions> { 510 static const BuiltinOptions enum_value = BuiltinOptions_LSHProjectionOptions; 511 }; 512 513 template<> struct BuiltinOptionsTraits<Pool2DOptions> { 514 static const BuiltinOptions enum_value = BuiltinOptions_Pool2DOptions; 515 }; 516 517 template<> struct BuiltinOptionsTraits<SVDFOptions> { 518 static const BuiltinOptions enum_value = BuiltinOptions_SVDFOptions; 519 }; 520 521 template<> struct BuiltinOptionsTraits<RNNOptions> { 522 static const BuiltinOptions enum_value = BuiltinOptions_RNNOptions; 523 }; 524 525 template<> struct BuiltinOptionsTraits<FullyConnectedOptions> { 526 static const BuiltinOptions enum_value = BuiltinOptions_FullyConnectedOptions; 527 }; 528 529 template<> struct BuiltinOptionsTraits<SoftmaxOptions> { 530 static const BuiltinOptions enum_value = BuiltinOptions_SoftmaxOptions; 531 }; 532 533 template<> struct BuiltinOptionsTraits<ConcatenationOptions> { 534 static const BuiltinOptions enum_value = BuiltinOptions_ConcatenationOptions; 535 }; 536 537 template<> struct BuiltinOptionsTraits<AddOptions> { 538 static const BuiltinOptions enum_value = BuiltinOptions_AddOptions; 539 }; 540 541 template<> struct BuiltinOptionsTraits<L2NormOptions> { 542 static const BuiltinOptions enum_value = BuiltinOptions_L2NormOptions; 543 }; 544 545 template<> struct BuiltinOptionsTraits<LocalResponseNormalizationOptions> { 546 static const BuiltinOptions enum_value = BuiltinOptions_LocalResponseNormalizationOptions; 547 }; 548 549 template<> struct BuiltinOptionsTraits<LSTMOptions> { 550 static const BuiltinOptions enum_value = BuiltinOptions_LSTMOptions; 551 }; 552 553 template<> struct BuiltinOptionsTraits<ResizeBilinearOptions> { 554 static const BuiltinOptions enum_value = BuiltinOptions_ResizeBilinearOptions; 555 }; 556 557 template<> struct BuiltinOptionsTraits<CallOptions> { 558 static const BuiltinOptions enum_value = BuiltinOptions_CallOptions; 559 }; 560 561 template<> struct BuiltinOptionsTraits<ReshapeOptions> { 562 static const BuiltinOptions enum_value = BuiltinOptions_ReshapeOptions; 563 }; 564 565 template<> struct BuiltinOptionsTraits<SkipGramOptions> { 566 static const BuiltinOptions enum_value = BuiltinOptions_SkipGramOptions; 567 }; 568 569 template<> struct BuiltinOptionsTraits<SpaceToDepthOptions> { 570 static const BuiltinOptions enum_value = BuiltinOptions_SpaceToDepthOptions; 571 }; 572 573 template<> struct BuiltinOptionsTraits<EmbeddingLookupSparseOptions> { 574 static const BuiltinOptions enum_value = BuiltinOptions_EmbeddingLookupSparseOptions; 575 }; 576 577 template<> struct BuiltinOptionsTraits<MulOptions> { 578 static const BuiltinOptions enum_value = BuiltinOptions_MulOptions; 579 }; 580 581 template<> struct BuiltinOptionsTraits<PadOptions> { 582 static const BuiltinOptions enum_value = BuiltinOptions_PadOptions; 583 }; 584 585 template<> struct BuiltinOptionsTraits<GatherOptions> { 586 static const BuiltinOptions enum_value = BuiltinOptions_GatherOptions; 587 }; 588 589 template<> struct BuiltinOptionsTraits<BatchToSpaceNDOptions> { 590 static const BuiltinOptions enum_value = BuiltinOptions_BatchToSpaceNDOptions; 591 }; 592 593 template<> struct BuiltinOptionsTraits<SpaceToBatchNDOptions> { 594 static const BuiltinOptions enum_value = BuiltinOptions_SpaceToBatchNDOptions; 595 }; 596 597 template<> struct BuiltinOptionsTraits<TransposeOptions> { 598 static const BuiltinOptions enum_value = BuiltinOptions_TransposeOptions; 599 }; 600 601 template<> struct BuiltinOptionsTraits<MeanOptions> { 602 static const BuiltinOptions enum_value = BuiltinOptions_MeanOptions; 603 }; 604 605 template<> struct BuiltinOptionsTraits<SubOptions> { 606 static const BuiltinOptions enum_value = BuiltinOptions_SubOptions; 607 }; 608 609 template<> struct BuiltinOptionsTraits<DivOptions> { 610 static const BuiltinOptions enum_value = BuiltinOptions_DivOptions; 611 }; 612 613 template<> struct BuiltinOptionsTraits<SqueezeOptions> { 614 static const BuiltinOptions enum_value = BuiltinOptions_SqueezeOptions; 615 }; 616 617 template<> struct BuiltinOptionsTraits<SequenceRNNOptions> { 618 static const BuiltinOptions enum_value = BuiltinOptions_SequenceRNNOptions; 619 }; 620 621 template<> struct BuiltinOptionsTraits<StridedSliceOptions> { 622 static const BuiltinOptions enum_value = BuiltinOptions_StridedSliceOptions; 623 }; 624 625 template<> struct BuiltinOptionsTraits<ExpOptions> { 626 static const BuiltinOptions enum_value = BuiltinOptions_ExpOptions; 627 }; 628 629 template<> struct BuiltinOptionsTraits<TopKV2Options> { 630 static const BuiltinOptions enum_value = BuiltinOptions_TopKV2Options; 631 }; 632 633 template<> struct BuiltinOptionsTraits<SplitOptions> { 634 static const BuiltinOptions enum_value = BuiltinOptions_SplitOptions; 635 }; 636 637 struct BuiltinOptionsUnion { 638 BuiltinOptions type; 639 void *value; 640 641 BuiltinOptionsUnion() : type(BuiltinOptions_NONE), value(nullptr) {} 642 BuiltinOptionsUnion(BuiltinOptionsUnion&& u) FLATBUFFERS_NOEXCEPT : 643 type(BuiltinOptions_NONE), value(nullptr) 644 { std::swap(type, u.type); std::swap(value, u.value); } 645 BuiltinOptionsUnion(const BuiltinOptionsUnion &) FLATBUFFERS_NOEXCEPT; 646 BuiltinOptionsUnion &operator=(const BuiltinOptionsUnion &u) FLATBUFFERS_NOEXCEPT 647 { BuiltinOptionsUnion t(u); std::swap(type, t.type); std::swap(value, t.value); return *this; } 648 BuiltinOptionsUnion &operator=(BuiltinOptionsUnion &&u) FLATBUFFERS_NOEXCEPT 649 { std::swap(type, u.type); std::swap(value, u.value); return *this; } 650 ~BuiltinOptionsUnion() { Reset(); } 651 652 void Reset(); 653 654 #ifndef FLATBUFFERS_CPP98_STL 655 template <typename T> 656 void Set(T&& val) { 657 Reset(); 658 type = BuiltinOptionsTraits<typename T::TableType>::enum_value; 659 if (type != BuiltinOptions_NONE) { 660 value = new T(std::forward<T>(val)); 661 } 662 } 663 #endif // FLATBUFFERS_CPP98_STL 664 665 static void *UnPack(const void *obj, BuiltinOptions type, const flatbuffers::resolver_function_t *resolver); 666 flatbuffers::Offset<void> Pack(flatbuffers::FlatBufferBuilder &_fbb, const flatbuffers::rehasher_function_t *_rehasher = nullptr) const; 667 668 Conv2DOptionsT *AsConv2DOptions() { 669 return type == BuiltinOptions_Conv2DOptions ? 670 reinterpret_cast<Conv2DOptionsT *>(value) : nullptr; 671 } 672 const Conv2DOptionsT *AsConv2DOptions() const { 673 return type == BuiltinOptions_Conv2DOptions ? 674 reinterpret_cast<const Conv2DOptionsT *>(value) : nullptr; 675 } 676 DepthwiseConv2DOptionsT *AsDepthwiseConv2DOptions() { 677 return type == BuiltinOptions_DepthwiseConv2DOptions ? 678 reinterpret_cast<DepthwiseConv2DOptionsT *>(value) : nullptr; 679 } 680 const DepthwiseConv2DOptionsT *AsDepthwiseConv2DOptions() const { 681 return type == BuiltinOptions_DepthwiseConv2DOptions ? 682 reinterpret_cast<const DepthwiseConv2DOptionsT *>(value) : nullptr; 683 } 684 ConcatEmbeddingsOptionsT *AsConcatEmbeddingsOptions() { 685 return type == BuiltinOptions_ConcatEmbeddingsOptions ? 686 reinterpret_cast<ConcatEmbeddingsOptionsT *>(value) : nullptr; 687 } 688 const ConcatEmbeddingsOptionsT *AsConcatEmbeddingsOptions() const { 689 return type == BuiltinOptions_ConcatEmbeddingsOptions ? 690 reinterpret_cast<const ConcatEmbeddingsOptionsT *>(value) : nullptr; 691 } 692 LSHProjectionOptionsT *AsLSHProjectionOptions() { 693 return type == BuiltinOptions_LSHProjectionOptions ? 694 reinterpret_cast<LSHProjectionOptionsT *>(value) : nullptr; 695 } 696 const LSHProjectionOptionsT *AsLSHProjectionOptions() const { 697 return type == BuiltinOptions_LSHProjectionOptions ? 698 reinterpret_cast<const LSHProjectionOptionsT *>(value) : nullptr; 699 } 700 Pool2DOptionsT *AsPool2DOptions() { 701 return type == BuiltinOptions_Pool2DOptions ? 702 reinterpret_cast<Pool2DOptionsT *>(value) : nullptr; 703 } 704 const Pool2DOptionsT *AsPool2DOptions() const { 705 return type == BuiltinOptions_Pool2DOptions ? 706 reinterpret_cast<const Pool2DOptionsT *>(value) : nullptr; 707 } 708 SVDFOptionsT *AsSVDFOptions() { 709 return type == BuiltinOptions_SVDFOptions ? 710 reinterpret_cast<SVDFOptionsT *>(value) : nullptr; 711 } 712 const SVDFOptionsT *AsSVDFOptions() const { 713 return type == BuiltinOptions_SVDFOptions ? 714 reinterpret_cast<const SVDFOptionsT *>(value) : nullptr; 715 } 716 RNNOptionsT *AsRNNOptions() { 717 return type == BuiltinOptions_RNNOptions ? 718 reinterpret_cast<RNNOptionsT *>(value) : nullptr; 719 } 720 const RNNOptionsT *AsRNNOptions() const { 721 return type == BuiltinOptions_RNNOptions ? 722 reinterpret_cast<const RNNOptionsT *>(value) : nullptr; 723 } 724 FullyConnectedOptionsT *AsFullyConnectedOptions() { 725 return type == BuiltinOptions_FullyConnectedOptions ? 726 reinterpret_cast<FullyConnectedOptionsT *>(value) : nullptr; 727 } 728 const FullyConnectedOptionsT *AsFullyConnectedOptions() const { 729 return type == BuiltinOptions_FullyConnectedOptions ? 730 reinterpret_cast<const FullyConnectedOptionsT *>(value) : nullptr; 731 } 732 SoftmaxOptionsT *AsSoftmaxOptions() { 733 return type == BuiltinOptions_SoftmaxOptions ? 734 reinterpret_cast<SoftmaxOptionsT *>(value) : nullptr; 735 } 736 const SoftmaxOptionsT *AsSoftmaxOptions() const { 737 return type == BuiltinOptions_SoftmaxOptions ? 738 reinterpret_cast<const SoftmaxOptionsT *>(value) : nullptr; 739 } 740 ConcatenationOptionsT *AsConcatenationOptions() { 741 return type == BuiltinOptions_ConcatenationOptions ? 742 reinterpret_cast<ConcatenationOptionsT *>(value) : nullptr; 743 } 744 const ConcatenationOptionsT *AsConcatenationOptions() const { 745 return type == BuiltinOptions_ConcatenationOptions ? 746 reinterpret_cast<const ConcatenationOptionsT *>(value) : nullptr; 747 } 748 AddOptionsT *AsAddOptions() { 749 return type == BuiltinOptions_AddOptions ? 750 reinterpret_cast<AddOptionsT *>(value) : nullptr; 751 } 752 const AddOptionsT *AsAddOptions() const { 753 return type == BuiltinOptions_AddOptions ? 754 reinterpret_cast<const AddOptionsT *>(value) : nullptr; 755 } 756 L2NormOptionsT *AsL2NormOptions() { 757 return type == BuiltinOptions_L2NormOptions ? 758 reinterpret_cast<L2NormOptionsT *>(value) : nullptr; 759 } 760 const L2NormOptionsT *AsL2NormOptions() const { 761 return type == BuiltinOptions_L2NormOptions ? 762 reinterpret_cast<const L2NormOptionsT *>(value) : nullptr; 763 } 764 LocalResponseNormalizationOptionsT *AsLocalResponseNormalizationOptions() { 765 return type == BuiltinOptions_LocalResponseNormalizationOptions ? 766 reinterpret_cast<LocalResponseNormalizationOptionsT *>(value) : nullptr; 767 } 768 const LocalResponseNormalizationOptionsT *AsLocalResponseNormalizationOptions() const { 769 return type == BuiltinOptions_LocalResponseNormalizationOptions ? 770 reinterpret_cast<const LocalResponseNormalizationOptionsT *>(value) : nullptr; 771 } 772 LSTMOptionsT *AsLSTMOptions() { 773 return type == BuiltinOptions_LSTMOptions ? 774 reinterpret_cast<LSTMOptionsT *>(value) : nullptr; 775 } 776 const LSTMOptionsT *AsLSTMOptions() const { 777 return type == BuiltinOptions_LSTMOptions ? 778 reinterpret_cast<const LSTMOptionsT *>(value) : nullptr; 779 } 780 ResizeBilinearOptionsT *AsResizeBilinearOptions() { 781 return type == BuiltinOptions_ResizeBilinearOptions ? 782 reinterpret_cast<ResizeBilinearOptionsT *>(value) : nullptr; 783 } 784 const ResizeBilinearOptionsT *AsResizeBilinearOptions() const { 785 return type == BuiltinOptions_ResizeBilinearOptions ? 786 reinterpret_cast<const ResizeBilinearOptionsT *>(value) : nullptr; 787 } 788 CallOptionsT *AsCallOptions() { 789 return type == BuiltinOptions_CallOptions ? 790 reinterpret_cast<CallOptionsT *>(value) : nullptr; 791 } 792 const CallOptionsT *AsCallOptions() const { 793 return type == BuiltinOptions_CallOptions ? 794 reinterpret_cast<const CallOptionsT *>(value) : nullptr; 795 } 796 ReshapeOptionsT *AsReshapeOptions() { 797 return type == BuiltinOptions_ReshapeOptions ? 798 reinterpret_cast<ReshapeOptionsT *>(value) : nullptr; 799 } 800 const ReshapeOptionsT *AsReshapeOptions() const { 801 return type == BuiltinOptions_ReshapeOptions ? 802 reinterpret_cast<const ReshapeOptionsT *>(value) : nullptr; 803 } 804 SkipGramOptionsT *AsSkipGramOptions() { 805 return type == BuiltinOptions_SkipGramOptions ? 806 reinterpret_cast<SkipGramOptionsT *>(value) : nullptr; 807 } 808 const SkipGramOptionsT *AsSkipGramOptions() const { 809 return type == BuiltinOptions_SkipGramOptions ? 810 reinterpret_cast<const SkipGramOptionsT *>(value) : nullptr; 811 } 812 SpaceToDepthOptionsT *AsSpaceToDepthOptions() { 813 return type == BuiltinOptions_SpaceToDepthOptions ? 814 reinterpret_cast<SpaceToDepthOptionsT *>(value) : nullptr; 815 } 816 const SpaceToDepthOptionsT *AsSpaceToDepthOptions() const { 817 return type == BuiltinOptions_SpaceToDepthOptions ? 818 reinterpret_cast<const SpaceToDepthOptionsT *>(value) : nullptr; 819 } 820 EmbeddingLookupSparseOptionsT *AsEmbeddingLookupSparseOptions() { 821 return type == BuiltinOptions_EmbeddingLookupSparseOptions ? 822 reinterpret_cast<EmbeddingLookupSparseOptionsT *>(value) : nullptr; 823 } 824 const EmbeddingLookupSparseOptionsT *AsEmbeddingLookupSparseOptions() const { 825 return type == BuiltinOptions_EmbeddingLookupSparseOptions ? 826 reinterpret_cast<const EmbeddingLookupSparseOptionsT *>(value) : nullptr; 827 } 828 MulOptionsT *AsMulOptions() { 829 return type == BuiltinOptions_MulOptions ? 830 reinterpret_cast<MulOptionsT *>(value) : nullptr; 831 } 832 const MulOptionsT *AsMulOptions() const { 833 return type == BuiltinOptions_MulOptions ? 834 reinterpret_cast<const MulOptionsT *>(value) : nullptr; 835 } 836 PadOptionsT *AsPadOptions() { 837 return type == BuiltinOptions_PadOptions ? 838 reinterpret_cast<PadOptionsT *>(value) : nullptr; 839 } 840 const PadOptionsT *AsPadOptions() const { 841 return type == BuiltinOptions_PadOptions ? 842 reinterpret_cast<const PadOptionsT *>(value) : nullptr; 843 } 844 GatherOptionsT *AsGatherOptions() { 845 return type == BuiltinOptions_GatherOptions ? 846 reinterpret_cast<GatherOptionsT *>(value) : nullptr; 847 } 848 const GatherOptionsT *AsGatherOptions() const { 849 return type == BuiltinOptions_GatherOptions ? 850 reinterpret_cast<const GatherOptionsT *>(value) : nullptr; 851 } 852 BatchToSpaceNDOptionsT *AsBatchToSpaceNDOptions() { 853 return type == BuiltinOptions_BatchToSpaceNDOptions ? 854 reinterpret_cast<BatchToSpaceNDOptionsT *>(value) : nullptr; 855 } 856 const BatchToSpaceNDOptionsT *AsBatchToSpaceNDOptions() const { 857 return type == BuiltinOptions_BatchToSpaceNDOptions ? 858 reinterpret_cast<const BatchToSpaceNDOptionsT *>(value) : nullptr; 859 } 860 SpaceToBatchNDOptionsT *AsSpaceToBatchNDOptions() { 861 return type == BuiltinOptions_SpaceToBatchNDOptions ? 862 reinterpret_cast<SpaceToBatchNDOptionsT *>(value) : nullptr; 863 } 864 const SpaceToBatchNDOptionsT *AsSpaceToBatchNDOptions() const { 865 return type == BuiltinOptions_SpaceToBatchNDOptions ? 866 reinterpret_cast<const SpaceToBatchNDOptionsT *>(value) : nullptr; 867 } 868 TransposeOptionsT *AsTransposeOptions() { 869 return type == BuiltinOptions_TransposeOptions ? 870 reinterpret_cast<TransposeOptionsT *>(value) : nullptr; 871 } 872 const TransposeOptionsT *AsTransposeOptions() const { 873 return type == BuiltinOptions_TransposeOptions ? 874 reinterpret_cast<const TransposeOptionsT *>(value) : nullptr; 875 } 876 MeanOptionsT *AsMeanOptions() { 877 return type == BuiltinOptions_MeanOptions ? 878 reinterpret_cast<MeanOptionsT *>(value) : nullptr; 879 } 880 const MeanOptionsT *AsMeanOptions() const { 881 return type == BuiltinOptions_MeanOptions ? 882 reinterpret_cast<const MeanOptionsT *>(value) : nullptr; 883 } 884 SubOptionsT *AsSubOptions() { 885 return type == BuiltinOptions_SubOptions ? 886 reinterpret_cast<SubOptionsT *>(value) : nullptr; 887 } 888 const SubOptionsT *AsSubOptions() const { 889 return type == BuiltinOptions_SubOptions ? 890 reinterpret_cast<const SubOptionsT *>(value) : nullptr; 891 } 892 DivOptionsT *AsDivOptions() { 893 return type == BuiltinOptions_DivOptions ? 894 reinterpret_cast<DivOptionsT *>(value) : nullptr; 895 } 896 const DivOptionsT *AsDivOptions() const { 897 return type == BuiltinOptions_DivOptions ? 898 reinterpret_cast<const DivOptionsT *>(value) : nullptr; 899 } 900 SqueezeOptionsT *AsSqueezeOptions() { 901 return type == BuiltinOptions_SqueezeOptions ? 902 reinterpret_cast<SqueezeOptionsT *>(value) : nullptr; 903 } 904 const SqueezeOptionsT *AsSqueezeOptions() const { 905 return type == BuiltinOptions_SqueezeOptions ? 906 reinterpret_cast<const SqueezeOptionsT *>(value) : nullptr; 907 } 908 SequenceRNNOptionsT *AsSequenceRNNOptions() { 909 return type == BuiltinOptions_SequenceRNNOptions ? 910 reinterpret_cast<SequenceRNNOptionsT *>(value) : nullptr; 911 } 912 const SequenceRNNOptionsT *AsSequenceRNNOptions() const { 913 return type == BuiltinOptions_SequenceRNNOptions ? 914 reinterpret_cast<const SequenceRNNOptionsT *>(value) : nullptr; 915 } 916 StridedSliceOptionsT *AsStridedSliceOptions() { 917 return type == BuiltinOptions_StridedSliceOptions ? 918 reinterpret_cast<StridedSliceOptionsT *>(value) : nullptr; 919 } 920 const StridedSliceOptionsT *AsStridedSliceOptions() const { 921 return type == BuiltinOptions_StridedSliceOptions ? 922 reinterpret_cast<const StridedSliceOptionsT *>(value) : nullptr; 923 } 924 ExpOptionsT *AsExpOptions() { 925 return type == BuiltinOptions_ExpOptions ? 926 reinterpret_cast<ExpOptionsT *>(value) : nullptr; 927 } 928 const ExpOptionsT *AsExpOptions() const { 929 return type == BuiltinOptions_ExpOptions ? 930 reinterpret_cast<const ExpOptionsT *>(value) : nullptr; 931 } 932 TopKV2OptionsT *AsTopKV2Options() { 933 return type == BuiltinOptions_TopKV2Options ? 934 reinterpret_cast<TopKV2OptionsT *>(value) : nullptr; 935 } 936 const TopKV2OptionsT *AsTopKV2Options() const { 937 return type == BuiltinOptions_TopKV2Options ? 938 reinterpret_cast<const TopKV2OptionsT *>(value) : nullptr; 939 } 940 SplitOptionsT *AsSplitOptions() { 941 return type == BuiltinOptions_SplitOptions ? 942 reinterpret_cast<SplitOptionsT *>(value) : nullptr; 943 } 944 const SplitOptionsT *AsSplitOptions() const { 945 return type == BuiltinOptions_SplitOptions ? 946 reinterpret_cast<const SplitOptionsT *>(value) : nullptr; 947 } 948 }; 949 950 bool VerifyBuiltinOptions(flatbuffers::Verifier &verifier, const void *obj, BuiltinOptions type); 951 bool VerifyBuiltinOptionsVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector<flatbuffers::Offset<void>> *values, const flatbuffers::Vector<uint8_t> *types); 952 953 enum Padding { 954 Padding_SAME = 0, 955 Padding_VALID = 1, 956 Padding_MIN = Padding_SAME, 957 Padding_MAX = Padding_VALID 958 }; 959 960 inline Padding (&EnumValuesPadding())[2] { 961 static Padding values[] = { 962 Padding_SAME, 963 Padding_VALID 964 }; 965 return values; 966 } 967 968 inline const char **EnumNamesPadding() { 969 static const char *names[] = { 970 "SAME", 971 "VALID", 972 nullptr 973 }; 974 return names; 975 } 976 977 inline const char *EnumNamePadding(Padding e) { 978 const size_t index = static_cast<int>(e); 979 return EnumNamesPadding()[index]; 980 } 981 982 enum ActivationFunctionType { 983 ActivationFunctionType_NONE = 0, 984 ActivationFunctionType_RELU = 1, 985 ActivationFunctionType_RELU_N1_TO_1 = 2, 986 ActivationFunctionType_RELU6 = 3, 987 ActivationFunctionType_TANH = 4, 988 ActivationFunctionType_SIGN_BIT = 5, 989 ActivationFunctionType_MIN = ActivationFunctionType_NONE, 990 ActivationFunctionType_MAX = ActivationFunctionType_SIGN_BIT 991 }; 992 993 inline ActivationFunctionType (&EnumValuesActivationFunctionType())[6] { 994 static ActivationFunctionType values[] = { 995 ActivationFunctionType_NONE, 996 ActivationFunctionType_RELU, 997 ActivationFunctionType_RELU_N1_TO_1, 998 ActivationFunctionType_RELU6, 999 ActivationFunctionType_TANH, 1000 ActivationFunctionType_SIGN_BIT 1001 }; 1002 return values; 1003 } 1004 1005 inline const char **EnumNamesActivationFunctionType() { 1006 static const char *names[] = { 1007 "NONE", 1008 "RELU", 1009 "RELU_N1_TO_1", 1010 "RELU6", 1011 "TANH", 1012 "SIGN_BIT", 1013 nullptr 1014 }; 1015 return names; 1016 } 1017 1018 inline const char *EnumNameActivationFunctionType(ActivationFunctionType e) { 1019 const size_t index = static_cast<int>(e); 1020 return EnumNamesActivationFunctionType()[index]; 1021 } 1022 1023 enum LSHProjectionType { 1024 LSHProjectionType_UNKNOWN = 0, 1025 LSHProjectionType_SPARSE = 1, 1026 LSHProjectionType_DENSE = 2, 1027 LSHProjectionType_MIN = LSHProjectionType_UNKNOWN, 1028 LSHProjectionType_MAX = LSHProjectionType_DENSE 1029 }; 1030 1031 inline LSHProjectionType (&EnumValuesLSHProjectionType())[3] { 1032 static LSHProjectionType values[] = { 1033 LSHProjectionType_UNKNOWN, 1034 LSHProjectionType_SPARSE, 1035 LSHProjectionType_DENSE 1036 }; 1037 return values; 1038 } 1039 1040 inline const char **EnumNamesLSHProjectionType() { 1041 static const char *names[] = { 1042 "UNKNOWN", 1043 "SPARSE", 1044 "DENSE", 1045 nullptr 1046 }; 1047 return names; 1048 } 1049 1050 inline const char *EnumNameLSHProjectionType(LSHProjectionType e) { 1051 const size_t index = static_cast<int>(e); 1052 return EnumNamesLSHProjectionType()[index]; 1053 } 1054 1055 enum CombinerType { 1056 CombinerType_SUM = 0, 1057 CombinerType_MEAN = 1, 1058 CombinerType_SQRTN = 2, 1059 CombinerType_MIN = CombinerType_SUM, 1060 CombinerType_MAX = CombinerType_SQRTN 1061 }; 1062 1063 inline CombinerType (&EnumValuesCombinerType())[3] { 1064 static CombinerType values[] = { 1065 CombinerType_SUM, 1066 CombinerType_MEAN, 1067 CombinerType_SQRTN 1068 }; 1069 return values; 1070 } 1071 1072 inline const char **EnumNamesCombinerType() { 1073 static const char *names[] = { 1074 "SUM", 1075 "MEAN", 1076 "SQRTN", 1077 nullptr 1078 }; 1079 return names; 1080 } 1081 1082 inline const char *EnumNameCombinerType(CombinerType e) { 1083 const size_t index = static_cast<int>(e); 1084 return EnumNamesCombinerType()[index]; 1085 } 1086 1087 enum CustomOptionsFormat { 1088 CustomOptionsFormat_FLEXBUFFERS = 0, 1089 CustomOptionsFormat_MIN = CustomOptionsFormat_FLEXBUFFERS, 1090 CustomOptionsFormat_MAX = CustomOptionsFormat_FLEXBUFFERS 1091 }; 1092 1093 inline CustomOptionsFormat (&EnumValuesCustomOptionsFormat())[1] { 1094 static CustomOptionsFormat values[] = { 1095 CustomOptionsFormat_FLEXBUFFERS 1096 }; 1097 return values; 1098 } 1099 1100 inline const char **EnumNamesCustomOptionsFormat() { 1101 static const char *names[] = { 1102 "FLEXBUFFERS", 1103 nullptr 1104 }; 1105 return names; 1106 } 1107 1108 inline const char *EnumNameCustomOptionsFormat(CustomOptionsFormat e) { 1109 const size_t index = static_cast<int>(e); 1110 return EnumNamesCustomOptionsFormat()[index]; 1111 } 1112 1113 struct QuantizationParametersT : public flatbuffers::NativeTable { 1114 typedef QuantizationParameters TableType; 1115 std::vector<float> min; 1116 std::vector<float> max; 1117 std::vector<float> scale; 1118 std::vector<int64_t> zero_point; 1119 QuantizationParametersT() { 1120 } 1121 }; 1122 1123 struct QuantizationParameters FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 1124 typedef QuantizationParametersT NativeTableType; 1125 enum { 1126 VT_MIN = 4, 1127 VT_MAX = 6, 1128 VT_SCALE = 8, 1129 VT_ZERO_POINT = 10 1130 }; 1131 const flatbuffers::Vector<float> *min() const { 1132 return GetPointer<const flatbuffers::Vector<float> *>(VT_MIN); 1133 } 1134 const flatbuffers::Vector<float> *max() const { 1135 return GetPointer<const flatbuffers::Vector<float> *>(VT_MAX); 1136 } 1137 const flatbuffers::Vector<float> *scale() const { 1138 return GetPointer<const flatbuffers::Vector<float> *>(VT_SCALE); 1139 } 1140 const flatbuffers::Vector<int64_t> *zero_point() const { 1141 return GetPointer<const flatbuffers::Vector<int64_t> *>(VT_ZERO_POINT); 1142 } 1143 bool Verify(flatbuffers::Verifier &verifier) const { 1144 return VerifyTableStart(verifier) && 1145 VerifyOffset(verifier, VT_MIN) && 1146 verifier.Verify(min()) && 1147 VerifyOffset(verifier, VT_MAX) && 1148 verifier.Verify(max()) && 1149 VerifyOffset(verifier, VT_SCALE) && 1150 verifier.Verify(scale()) && 1151 VerifyOffset(verifier, VT_ZERO_POINT) && 1152 verifier.Verify(zero_point()) && 1153 verifier.EndTable(); 1154 } 1155 QuantizationParametersT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 1156 void UnPackTo(QuantizationParametersT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 1157 static flatbuffers::Offset<QuantizationParameters> Pack(flatbuffers::FlatBufferBuilder &_fbb, const QuantizationParametersT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 1158 }; 1159 1160 struct QuantizationParametersBuilder { 1161 flatbuffers::FlatBufferBuilder &fbb_; 1162 flatbuffers::uoffset_t start_; 1163 void add_min(flatbuffers::Offset<flatbuffers::Vector<float>> min) { 1164 fbb_.AddOffset(QuantizationParameters::VT_MIN, min); 1165 } 1166 void add_max(flatbuffers::Offset<flatbuffers::Vector<float>> max) { 1167 fbb_.AddOffset(QuantizationParameters::VT_MAX, max); 1168 } 1169 void add_scale(flatbuffers::Offset<flatbuffers::Vector<float>> scale) { 1170 fbb_.AddOffset(QuantizationParameters::VT_SCALE, scale); 1171 } 1172 void add_zero_point(flatbuffers::Offset<flatbuffers::Vector<int64_t>> zero_point) { 1173 fbb_.AddOffset(QuantizationParameters::VT_ZERO_POINT, zero_point); 1174 } 1175 explicit QuantizationParametersBuilder(flatbuffers::FlatBufferBuilder &_fbb) 1176 : fbb_(_fbb) { 1177 start_ = fbb_.StartTable(); 1178 } 1179 QuantizationParametersBuilder &operator=(const QuantizationParametersBuilder &); 1180 flatbuffers::Offset<QuantizationParameters> Finish() { 1181 const auto end = fbb_.EndTable(start_); 1182 auto o = flatbuffers::Offset<QuantizationParameters>(end); 1183 return o; 1184 } 1185 }; 1186 1187 inline flatbuffers::Offset<QuantizationParameters> CreateQuantizationParameters( 1188 flatbuffers::FlatBufferBuilder &_fbb, 1189 flatbuffers::Offset<flatbuffers::Vector<float>> min = 0, 1190 flatbuffers::Offset<flatbuffers::Vector<float>> max = 0, 1191 flatbuffers::Offset<flatbuffers::Vector<float>> scale = 0, 1192 flatbuffers::Offset<flatbuffers::Vector<int64_t>> zero_point = 0) { 1193 QuantizationParametersBuilder builder_(_fbb); 1194 builder_.add_zero_point(zero_point); 1195 builder_.add_scale(scale); 1196 builder_.add_max(max); 1197 builder_.add_min(min); 1198 return builder_.Finish(); 1199 } 1200 1201 inline flatbuffers::Offset<QuantizationParameters> CreateQuantizationParametersDirect( 1202 flatbuffers::FlatBufferBuilder &_fbb, 1203 const std::vector<float> *min = nullptr, 1204 const std::vector<float> *max = nullptr, 1205 const std::vector<float> *scale = nullptr, 1206 const std::vector<int64_t> *zero_point = nullptr) { 1207 return tflite::CreateQuantizationParameters( 1208 _fbb, 1209 min ? _fbb.CreateVector<float>(*min) : 0, 1210 max ? _fbb.CreateVector<float>(*max) : 0, 1211 scale ? _fbb.CreateVector<float>(*scale) : 0, 1212 zero_point ? _fbb.CreateVector<int64_t>(*zero_point) : 0); 1213 } 1214 1215 flatbuffers::Offset<QuantizationParameters> CreateQuantizationParameters(flatbuffers::FlatBufferBuilder &_fbb, const QuantizationParametersT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 1216 1217 struct TensorT : public flatbuffers::NativeTable { 1218 typedef Tensor TableType; 1219 std::vector<int32_t> shape; 1220 TensorType type; 1221 uint32_t buffer; 1222 std::string name; 1223 std::unique_ptr<QuantizationParametersT> quantization; 1224 TensorT() 1225 : type(TensorType_FLOAT32), 1226 buffer(0) { 1227 } 1228 }; 1229 1230 struct Tensor FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 1231 typedef TensorT NativeTableType; 1232 enum { 1233 VT_SHAPE = 4, 1234 VT_TYPE = 6, 1235 VT_BUFFER = 8, 1236 VT_NAME = 10, 1237 VT_QUANTIZATION = 12 1238 }; 1239 const flatbuffers::Vector<int32_t> *shape() const { 1240 return GetPointer<const flatbuffers::Vector<int32_t> *>(VT_SHAPE); 1241 } 1242 TensorType type() const { 1243 return static_cast<TensorType>(GetField<int8_t>(VT_TYPE, 0)); 1244 } 1245 uint32_t buffer() const { 1246 return GetField<uint32_t>(VT_BUFFER, 0); 1247 } 1248 const flatbuffers::String *name() const { 1249 return GetPointer<const flatbuffers::String *>(VT_NAME); 1250 } 1251 const QuantizationParameters *quantization() const { 1252 return GetPointer<const QuantizationParameters *>(VT_QUANTIZATION); 1253 } 1254 bool Verify(flatbuffers::Verifier &verifier) const { 1255 return VerifyTableStart(verifier) && 1256 VerifyOffset(verifier, VT_SHAPE) && 1257 verifier.Verify(shape()) && 1258 VerifyField<int8_t>(verifier, VT_TYPE) && 1259 VerifyField<uint32_t>(verifier, VT_BUFFER) && 1260 VerifyOffset(verifier, VT_NAME) && 1261 verifier.Verify(name()) && 1262 VerifyOffset(verifier, VT_QUANTIZATION) && 1263 verifier.VerifyTable(quantization()) && 1264 verifier.EndTable(); 1265 } 1266 TensorT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 1267 void UnPackTo(TensorT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 1268 static flatbuffers::Offset<Tensor> Pack(flatbuffers::FlatBufferBuilder &_fbb, const TensorT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 1269 }; 1270 1271 struct TensorBuilder { 1272 flatbuffers::FlatBufferBuilder &fbb_; 1273 flatbuffers::uoffset_t start_; 1274 void add_shape(flatbuffers::Offset<flatbuffers::Vector<int32_t>> shape) { 1275 fbb_.AddOffset(Tensor::VT_SHAPE, shape); 1276 } 1277 void add_type(TensorType type) { 1278 fbb_.AddElement<int8_t>(Tensor::VT_TYPE, static_cast<int8_t>(type), 0); 1279 } 1280 void add_buffer(uint32_t buffer) { 1281 fbb_.AddElement<uint32_t>(Tensor::VT_BUFFER, buffer, 0); 1282 } 1283 void add_name(flatbuffers::Offset<flatbuffers::String> name) { 1284 fbb_.AddOffset(Tensor::VT_NAME, name); 1285 } 1286 void add_quantization(flatbuffers::Offset<QuantizationParameters> quantization) { 1287 fbb_.AddOffset(Tensor::VT_QUANTIZATION, quantization); 1288 } 1289 explicit TensorBuilder(flatbuffers::FlatBufferBuilder &_fbb) 1290 : fbb_(_fbb) { 1291 start_ = fbb_.StartTable(); 1292 } 1293 TensorBuilder &operator=(const TensorBuilder &); 1294 flatbuffers::Offset<Tensor> Finish() { 1295 const auto end = fbb_.EndTable(start_); 1296 auto o = flatbuffers::Offset<Tensor>(end); 1297 return o; 1298 } 1299 }; 1300 1301 inline flatbuffers::Offset<Tensor> CreateTensor( 1302 flatbuffers::FlatBufferBuilder &_fbb, 1303 flatbuffers::Offset<flatbuffers::Vector<int32_t>> shape = 0, 1304 TensorType type = TensorType_FLOAT32, 1305 uint32_t buffer = 0, 1306 flatbuffers::Offset<flatbuffers::String> name = 0, 1307 flatbuffers::Offset<QuantizationParameters> quantization = 0) { 1308 TensorBuilder builder_(_fbb); 1309 builder_.add_quantization(quantization); 1310 builder_.add_name(name); 1311 builder_.add_buffer(buffer); 1312 builder_.add_shape(shape); 1313 builder_.add_type(type); 1314 return builder_.Finish(); 1315 } 1316 1317 inline flatbuffers::Offset<Tensor> CreateTensorDirect( 1318 flatbuffers::FlatBufferBuilder &_fbb, 1319 const std::vector<int32_t> *shape = nullptr, 1320 TensorType type = TensorType_FLOAT32, 1321 uint32_t buffer = 0, 1322 const char *name = nullptr, 1323 flatbuffers::Offset<QuantizationParameters> quantization = 0) { 1324 return tflite::CreateTensor( 1325 _fbb, 1326 shape ? _fbb.CreateVector<int32_t>(*shape) : 0, 1327 type, 1328 buffer, 1329 name ? _fbb.CreateString(name) : 0, 1330 quantization); 1331 } 1332 1333 flatbuffers::Offset<Tensor> CreateTensor(flatbuffers::FlatBufferBuilder &_fbb, const TensorT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 1334 1335 struct Conv2DOptionsT : public flatbuffers::NativeTable { 1336 typedef Conv2DOptions TableType; 1337 Padding padding; 1338 int32_t stride_w; 1339 int32_t stride_h; 1340 ActivationFunctionType fused_activation_function; 1341 Conv2DOptionsT() 1342 : padding(Padding_SAME), 1343 stride_w(0), 1344 stride_h(0), 1345 fused_activation_function(ActivationFunctionType_NONE) { 1346 } 1347 }; 1348 1349 struct Conv2DOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 1350 typedef Conv2DOptionsT NativeTableType; 1351 enum { 1352 VT_PADDING = 4, 1353 VT_STRIDE_W = 6, 1354 VT_STRIDE_H = 8, 1355 VT_FUSED_ACTIVATION_FUNCTION = 10 1356 }; 1357 Padding padding() const { 1358 return static_cast<Padding>(GetField<int8_t>(VT_PADDING, 0)); 1359 } 1360 int32_t stride_w() const { 1361 return GetField<int32_t>(VT_STRIDE_W, 0); 1362 } 1363 int32_t stride_h() const { 1364 return GetField<int32_t>(VT_STRIDE_H, 0); 1365 } 1366 ActivationFunctionType fused_activation_function() const { 1367 return static_cast<ActivationFunctionType>(GetField<int8_t>(VT_FUSED_ACTIVATION_FUNCTION, 0)); 1368 } 1369 bool Verify(flatbuffers::Verifier &verifier) const { 1370 return VerifyTableStart(verifier) && 1371 VerifyField<int8_t>(verifier, VT_PADDING) && 1372 VerifyField<int32_t>(verifier, VT_STRIDE_W) && 1373 VerifyField<int32_t>(verifier, VT_STRIDE_H) && 1374 VerifyField<int8_t>(verifier, VT_FUSED_ACTIVATION_FUNCTION) && 1375 verifier.EndTable(); 1376 } 1377 Conv2DOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 1378 void UnPackTo(Conv2DOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 1379 static flatbuffers::Offset<Conv2DOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const Conv2DOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 1380 }; 1381 1382 struct Conv2DOptionsBuilder { 1383 flatbuffers::FlatBufferBuilder &fbb_; 1384 flatbuffers::uoffset_t start_; 1385 void add_padding(Padding padding) { 1386 fbb_.AddElement<int8_t>(Conv2DOptions::VT_PADDING, static_cast<int8_t>(padding), 0); 1387 } 1388 void add_stride_w(int32_t stride_w) { 1389 fbb_.AddElement<int32_t>(Conv2DOptions::VT_STRIDE_W, stride_w, 0); 1390 } 1391 void add_stride_h(int32_t stride_h) { 1392 fbb_.AddElement<int32_t>(Conv2DOptions::VT_STRIDE_H, stride_h, 0); 1393 } 1394 void add_fused_activation_function(ActivationFunctionType fused_activation_function) { 1395 fbb_.AddElement<int8_t>(Conv2DOptions::VT_FUSED_ACTIVATION_FUNCTION, static_cast<int8_t>(fused_activation_function), 0); 1396 } 1397 explicit Conv2DOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) 1398 : fbb_(_fbb) { 1399 start_ = fbb_.StartTable(); 1400 } 1401 Conv2DOptionsBuilder &operator=(const Conv2DOptionsBuilder &); 1402 flatbuffers::Offset<Conv2DOptions> Finish() { 1403 const auto end = fbb_.EndTable(start_); 1404 auto o = flatbuffers::Offset<Conv2DOptions>(end); 1405 return o; 1406 } 1407 }; 1408 1409 inline flatbuffers::Offset<Conv2DOptions> CreateConv2DOptions( 1410 flatbuffers::FlatBufferBuilder &_fbb, 1411 Padding padding = Padding_SAME, 1412 int32_t stride_w = 0, 1413 int32_t stride_h = 0, 1414 ActivationFunctionType fused_activation_function = ActivationFunctionType_NONE) { 1415 Conv2DOptionsBuilder builder_(_fbb); 1416 builder_.add_stride_h(stride_h); 1417 builder_.add_stride_w(stride_w); 1418 builder_.add_fused_activation_function(fused_activation_function); 1419 builder_.add_padding(padding); 1420 return builder_.Finish(); 1421 } 1422 1423 flatbuffers::Offset<Conv2DOptions> CreateConv2DOptions(flatbuffers::FlatBufferBuilder &_fbb, const Conv2DOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 1424 1425 struct Pool2DOptionsT : public flatbuffers::NativeTable { 1426 typedef Pool2DOptions TableType; 1427 Padding padding; 1428 int32_t stride_w; 1429 int32_t stride_h; 1430 int32_t filter_width; 1431 int32_t filter_height; 1432 ActivationFunctionType fused_activation_function; 1433 Pool2DOptionsT() 1434 : padding(Padding_SAME), 1435 stride_w(0), 1436 stride_h(0), 1437 filter_width(0), 1438 filter_height(0), 1439 fused_activation_function(ActivationFunctionType_NONE) { 1440 } 1441 }; 1442 1443 struct Pool2DOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 1444 typedef Pool2DOptionsT NativeTableType; 1445 enum { 1446 VT_PADDING = 4, 1447 VT_STRIDE_W = 6, 1448 VT_STRIDE_H = 8, 1449 VT_FILTER_WIDTH = 10, 1450 VT_FILTER_HEIGHT = 12, 1451 VT_FUSED_ACTIVATION_FUNCTION = 14 1452 }; 1453 Padding padding() const { 1454 return static_cast<Padding>(GetField<int8_t>(VT_PADDING, 0)); 1455 } 1456 int32_t stride_w() const { 1457 return GetField<int32_t>(VT_STRIDE_W, 0); 1458 } 1459 int32_t stride_h() const { 1460 return GetField<int32_t>(VT_STRIDE_H, 0); 1461 } 1462 int32_t filter_width() const { 1463 return GetField<int32_t>(VT_FILTER_WIDTH, 0); 1464 } 1465 int32_t filter_height() const { 1466 return GetField<int32_t>(VT_FILTER_HEIGHT, 0); 1467 } 1468 ActivationFunctionType fused_activation_function() const { 1469 return static_cast<ActivationFunctionType>(GetField<int8_t>(VT_FUSED_ACTIVATION_FUNCTION, 0)); 1470 } 1471 bool Verify(flatbuffers::Verifier &verifier) const { 1472 return VerifyTableStart(verifier) && 1473 VerifyField<int8_t>(verifier, VT_PADDING) && 1474 VerifyField<int32_t>(verifier, VT_STRIDE_W) && 1475 VerifyField<int32_t>(verifier, VT_STRIDE_H) && 1476 VerifyField<int32_t>(verifier, VT_FILTER_WIDTH) && 1477 VerifyField<int32_t>(verifier, VT_FILTER_HEIGHT) && 1478 VerifyField<int8_t>(verifier, VT_FUSED_ACTIVATION_FUNCTION) && 1479 verifier.EndTable(); 1480 } 1481 Pool2DOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 1482 void UnPackTo(Pool2DOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 1483 static flatbuffers::Offset<Pool2DOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const Pool2DOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 1484 }; 1485 1486 struct Pool2DOptionsBuilder { 1487 flatbuffers::FlatBufferBuilder &fbb_; 1488 flatbuffers::uoffset_t start_; 1489 void add_padding(Padding padding) { 1490 fbb_.AddElement<int8_t>(Pool2DOptions::VT_PADDING, static_cast<int8_t>(padding), 0); 1491 } 1492 void add_stride_w(int32_t stride_w) { 1493 fbb_.AddElement<int32_t>(Pool2DOptions::VT_STRIDE_W, stride_w, 0); 1494 } 1495 void add_stride_h(int32_t stride_h) { 1496 fbb_.AddElement<int32_t>(Pool2DOptions::VT_STRIDE_H, stride_h, 0); 1497 } 1498 void add_filter_width(int32_t filter_width) { 1499 fbb_.AddElement<int32_t>(Pool2DOptions::VT_FILTER_WIDTH, filter_width, 0); 1500 } 1501 void add_filter_height(int32_t filter_height) { 1502 fbb_.AddElement<int32_t>(Pool2DOptions::VT_FILTER_HEIGHT, filter_height, 0); 1503 } 1504 void add_fused_activation_function(ActivationFunctionType fused_activation_function) { 1505 fbb_.AddElement<int8_t>(Pool2DOptions::VT_FUSED_ACTIVATION_FUNCTION, static_cast<int8_t>(fused_activation_function), 0); 1506 } 1507 explicit Pool2DOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) 1508 : fbb_(_fbb) { 1509 start_ = fbb_.StartTable(); 1510 } 1511 Pool2DOptionsBuilder &operator=(const Pool2DOptionsBuilder &); 1512 flatbuffers::Offset<Pool2DOptions> Finish() { 1513 const auto end = fbb_.EndTable(start_); 1514 auto o = flatbuffers::Offset<Pool2DOptions>(end); 1515 return o; 1516 } 1517 }; 1518 1519 inline flatbuffers::Offset<Pool2DOptions> CreatePool2DOptions( 1520 flatbuffers::FlatBufferBuilder &_fbb, 1521 Padding padding = Padding_SAME, 1522 int32_t stride_w = 0, 1523 int32_t stride_h = 0, 1524 int32_t filter_width = 0, 1525 int32_t filter_height = 0, 1526 ActivationFunctionType fused_activation_function = ActivationFunctionType_NONE) { 1527 Pool2DOptionsBuilder builder_(_fbb); 1528 builder_.add_filter_height(filter_height); 1529 builder_.add_filter_width(filter_width); 1530 builder_.add_stride_h(stride_h); 1531 builder_.add_stride_w(stride_w); 1532 builder_.add_fused_activation_function(fused_activation_function); 1533 builder_.add_padding(padding); 1534 return builder_.Finish(); 1535 } 1536 1537 flatbuffers::Offset<Pool2DOptions> CreatePool2DOptions(flatbuffers::FlatBufferBuilder &_fbb, const Pool2DOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 1538 1539 struct DepthwiseConv2DOptionsT : public flatbuffers::NativeTable { 1540 typedef DepthwiseConv2DOptions TableType; 1541 Padding padding; 1542 int32_t stride_w; 1543 int32_t stride_h; 1544 int32_t depth_multiplier; 1545 ActivationFunctionType fused_activation_function; 1546 DepthwiseConv2DOptionsT() 1547 : padding(Padding_SAME), 1548 stride_w(0), 1549 stride_h(0), 1550 depth_multiplier(0), 1551 fused_activation_function(ActivationFunctionType_NONE) { 1552 } 1553 }; 1554 1555 struct DepthwiseConv2DOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 1556 typedef DepthwiseConv2DOptionsT NativeTableType; 1557 enum { 1558 VT_PADDING = 4, 1559 VT_STRIDE_W = 6, 1560 VT_STRIDE_H = 8, 1561 VT_DEPTH_MULTIPLIER = 10, 1562 VT_FUSED_ACTIVATION_FUNCTION = 12 1563 }; 1564 Padding padding() const { 1565 return static_cast<Padding>(GetField<int8_t>(VT_PADDING, 0)); 1566 } 1567 int32_t stride_w() const { 1568 return GetField<int32_t>(VT_STRIDE_W, 0); 1569 } 1570 int32_t stride_h() const { 1571 return GetField<int32_t>(VT_STRIDE_H, 0); 1572 } 1573 int32_t depth_multiplier() const { 1574 return GetField<int32_t>(VT_DEPTH_MULTIPLIER, 0); 1575 } 1576 ActivationFunctionType fused_activation_function() const { 1577 return static_cast<ActivationFunctionType>(GetField<int8_t>(VT_FUSED_ACTIVATION_FUNCTION, 0)); 1578 } 1579 bool Verify(flatbuffers::Verifier &verifier) const { 1580 return VerifyTableStart(verifier) && 1581 VerifyField<int8_t>(verifier, VT_PADDING) && 1582 VerifyField<int32_t>(verifier, VT_STRIDE_W) && 1583 VerifyField<int32_t>(verifier, VT_STRIDE_H) && 1584 VerifyField<int32_t>(verifier, VT_DEPTH_MULTIPLIER) && 1585 VerifyField<int8_t>(verifier, VT_FUSED_ACTIVATION_FUNCTION) && 1586 verifier.EndTable(); 1587 } 1588 DepthwiseConv2DOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 1589 void UnPackTo(DepthwiseConv2DOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 1590 static flatbuffers::Offset<DepthwiseConv2DOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const DepthwiseConv2DOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 1591 }; 1592 1593 struct DepthwiseConv2DOptionsBuilder { 1594 flatbuffers::FlatBufferBuilder &fbb_; 1595 flatbuffers::uoffset_t start_; 1596 void add_padding(Padding padding) { 1597 fbb_.AddElement<int8_t>(DepthwiseConv2DOptions::VT_PADDING, static_cast<int8_t>(padding), 0); 1598 } 1599 void add_stride_w(int32_t stride_w) { 1600 fbb_.AddElement<int32_t>(DepthwiseConv2DOptions::VT_STRIDE_W, stride_w, 0); 1601 } 1602 void add_stride_h(int32_t stride_h) { 1603 fbb_.AddElement<int32_t>(DepthwiseConv2DOptions::VT_STRIDE_H, stride_h, 0); 1604 } 1605 void add_depth_multiplier(int32_t depth_multiplier) { 1606 fbb_.AddElement<int32_t>(DepthwiseConv2DOptions::VT_DEPTH_MULTIPLIER, depth_multiplier, 0); 1607 } 1608 void add_fused_activation_function(ActivationFunctionType fused_activation_function) { 1609 fbb_.AddElement<int8_t>(DepthwiseConv2DOptions::VT_FUSED_ACTIVATION_FUNCTION, static_cast<int8_t>(fused_activation_function), 0); 1610 } 1611 explicit DepthwiseConv2DOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) 1612 : fbb_(_fbb) { 1613 start_ = fbb_.StartTable(); 1614 } 1615 DepthwiseConv2DOptionsBuilder &operator=(const DepthwiseConv2DOptionsBuilder &); 1616 flatbuffers::Offset<DepthwiseConv2DOptions> Finish() { 1617 const auto end = fbb_.EndTable(start_); 1618 auto o = flatbuffers::Offset<DepthwiseConv2DOptions>(end); 1619 return o; 1620 } 1621 }; 1622 1623 inline flatbuffers::Offset<DepthwiseConv2DOptions> CreateDepthwiseConv2DOptions( 1624 flatbuffers::FlatBufferBuilder &_fbb, 1625 Padding padding = Padding_SAME, 1626 int32_t stride_w = 0, 1627 int32_t stride_h = 0, 1628 int32_t depth_multiplier = 0, 1629 ActivationFunctionType fused_activation_function = ActivationFunctionType_NONE) { 1630 DepthwiseConv2DOptionsBuilder builder_(_fbb); 1631 builder_.add_depth_multiplier(depth_multiplier); 1632 builder_.add_stride_h(stride_h); 1633 builder_.add_stride_w(stride_w); 1634 builder_.add_fused_activation_function(fused_activation_function); 1635 builder_.add_padding(padding); 1636 return builder_.Finish(); 1637 } 1638 1639 flatbuffers::Offset<DepthwiseConv2DOptions> CreateDepthwiseConv2DOptions(flatbuffers::FlatBufferBuilder &_fbb, const DepthwiseConv2DOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 1640 1641 struct ConcatEmbeddingsOptionsT : public flatbuffers::NativeTable { 1642 typedef ConcatEmbeddingsOptions TableType; 1643 int32_t num_channels; 1644 std::vector<int32_t> num_columns_per_channel; 1645 std::vector<int32_t> embedding_dim_per_channel; 1646 ConcatEmbeddingsOptionsT() 1647 : num_channels(0) { 1648 } 1649 }; 1650 1651 struct ConcatEmbeddingsOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 1652 typedef ConcatEmbeddingsOptionsT NativeTableType; 1653 enum { 1654 VT_NUM_CHANNELS = 4, 1655 VT_NUM_COLUMNS_PER_CHANNEL = 6, 1656 VT_EMBEDDING_DIM_PER_CHANNEL = 8 1657 }; 1658 int32_t num_channels() const { 1659 return GetField<int32_t>(VT_NUM_CHANNELS, 0); 1660 } 1661 const flatbuffers::Vector<int32_t> *num_columns_per_channel() const { 1662 return GetPointer<const flatbuffers::Vector<int32_t> *>(VT_NUM_COLUMNS_PER_CHANNEL); 1663 } 1664 const flatbuffers::Vector<int32_t> *embedding_dim_per_channel() const { 1665 return GetPointer<const flatbuffers::Vector<int32_t> *>(VT_EMBEDDING_DIM_PER_CHANNEL); 1666 } 1667 bool Verify(flatbuffers::Verifier &verifier) const { 1668 return VerifyTableStart(verifier) && 1669 VerifyField<int32_t>(verifier, VT_NUM_CHANNELS) && 1670 VerifyOffset(verifier, VT_NUM_COLUMNS_PER_CHANNEL) && 1671 verifier.Verify(num_columns_per_channel()) && 1672 VerifyOffset(verifier, VT_EMBEDDING_DIM_PER_CHANNEL) && 1673 verifier.Verify(embedding_dim_per_channel()) && 1674 verifier.EndTable(); 1675 } 1676 ConcatEmbeddingsOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 1677 void UnPackTo(ConcatEmbeddingsOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 1678 static flatbuffers::Offset<ConcatEmbeddingsOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const ConcatEmbeddingsOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 1679 }; 1680 1681 struct ConcatEmbeddingsOptionsBuilder { 1682 flatbuffers::FlatBufferBuilder &fbb_; 1683 flatbuffers::uoffset_t start_; 1684 void add_num_channels(int32_t num_channels) { 1685 fbb_.AddElement<int32_t>(ConcatEmbeddingsOptions::VT_NUM_CHANNELS, num_channels, 0); 1686 } 1687 void add_num_columns_per_channel(flatbuffers::Offset<flatbuffers::Vector<int32_t>> num_columns_per_channel) { 1688 fbb_.AddOffset(ConcatEmbeddingsOptions::VT_NUM_COLUMNS_PER_CHANNEL, num_columns_per_channel); 1689 } 1690 void add_embedding_dim_per_channel(flatbuffers::Offset<flatbuffers::Vector<int32_t>> embedding_dim_per_channel) { 1691 fbb_.AddOffset(ConcatEmbeddingsOptions::VT_EMBEDDING_DIM_PER_CHANNEL, embedding_dim_per_channel); 1692 } 1693 explicit ConcatEmbeddingsOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) 1694 : fbb_(_fbb) { 1695 start_ = fbb_.StartTable(); 1696 } 1697 ConcatEmbeddingsOptionsBuilder &operator=(const ConcatEmbeddingsOptionsBuilder &); 1698 flatbuffers::Offset<ConcatEmbeddingsOptions> Finish() { 1699 const auto end = fbb_.EndTable(start_); 1700 auto o = flatbuffers::Offset<ConcatEmbeddingsOptions>(end); 1701 return o; 1702 } 1703 }; 1704 1705 inline flatbuffers::Offset<ConcatEmbeddingsOptions> CreateConcatEmbeddingsOptions( 1706 flatbuffers::FlatBufferBuilder &_fbb, 1707 int32_t num_channels = 0, 1708 flatbuffers::Offset<flatbuffers::Vector<int32_t>> num_columns_per_channel = 0, 1709 flatbuffers::Offset<flatbuffers::Vector<int32_t>> embedding_dim_per_channel = 0) { 1710 ConcatEmbeddingsOptionsBuilder builder_(_fbb); 1711 builder_.add_embedding_dim_per_channel(embedding_dim_per_channel); 1712 builder_.add_num_columns_per_channel(num_columns_per_channel); 1713 builder_.add_num_channels(num_channels); 1714 return builder_.Finish(); 1715 } 1716 1717 inline flatbuffers::Offset<ConcatEmbeddingsOptions> CreateConcatEmbeddingsOptionsDirect( 1718 flatbuffers::FlatBufferBuilder &_fbb, 1719 int32_t num_channels = 0, 1720 const std::vector<int32_t> *num_columns_per_channel = nullptr, 1721 const std::vector<int32_t> *embedding_dim_per_channel = nullptr) { 1722 return tflite::CreateConcatEmbeddingsOptions( 1723 _fbb, 1724 num_channels, 1725 num_columns_per_channel ? _fbb.CreateVector<int32_t>(*num_columns_per_channel) : 0, 1726 embedding_dim_per_channel ? _fbb.CreateVector<int32_t>(*embedding_dim_per_channel) : 0); 1727 } 1728 1729 flatbuffers::Offset<ConcatEmbeddingsOptions> CreateConcatEmbeddingsOptions(flatbuffers::FlatBufferBuilder &_fbb, const ConcatEmbeddingsOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 1730 1731 struct LSHProjectionOptionsT : public flatbuffers::NativeTable { 1732 typedef LSHProjectionOptions TableType; 1733 LSHProjectionType type; 1734 LSHProjectionOptionsT() 1735 : type(LSHProjectionType_UNKNOWN) { 1736 } 1737 }; 1738 1739 struct LSHProjectionOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 1740 typedef LSHProjectionOptionsT NativeTableType; 1741 enum { 1742 VT_TYPE = 4 1743 }; 1744 LSHProjectionType type() const { 1745 return static_cast<LSHProjectionType>(GetField<int8_t>(VT_TYPE, 0)); 1746 } 1747 bool Verify(flatbuffers::Verifier &verifier) const { 1748 return VerifyTableStart(verifier) && 1749 VerifyField<int8_t>(verifier, VT_TYPE) && 1750 verifier.EndTable(); 1751 } 1752 LSHProjectionOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 1753 void UnPackTo(LSHProjectionOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 1754 static flatbuffers::Offset<LSHProjectionOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const LSHProjectionOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 1755 }; 1756 1757 struct LSHProjectionOptionsBuilder { 1758 flatbuffers::FlatBufferBuilder &fbb_; 1759 flatbuffers::uoffset_t start_; 1760 void add_type(LSHProjectionType type) { 1761 fbb_.AddElement<int8_t>(LSHProjectionOptions::VT_TYPE, static_cast<int8_t>(type), 0); 1762 } 1763 explicit LSHProjectionOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) 1764 : fbb_(_fbb) { 1765 start_ = fbb_.StartTable(); 1766 } 1767 LSHProjectionOptionsBuilder &operator=(const LSHProjectionOptionsBuilder &); 1768 flatbuffers::Offset<LSHProjectionOptions> Finish() { 1769 const auto end = fbb_.EndTable(start_); 1770 auto o = flatbuffers::Offset<LSHProjectionOptions>(end); 1771 return o; 1772 } 1773 }; 1774 1775 inline flatbuffers::Offset<LSHProjectionOptions> CreateLSHProjectionOptions( 1776 flatbuffers::FlatBufferBuilder &_fbb, 1777 LSHProjectionType type = LSHProjectionType_UNKNOWN) { 1778 LSHProjectionOptionsBuilder builder_(_fbb); 1779 builder_.add_type(type); 1780 return builder_.Finish(); 1781 } 1782 1783 flatbuffers::Offset<LSHProjectionOptions> CreateLSHProjectionOptions(flatbuffers::FlatBufferBuilder &_fbb, const LSHProjectionOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 1784 1785 struct SVDFOptionsT : public flatbuffers::NativeTable { 1786 typedef SVDFOptions TableType; 1787 int32_t rank; 1788 ActivationFunctionType fused_activation_function; 1789 SVDFOptionsT() 1790 : rank(0), 1791 fused_activation_function(ActivationFunctionType_NONE) { 1792 } 1793 }; 1794 1795 struct SVDFOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 1796 typedef SVDFOptionsT NativeTableType; 1797 enum { 1798 VT_RANK = 4, 1799 VT_FUSED_ACTIVATION_FUNCTION = 6 1800 }; 1801 int32_t rank() const { 1802 return GetField<int32_t>(VT_RANK, 0); 1803 } 1804 ActivationFunctionType fused_activation_function() const { 1805 return static_cast<ActivationFunctionType>(GetField<int8_t>(VT_FUSED_ACTIVATION_FUNCTION, 0)); 1806 } 1807 bool Verify(flatbuffers::Verifier &verifier) const { 1808 return VerifyTableStart(verifier) && 1809 VerifyField<int32_t>(verifier, VT_RANK) && 1810 VerifyField<int8_t>(verifier, VT_FUSED_ACTIVATION_FUNCTION) && 1811 verifier.EndTable(); 1812 } 1813 SVDFOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 1814 void UnPackTo(SVDFOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 1815 static flatbuffers::Offset<SVDFOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const SVDFOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 1816 }; 1817 1818 struct SVDFOptionsBuilder { 1819 flatbuffers::FlatBufferBuilder &fbb_; 1820 flatbuffers::uoffset_t start_; 1821 void add_rank(int32_t rank) { 1822 fbb_.AddElement<int32_t>(SVDFOptions::VT_RANK, rank, 0); 1823 } 1824 void add_fused_activation_function(ActivationFunctionType fused_activation_function) { 1825 fbb_.AddElement<int8_t>(SVDFOptions::VT_FUSED_ACTIVATION_FUNCTION, static_cast<int8_t>(fused_activation_function), 0); 1826 } 1827 explicit SVDFOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) 1828 : fbb_(_fbb) { 1829 start_ = fbb_.StartTable(); 1830 } 1831 SVDFOptionsBuilder &operator=(const SVDFOptionsBuilder &); 1832 flatbuffers::Offset<SVDFOptions> Finish() { 1833 const auto end = fbb_.EndTable(start_); 1834 auto o = flatbuffers::Offset<SVDFOptions>(end); 1835 return o; 1836 } 1837 }; 1838 1839 inline flatbuffers::Offset<SVDFOptions> CreateSVDFOptions( 1840 flatbuffers::FlatBufferBuilder &_fbb, 1841 int32_t rank = 0, 1842 ActivationFunctionType fused_activation_function = ActivationFunctionType_NONE) { 1843 SVDFOptionsBuilder builder_(_fbb); 1844 builder_.add_rank(rank); 1845 builder_.add_fused_activation_function(fused_activation_function); 1846 return builder_.Finish(); 1847 } 1848 1849 flatbuffers::Offset<SVDFOptions> CreateSVDFOptions(flatbuffers::FlatBufferBuilder &_fbb, const SVDFOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 1850 1851 struct RNNOptionsT : public flatbuffers::NativeTable { 1852 typedef RNNOptions TableType; 1853 ActivationFunctionType fused_activation_function; 1854 RNNOptionsT() 1855 : fused_activation_function(ActivationFunctionType_NONE) { 1856 } 1857 }; 1858 1859 struct RNNOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 1860 typedef RNNOptionsT NativeTableType; 1861 enum { 1862 VT_FUSED_ACTIVATION_FUNCTION = 4 1863 }; 1864 ActivationFunctionType fused_activation_function() const { 1865 return static_cast<ActivationFunctionType>(GetField<int8_t>(VT_FUSED_ACTIVATION_FUNCTION, 0)); 1866 } 1867 bool Verify(flatbuffers::Verifier &verifier) const { 1868 return VerifyTableStart(verifier) && 1869 VerifyField<int8_t>(verifier, VT_FUSED_ACTIVATION_FUNCTION) && 1870 verifier.EndTable(); 1871 } 1872 RNNOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 1873 void UnPackTo(RNNOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 1874 static flatbuffers::Offset<RNNOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const RNNOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 1875 }; 1876 1877 struct RNNOptionsBuilder { 1878 flatbuffers::FlatBufferBuilder &fbb_; 1879 flatbuffers::uoffset_t start_; 1880 void add_fused_activation_function(ActivationFunctionType fused_activation_function) { 1881 fbb_.AddElement<int8_t>(RNNOptions::VT_FUSED_ACTIVATION_FUNCTION, static_cast<int8_t>(fused_activation_function), 0); 1882 } 1883 explicit RNNOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) 1884 : fbb_(_fbb) { 1885 start_ = fbb_.StartTable(); 1886 } 1887 RNNOptionsBuilder &operator=(const RNNOptionsBuilder &); 1888 flatbuffers::Offset<RNNOptions> Finish() { 1889 const auto end = fbb_.EndTable(start_); 1890 auto o = flatbuffers::Offset<RNNOptions>(end); 1891 return o; 1892 } 1893 }; 1894 1895 inline flatbuffers::Offset<RNNOptions> CreateRNNOptions( 1896 flatbuffers::FlatBufferBuilder &_fbb, 1897 ActivationFunctionType fused_activation_function = ActivationFunctionType_NONE) { 1898 RNNOptionsBuilder builder_(_fbb); 1899 builder_.add_fused_activation_function(fused_activation_function); 1900 return builder_.Finish(); 1901 } 1902 1903 flatbuffers::Offset<RNNOptions> CreateRNNOptions(flatbuffers::FlatBufferBuilder &_fbb, const RNNOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 1904 1905 struct SequenceRNNOptionsT : public flatbuffers::NativeTable { 1906 typedef SequenceRNNOptions TableType; 1907 bool time_major; 1908 ActivationFunctionType fused_activation_function; 1909 SequenceRNNOptionsT() 1910 : time_major(false), 1911 fused_activation_function(ActivationFunctionType_NONE) { 1912 } 1913 }; 1914 1915 struct SequenceRNNOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 1916 typedef SequenceRNNOptionsT NativeTableType; 1917 enum { 1918 VT_TIME_MAJOR = 4, 1919 VT_FUSED_ACTIVATION_FUNCTION = 6 1920 }; 1921 bool time_major() const { 1922 return GetField<uint8_t>(VT_TIME_MAJOR, 0) != 0; 1923 } 1924 ActivationFunctionType fused_activation_function() const { 1925 return static_cast<ActivationFunctionType>(GetField<int8_t>(VT_FUSED_ACTIVATION_FUNCTION, 0)); 1926 } 1927 bool Verify(flatbuffers::Verifier &verifier) const { 1928 return VerifyTableStart(verifier) && 1929 VerifyField<uint8_t>(verifier, VT_TIME_MAJOR) && 1930 VerifyField<int8_t>(verifier, VT_FUSED_ACTIVATION_FUNCTION) && 1931 verifier.EndTable(); 1932 } 1933 SequenceRNNOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 1934 void UnPackTo(SequenceRNNOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 1935 static flatbuffers::Offset<SequenceRNNOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const SequenceRNNOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 1936 }; 1937 1938 struct SequenceRNNOptionsBuilder { 1939 flatbuffers::FlatBufferBuilder &fbb_; 1940 flatbuffers::uoffset_t start_; 1941 void add_time_major(bool time_major) { 1942 fbb_.AddElement<uint8_t>(SequenceRNNOptions::VT_TIME_MAJOR, static_cast<uint8_t>(time_major), 0); 1943 } 1944 void add_fused_activation_function(ActivationFunctionType fused_activation_function) { 1945 fbb_.AddElement<int8_t>(SequenceRNNOptions::VT_FUSED_ACTIVATION_FUNCTION, static_cast<int8_t>(fused_activation_function), 0); 1946 } 1947 explicit SequenceRNNOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) 1948 : fbb_(_fbb) { 1949 start_ = fbb_.StartTable(); 1950 } 1951 SequenceRNNOptionsBuilder &operator=(const SequenceRNNOptionsBuilder &); 1952 flatbuffers::Offset<SequenceRNNOptions> Finish() { 1953 const auto end = fbb_.EndTable(start_); 1954 auto o = flatbuffers::Offset<SequenceRNNOptions>(end); 1955 return o; 1956 } 1957 }; 1958 1959 inline flatbuffers::Offset<SequenceRNNOptions> CreateSequenceRNNOptions( 1960 flatbuffers::FlatBufferBuilder &_fbb, 1961 bool time_major = false, 1962 ActivationFunctionType fused_activation_function = ActivationFunctionType_NONE) { 1963 SequenceRNNOptionsBuilder builder_(_fbb); 1964 builder_.add_fused_activation_function(fused_activation_function); 1965 builder_.add_time_major(time_major); 1966 return builder_.Finish(); 1967 } 1968 1969 flatbuffers::Offset<SequenceRNNOptions> CreateSequenceRNNOptions(flatbuffers::FlatBufferBuilder &_fbb, const SequenceRNNOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 1970 1971 struct BidirectionalSequenceRNNOptionsT : public flatbuffers::NativeTable { 1972 typedef BidirectionalSequenceRNNOptions TableType; 1973 bool time_major; 1974 ActivationFunctionType fused_activation_function; 1975 BidirectionalSequenceRNNOptionsT() 1976 : time_major(false), 1977 fused_activation_function(ActivationFunctionType_NONE) { 1978 } 1979 }; 1980 1981 struct BidirectionalSequenceRNNOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 1982 typedef BidirectionalSequenceRNNOptionsT NativeTableType; 1983 enum { 1984 VT_TIME_MAJOR = 4, 1985 VT_FUSED_ACTIVATION_FUNCTION = 6 1986 }; 1987 bool time_major() const { 1988 return GetField<uint8_t>(VT_TIME_MAJOR, 0) != 0; 1989 } 1990 ActivationFunctionType fused_activation_function() const { 1991 return static_cast<ActivationFunctionType>(GetField<int8_t>(VT_FUSED_ACTIVATION_FUNCTION, 0)); 1992 } 1993 bool Verify(flatbuffers::Verifier &verifier) const { 1994 return VerifyTableStart(verifier) && 1995 VerifyField<uint8_t>(verifier, VT_TIME_MAJOR) && 1996 VerifyField<int8_t>(verifier, VT_FUSED_ACTIVATION_FUNCTION) && 1997 verifier.EndTable(); 1998 } 1999 BidirectionalSequenceRNNOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 2000 void UnPackTo(BidirectionalSequenceRNNOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 2001 static flatbuffers::Offset<BidirectionalSequenceRNNOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const BidirectionalSequenceRNNOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 2002 }; 2003 2004 struct BidirectionalSequenceRNNOptionsBuilder { 2005 flatbuffers::FlatBufferBuilder &fbb_; 2006 flatbuffers::uoffset_t start_; 2007 void add_time_major(bool time_major) { 2008 fbb_.AddElement<uint8_t>(BidirectionalSequenceRNNOptions::VT_TIME_MAJOR, static_cast<uint8_t>(time_major), 0); 2009 } 2010 void add_fused_activation_function(ActivationFunctionType fused_activation_function) { 2011 fbb_.AddElement<int8_t>(BidirectionalSequenceRNNOptions::VT_FUSED_ACTIVATION_FUNCTION, static_cast<int8_t>(fused_activation_function), 0); 2012 } 2013 explicit BidirectionalSequenceRNNOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) 2014 : fbb_(_fbb) { 2015 start_ = fbb_.StartTable(); 2016 } 2017 BidirectionalSequenceRNNOptionsBuilder &operator=(const BidirectionalSequenceRNNOptionsBuilder &); 2018 flatbuffers::Offset<BidirectionalSequenceRNNOptions> Finish() { 2019 const auto end = fbb_.EndTable(start_); 2020 auto o = flatbuffers::Offset<BidirectionalSequenceRNNOptions>(end); 2021 return o; 2022 } 2023 }; 2024 2025 inline flatbuffers::Offset<BidirectionalSequenceRNNOptions> CreateBidirectionalSequenceRNNOptions( 2026 flatbuffers::FlatBufferBuilder &_fbb, 2027 bool time_major = false, 2028 ActivationFunctionType fused_activation_function = ActivationFunctionType_NONE) { 2029 BidirectionalSequenceRNNOptionsBuilder builder_(_fbb); 2030 builder_.add_fused_activation_function(fused_activation_function); 2031 builder_.add_time_major(time_major); 2032 return builder_.Finish(); 2033 } 2034 2035 flatbuffers::Offset<BidirectionalSequenceRNNOptions> CreateBidirectionalSequenceRNNOptions(flatbuffers::FlatBufferBuilder &_fbb, const BidirectionalSequenceRNNOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 2036 2037 struct FullyConnectedOptionsT : public flatbuffers::NativeTable { 2038 typedef FullyConnectedOptions TableType; 2039 ActivationFunctionType fused_activation_function; 2040 FullyConnectedOptionsT() 2041 : fused_activation_function(ActivationFunctionType_NONE) { 2042 } 2043 }; 2044 2045 struct FullyConnectedOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 2046 typedef FullyConnectedOptionsT NativeTableType; 2047 enum { 2048 VT_FUSED_ACTIVATION_FUNCTION = 4 2049 }; 2050 ActivationFunctionType fused_activation_function() const { 2051 return static_cast<ActivationFunctionType>(GetField<int8_t>(VT_FUSED_ACTIVATION_FUNCTION, 0)); 2052 } 2053 bool Verify(flatbuffers::Verifier &verifier) const { 2054 return VerifyTableStart(verifier) && 2055 VerifyField<int8_t>(verifier, VT_FUSED_ACTIVATION_FUNCTION) && 2056 verifier.EndTable(); 2057 } 2058 FullyConnectedOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 2059 void UnPackTo(FullyConnectedOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 2060 static flatbuffers::Offset<FullyConnectedOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const FullyConnectedOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 2061 }; 2062 2063 struct FullyConnectedOptionsBuilder { 2064 flatbuffers::FlatBufferBuilder &fbb_; 2065 flatbuffers::uoffset_t start_; 2066 void add_fused_activation_function(ActivationFunctionType fused_activation_function) { 2067 fbb_.AddElement<int8_t>(FullyConnectedOptions::VT_FUSED_ACTIVATION_FUNCTION, static_cast<int8_t>(fused_activation_function), 0); 2068 } 2069 explicit FullyConnectedOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) 2070 : fbb_(_fbb) { 2071 start_ = fbb_.StartTable(); 2072 } 2073 FullyConnectedOptionsBuilder &operator=(const FullyConnectedOptionsBuilder &); 2074 flatbuffers::Offset<FullyConnectedOptions> Finish() { 2075 const auto end = fbb_.EndTable(start_); 2076 auto o = flatbuffers::Offset<FullyConnectedOptions>(end); 2077 return o; 2078 } 2079 }; 2080 2081 inline flatbuffers::Offset<FullyConnectedOptions> CreateFullyConnectedOptions( 2082 flatbuffers::FlatBufferBuilder &_fbb, 2083 ActivationFunctionType fused_activation_function = ActivationFunctionType_NONE) { 2084 FullyConnectedOptionsBuilder builder_(_fbb); 2085 builder_.add_fused_activation_function(fused_activation_function); 2086 return builder_.Finish(); 2087 } 2088 2089 flatbuffers::Offset<FullyConnectedOptions> CreateFullyConnectedOptions(flatbuffers::FlatBufferBuilder &_fbb, const FullyConnectedOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 2090 2091 struct SoftmaxOptionsT : public flatbuffers::NativeTable { 2092 typedef SoftmaxOptions TableType; 2093 float beta; 2094 SoftmaxOptionsT() 2095 : beta(0.0f) { 2096 } 2097 }; 2098 2099 struct SoftmaxOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 2100 typedef SoftmaxOptionsT NativeTableType; 2101 enum { 2102 VT_BETA = 4 2103 }; 2104 float beta() const { 2105 return GetField<float>(VT_BETA, 0.0f); 2106 } 2107 bool Verify(flatbuffers::Verifier &verifier) const { 2108 return VerifyTableStart(verifier) && 2109 VerifyField<float>(verifier, VT_BETA) && 2110 verifier.EndTable(); 2111 } 2112 SoftmaxOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 2113 void UnPackTo(SoftmaxOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 2114 static flatbuffers::Offset<SoftmaxOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const SoftmaxOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 2115 }; 2116 2117 struct SoftmaxOptionsBuilder { 2118 flatbuffers::FlatBufferBuilder &fbb_; 2119 flatbuffers::uoffset_t start_; 2120 void add_beta(float beta) { 2121 fbb_.AddElement<float>(SoftmaxOptions::VT_BETA, beta, 0.0f); 2122 } 2123 explicit SoftmaxOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) 2124 : fbb_(_fbb) { 2125 start_ = fbb_.StartTable(); 2126 } 2127 SoftmaxOptionsBuilder &operator=(const SoftmaxOptionsBuilder &); 2128 flatbuffers::Offset<SoftmaxOptions> Finish() { 2129 const auto end = fbb_.EndTable(start_); 2130 auto o = flatbuffers::Offset<SoftmaxOptions>(end); 2131 return o; 2132 } 2133 }; 2134 2135 inline flatbuffers::Offset<SoftmaxOptions> CreateSoftmaxOptions( 2136 flatbuffers::FlatBufferBuilder &_fbb, 2137 float beta = 0.0f) { 2138 SoftmaxOptionsBuilder builder_(_fbb); 2139 builder_.add_beta(beta); 2140 return builder_.Finish(); 2141 } 2142 2143 flatbuffers::Offset<SoftmaxOptions> CreateSoftmaxOptions(flatbuffers::FlatBufferBuilder &_fbb, const SoftmaxOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 2144 2145 struct ConcatenationOptionsT : public flatbuffers::NativeTable { 2146 typedef ConcatenationOptions TableType; 2147 int32_t axis; 2148 ActivationFunctionType fused_activation_function; 2149 ConcatenationOptionsT() 2150 : axis(0), 2151 fused_activation_function(ActivationFunctionType_NONE) { 2152 } 2153 }; 2154 2155 struct ConcatenationOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 2156 typedef ConcatenationOptionsT NativeTableType; 2157 enum { 2158 VT_AXIS = 4, 2159 VT_FUSED_ACTIVATION_FUNCTION = 6 2160 }; 2161 int32_t axis() const { 2162 return GetField<int32_t>(VT_AXIS, 0); 2163 } 2164 ActivationFunctionType fused_activation_function() const { 2165 return static_cast<ActivationFunctionType>(GetField<int8_t>(VT_FUSED_ACTIVATION_FUNCTION, 0)); 2166 } 2167 bool Verify(flatbuffers::Verifier &verifier) const { 2168 return VerifyTableStart(verifier) && 2169 VerifyField<int32_t>(verifier, VT_AXIS) && 2170 VerifyField<int8_t>(verifier, VT_FUSED_ACTIVATION_FUNCTION) && 2171 verifier.EndTable(); 2172 } 2173 ConcatenationOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 2174 void UnPackTo(ConcatenationOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 2175 static flatbuffers::Offset<ConcatenationOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const ConcatenationOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 2176 }; 2177 2178 struct ConcatenationOptionsBuilder { 2179 flatbuffers::FlatBufferBuilder &fbb_; 2180 flatbuffers::uoffset_t start_; 2181 void add_axis(int32_t axis) { 2182 fbb_.AddElement<int32_t>(ConcatenationOptions::VT_AXIS, axis, 0); 2183 } 2184 void add_fused_activation_function(ActivationFunctionType fused_activation_function) { 2185 fbb_.AddElement<int8_t>(ConcatenationOptions::VT_FUSED_ACTIVATION_FUNCTION, static_cast<int8_t>(fused_activation_function), 0); 2186 } 2187 explicit ConcatenationOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) 2188 : fbb_(_fbb) { 2189 start_ = fbb_.StartTable(); 2190 } 2191 ConcatenationOptionsBuilder &operator=(const ConcatenationOptionsBuilder &); 2192 flatbuffers::Offset<ConcatenationOptions> Finish() { 2193 const auto end = fbb_.EndTable(start_); 2194 auto o = flatbuffers::Offset<ConcatenationOptions>(end); 2195 return o; 2196 } 2197 }; 2198 2199 inline flatbuffers::Offset<ConcatenationOptions> CreateConcatenationOptions( 2200 flatbuffers::FlatBufferBuilder &_fbb, 2201 int32_t axis = 0, 2202 ActivationFunctionType fused_activation_function = ActivationFunctionType_NONE) { 2203 ConcatenationOptionsBuilder builder_(_fbb); 2204 builder_.add_axis(axis); 2205 builder_.add_fused_activation_function(fused_activation_function); 2206 return builder_.Finish(); 2207 } 2208 2209 flatbuffers::Offset<ConcatenationOptions> CreateConcatenationOptions(flatbuffers::FlatBufferBuilder &_fbb, const ConcatenationOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 2210 2211 struct AddOptionsT : public flatbuffers::NativeTable { 2212 typedef AddOptions TableType; 2213 ActivationFunctionType fused_activation_function; 2214 AddOptionsT() 2215 : fused_activation_function(ActivationFunctionType_NONE) { 2216 } 2217 }; 2218 2219 struct AddOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 2220 typedef AddOptionsT NativeTableType; 2221 enum { 2222 VT_FUSED_ACTIVATION_FUNCTION = 4 2223 }; 2224 ActivationFunctionType fused_activation_function() const { 2225 return static_cast<ActivationFunctionType>(GetField<int8_t>(VT_FUSED_ACTIVATION_FUNCTION, 0)); 2226 } 2227 bool Verify(flatbuffers::Verifier &verifier) const { 2228 return VerifyTableStart(verifier) && 2229 VerifyField<int8_t>(verifier, VT_FUSED_ACTIVATION_FUNCTION) && 2230 verifier.EndTable(); 2231 } 2232 AddOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 2233 void UnPackTo(AddOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 2234 static flatbuffers::Offset<AddOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const AddOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 2235 }; 2236 2237 struct AddOptionsBuilder { 2238 flatbuffers::FlatBufferBuilder &fbb_; 2239 flatbuffers::uoffset_t start_; 2240 void add_fused_activation_function(ActivationFunctionType fused_activation_function) { 2241 fbb_.AddElement<int8_t>(AddOptions::VT_FUSED_ACTIVATION_FUNCTION, static_cast<int8_t>(fused_activation_function), 0); 2242 } 2243 explicit AddOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) 2244 : fbb_(_fbb) { 2245 start_ = fbb_.StartTable(); 2246 } 2247 AddOptionsBuilder &operator=(const AddOptionsBuilder &); 2248 flatbuffers::Offset<AddOptions> Finish() { 2249 const auto end = fbb_.EndTable(start_); 2250 auto o = flatbuffers::Offset<AddOptions>(end); 2251 return o; 2252 } 2253 }; 2254 2255 inline flatbuffers::Offset<AddOptions> CreateAddOptions( 2256 flatbuffers::FlatBufferBuilder &_fbb, 2257 ActivationFunctionType fused_activation_function = ActivationFunctionType_NONE) { 2258 AddOptionsBuilder builder_(_fbb); 2259 builder_.add_fused_activation_function(fused_activation_function); 2260 return builder_.Finish(); 2261 } 2262 2263 flatbuffers::Offset<AddOptions> CreateAddOptions(flatbuffers::FlatBufferBuilder &_fbb, const AddOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 2264 2265 struct MulOptionsT : public flatbuffers::NativeTable { 2266 typedef MulOptions TableType; 2267 ActivationFunctionType fused_activation_function; 2268 MulOptionsT() 2269 : fused_activation_function(ActivationFunctionType_NONE) { 2270 } 2271 }; 2272 2273 struct MulOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 2274 typedef MulOptionsT NativeTableType; 2275 enum { 2276 VT_FUSED_ACTIVATION_FUNCTION = 4 2277 }; 2278 ActivationFunctionType fused_activation_function() const { 2279 return static_cast<ActivationFunctionType>(GetField<int8_t>(VT_FUSED_ACTIVATION_FUNCTION, 0)); 2280 } 2281 bool Verify(flatbuffers::Verifier &verifier) const { 2282 return VerifyTableStart(verifier) && 2283 VerifyField<int8_t>(verifier, VT_FUSED_ACTIVATION_FUNCTION) && 2284 verifier.EndTable(); 2285 } 2286 MulOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 2287 void UnPackTo(MulOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 2288 static flatbuffers::Offset<MulOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const MulOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 2289 }; 2290 2291 struct MulOptionsBuilder { 2292 flatbuffers::FlatBufferBuilder &fbb_; 2293 flatbuffers::uoffset_t start_; 2294 void add_fused_activation_function(ActivationFunctionType fused_activation_function) { 2295 fbb_.AddElement<int8_t>(MulOptions::VT_FUSED_ACTIVATION_FUNCTION, static_cast<int8_t>(fused_activation_function), 0); 2296 } 2297 explicit MulOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) 2298 : fbb_(_fbb) { 2299 start_ = fbb_.StartTable(); 2300 } 2301 MulOptionsBuilder &operator=(const MulOptionsBuilder &); 2302 flatbuffers::Offset<MulOptions> Finish() { 2303 const auto end = fbb_.EndTable(start_); 2304 auto o = flatbuffers::Offset<MulOptions>(end); 2305 return o; 2306 } 2307 }; 2308 2309 inline flatbuffers::Offset<MulOptions> CreateMulOptions( 2310 flatbuffers::FlatBufferBuilder &_fbb, 2311 ActivationFunctionType fused_activation_function = ActivationFunctionType_NONE) { 2312 MulOptionsBuilder builder_(_fbb); 2313 builder_.add_fused_activation_function(fused_activation_function); 2314 return builder_.Finish(); 2315 } 2316 2317 flatbuffers::Offset<MulOptions> CreateMulOptions(flatbuffers::FlatBufferBuilder &_fbb, const MulOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 2318 2319 struct L2NormOptionsT : public flatbuffers::NativeTable { 2320 typedef L2NormOptions TableType; 2321 ActivationFunctionType fused_activation_function; 2322 L2NormOptionsT() 2323 : fused_activation_function(ActivationFunctionType_NONE) { 2324 } 2325 }; 2326 2327 struct L2NormOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 2328 typedef L2NormOptionsT NativeTableType; 2329 enum { 2330 VT_FUSED_ACTIVATION_FUNCTION = 4 2331 }; 2332 ActivationFunctionType fused_activation_function() const { 2333 return static_cast<ActivationFunctionType>(GetField<int8_t>(VT_FUSED_ACTIVATION_FUNCTION, 0)); 2334 } 2335 bool Verify(flatbuffers::Verifier &verifier) const { 2336 return VerifyTableStart(verifier) && 2337 VerifyField<int8_t>(verifier, VT_FUSED_ACTIVATION_FUNCTION) && 2338 verifier.EndTable(); 2339 } 2340 L2NormOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 2341 void UnPackTo(L2NormOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 2342 static flatbuffers::Offset<L2NormOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const L2NormOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 2343 }; 2344 2345 struct L2NormOptionsBuilder { 2346 flatbuffers::FlatBufferBuilder &fbb_; 2347 flatbuffers::uoffset_t start_; 2348 void add_fused_activation_function(ActivationFunctionType fused_activation_function) { 2349 fbb_.AddElement<int8_t>(L2NormOptions::VT_FUSED_ACTIVATION_FUNCTION, static_cast<int8_t>(fused_activation_function), 0); 2350 } 2351 explicit L2NormOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) 2352 : fbb_(_fbb) { 2353 start_ = fbb_.StartTable(); 2354 } 2355 L2NormOptionsBuilder &operator=(const L2NormOptionsBuilder &); 2356 flatbuffers::Offset<L2NormOptions> Finish() { 2357 const auto end = fbb_.EndTable(start_); 2358 auto o = flatbuffers::Offset<L2NormOptions>(end); 2359 return o; 2360 } 2361 }; 2362 2363 inline flatbuffers::Offset<L2NormOptions> CreateL2NormOptions( 2364 flatbuffers::FlatBufferBuilder &_fbb, 2365 ActivationFunctionType fused_activation_function = ActivationFunctionType_NONE) { 2366 L2NormOptionsBuilder builder_(_fbb); 2367 builder_.add_fused_activation_function(fused_activation_function); 2368 return builder_.Finish(); 2369 } 2370 2371 flatbuffers::Offset<L2NormOptions> CreateL2NormOptions(flatbuffers::FlatBufferBuilder &_fbb, const L2NormOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 2372 2373 struct LocalResponseNormalizationOptionsT : public flatbuffers::NativeTable { 2374 typedef LocalResponseNormalizationOptions TableType; 2375 int32_t radius; 2376 float bias; 2377 float alpha; 2378 float beta; 2379 LocalResponseNormalizationOptionsT() 2380 : radius(0), 2381 bias(0.0f), 2382 alpha(0.0f), 2383 beta(0.0f) { 2384 } 2385 }; 2386 2387 struct LocalResponseNormalizationOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 2388 typedef LocalResponseNormalizationOptionsT NativeTableType; 2389 enum { 2390 VT_RADIUS = 4, 2391 VT_BIAS = 6, 2392 VT_ALPHA = 8, 2393 VT_BETA = 10 2394 }; 2395 int32_t radius() const { 2396 return GetField<int32_t>(VT_RADIUS, 0); 2397 } 2398 float bias() const { 2399 return GetField<float>(VT_BIAS, 0.0f); 2400 } 2401 float alpha() const { 2402 return GetField<float>(VT_ALPHA, 0.0f); 2403 } 2404 float beta() const { 2405 return GetField<float>(VT_BETA, 0.0f); 2406 } 2407 bool Verify(flatbuffers::Verifier &verifier) const { 2408 return VerifyTableStart(verifier) && 2409 VerifyField<int32_t>(verifier, VT_RADIUS) && 2410 VerifyField<float>(verifier, VT_BIAS) && 2411 VerifyField<float>(verifier, VT_ALPHA) && 2412 VerifyField<float>(verifier, VT_BETA) && 2413 verifier.EndTable(); 2414 } 2415 LocalResponseNormalizationOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 2416 void UnPackTo(LocalResponseNormalizationOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 2417 static flatbuffers::Offset<LocalResponseNormalizationOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const LocalResponseNormalizationOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 2418 }; 2419 2420 struct LocalResponseNormalizationOptionsBuilder { 2421 flatbuffers::FlatBufferBuilder &fbb_; 2422 flatbuffers::uoffset_t start_; 2423 void add_radius(int32_t radius) { 2424 fbb_.AddElement<int32_t>(LocalResponseNormalizationOptions::VT_RADIUS, radius, 0); 2425 } 2426 void add_bias(float bias) { 2427 fbb_.AddElement<float>(LocalResponseNormalizationOptions::VT_BIAS, bias, 0.0f); 2428 } 2429 void add_alpha(float alpha) { 2430 fbb_.AddElement<float>(LocalResponseNormalizationOptions::VT_ALPHA, alpha, 0.0f); 2431 } 2432 void add_beta(float beta) { 2433 fbb_.AddElement<float>(LocalResponseNormalizationOptions::VT_BETA, beta, 0.0f); 2434 } 2435 explicit LocalResponseNormalizationOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) 2436 : fbb_(_fbb) { 2437 start_ = fbb_.StartTable(); 2438 } 2439 LocalResponseNormalizationOptionsBuilder &operator=(const LocalResponseNormalizationOptionsBuilder &); 2440 flatbuffers::Offset<LocalResponseNormalizationOptions> Finish() { 2441 const auto end = fbb_.EndTable(start_); 2442 auto o = flatbuffers::Offset<LocalResponseNormalizationOptions>(end); 2443 return o; 2444 } 2445 }; 2446 2447 inline flatbuffers::Offset<LocalResponseNormalizationOptions> CreateLocalResponseNormalizationOptions( 2448 flatbuffers::FlatBufferBuilder &_fbb, 2449 int32_t radius = 0, 2450 float bias = 0.0f, 2451 float alpha = 0.0f, 2452 float beta = 0.0f) { 2453 LocalResponseNormalizationOptionsBuilder builder_(_fbb); 2454 builder_.add_beta(beta); 2455 builder_.add_alpha(alpha); 2456 builder_.add_bias(bias); 2457 builder_.add_radius(radius); 2458 return builder_.Finish(); 2459 } 2460 2461 flatbuffers::Offset<LocalResponseNormalizationOptions> CreateLocalResponseNormalizationOptions(flatbuffers::FlatBufferBuilder &_fbb, const LocalResponseNormalizationOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 2462 2463 struct LSTMOptionsT : public flatbuffers::NativeTable { 2464 typedef LSTMOptions TableType; 2465 ActivationFunctionType fused_activation_function; 2466 float cell_clip; 2467 float proj_clip; 2468 LSTMOptionsT() 2469 : fused_activation_function(ActivationFunctionType_NONE), 2470 cell_clip(0.0f), 2471 proj_clip(0.0f) { 2472 } 2473 }; 2474 2475 struct LSTMOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 2476 typedef LSTMOptionsT NativeTableType; 2477 enum { 2478 VT_FUSED_ACTIVATION_FUNCTION = 4, 2479 VT_CELL_CLIP = 6, 2480 VT_PROJ_CLIP = 8 2481 }; 2482 ActivationFunctionType fused_activation_function() const { 2483 return static_cast<ActivationFunctionType>(GetField<int8_t>(VT_FUSED_ACTIVATION_FUNCTION, 0)); 2484 } 2485 float cell_clip() const { 2486 return GetField<float>(VT_CELL_CLIP, 0.0f); 2487 } 2488 float proj_clip() const { 2489 return GetField<float>(VT_PROJ_CLIP, 0.0f); 2490 } 2491 bool Verify(flatbuffers::Verifier &verifier) const { 2492 return VerifyTableStart(verifier) && 2493 VerifyField<int8_t>(verifier, VT_FUSED_ACTIVATION_FUNCTION) && 2494 VerifyField<float>(verifier, VT_CELL_CLIP) && 2495 VerifyField<float>(verifier, VT_PROJ_CLIP) && 2496 verifier.EndTable(); 2497 } 2498 LSTMOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 2499 void UnPackTo(LSTMOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 2500 static flatbuffers::Offset<LSTMOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const LSTMOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 2501 }; 2502 2503 struct LSTMOptionsBuilder { 2504 flatbuffers::FlatBufferBuilder &fbb_; 2505 flatbuffers::uoffset_t start_; 2506 void add_fused_activation_function(ActivationFunctionType fused_activation_function) { 2507 fbb_.AddElement<int8_t>(LSTMOptions::VT_FUSED_ACTIVATION_FUNCTION, static_cast<int8_t>(fused_activation_function), 0); 2508 } 2509 void add_cell_clip(float cell_clip) { 2510 fbb_.AddElement<float>(LSTMOptions::VT_CELL_CLIP, cell_clip, 0.0f); 2511 } 2512 void add_proj_clip(float proj_clip) { 2513 fbb_.AddElement<float>(LSTMOptions::VT_PROJ_CLIP, proj_clip, 0.0f); 2514 } 2515 explicit LSTMOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) 2516 : fbb_(_fbb) { 2517 start_ = fbb_.StartTable(); 2518 } 2519 LSTMOptionsBuilder &operator=(const LSTMOptionsBuilder &); 2520 flatbuffers::Offset<LSTMOptions> Finish() { 2521 const auto end = fbb_.EndTable(start_); 2522 auto o = flatbuffers::Offset<LSTMOptions>(end); 2523 return o; 2524 } 2525 }; 2526 2527 inline flatbuffers::Offset<LSTMOptions> CreateLSTMOptions( 2528 flatbuffers::FlatBufferBuilder &_fbb, 2529 ActivationFunctionType fused_activation_function = ActivationFunctionType_NONE, 2530 float cell_clip = 0.0f, 2531 float proj_clip = 0.0f) { 2532 LSTMOptionsBuilder builder_(_fbb); 2533 builder_.add_proj_clip(proj_clip); 2534 builder_.add_cell_clip(cell_clip); 2535 builder_.add_fused_activation_function(fused_activation_function); 2536 return builder_.Finish(); 2537 } 2538 2539 flatbuffers::Offset<LSTMOptions> CreateLSTMOptions(flatbuffers::FlatBufferBuilder &_fbb, const LSTMOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 2540 2541 struct ResizeBilinearOptionsT : public flatbuffers::NativeTable { 2542 typedef ResizeBilinearOptions TableType; 2543 bool align_corners; 2544 ResizeBilinearOptionsT() 2545 : align_corners(false) { 2546 } 2547 }; 2548 2549 struct ResizeBilinearOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 2550 typedef ResizeBilinearOptionsT NativeTableType; 2551 enum { 2552 VT_ALIGN_CORNERS = 8 2553 }; 2554 bool align_corners() const { 2555 return GetField<uint8_t>(VT_ALIGN_CORNERS, 0) != 0; 2556 } 2557 bool Verify(flatbuffers::Verifier &verifier) const { 2558 return VerifyTableStart(verifier) && 2559 VerifyField<uint8_t>(verifier, VT_ALIGN_CORNERS) && 2560 verifier.EndTable(); 2561 } 2562 ResizeBilinearOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 2563 void UnPackTo(ResizeBilinearOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 2564 static flatbuffers::Offset<ResizeBilinearOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const ResizeBilinearOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 2565 }; 2566 2567 struct ResizeBilinearOptionsBuilder { 2568 flatbuffers::FlatBufferBuilder &fbb_; 2569 flatbuffers::uoffset_t start_; 2570 void add_align_corners(bool align_corners) { 2571 fbb_.AddElement<uint8_t>(ResizeBilinearOptions::VT_ALIGN_CORNERS, static_cast<uint8_t>(align_corners), 0); 2572 } 2573 explicit ResizeBilinearOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) 2574 : fbb_(_fbb) { 2575 start_ = fbb_.StartTable(); 2576 } 2577 ResizeBilinearOptionsBuilder &operator=(const ResizeBilinearOptionsBuilder &); 2578 flatbuffers::Offset<ResizeBilinearOptions> Finish() { 2579 const auto end = fbb_.EndTable(start_); 2580 auto o = flatbuffers::Offset<ResizeBilinearOptions>(end); 2581 return o; 2582 } 2583 }; 2584 2585 inline flatbuffers::Offset<ResizeBilinearOptions> CreateResizeBilinearOptions( 2586 flatbuffers::FlatBufferBuilder &_fbb, 2587 bool align_corners = false) { 2588 ResizeBilinearOptionsBuilder builder_(_fbb); 2589 builder_.add_align_corners(align_corners); 2590 return builder_.Finish(); 2591 } 2592 2593 flatbuffers::Offset<ResizeBilinearOptions> CreateResizeBilinearOptions(flatbuffers::FlatBufferBuilder &_fbb, const ResizeBilinearOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 2594 2595 struct CallOptionsT : public flatbuffers::NativeTable { 2596 typedef CallOptions TableType; 2597 uint32_t subgraph; 2598 CallOptionsT() 2599 : subgraph(0) { 2600 } 2601 }; 2602 2603 struct CallOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 2604 typedef CallOptionsT NativeTableType; 2605 enum { 2606 VT_SUBGRAPH = 4 2607 }; 2608 uint32_t subgraph() const { 2609 return GetField<uint32_t>(VT_SUBGRAPH, 0); 2610 } 2611 bool Verify(flatbuffers::Verifier &verifier) const { 2612 return VerifyTableStart(verifier) && 2613 VerifyField<uint32_t>(verifier, VT_SUBGRAPH) && 2614 verifier.EndTable(); 2615 } 2616 CallOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 2617 void UnPackTo(CallOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 2618 static flatbuffers::Offset<CallOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const CallOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 2619 }; 2620 2621 struct CallOptionsBuilder { 2622 flatbuffers::FlatBufferBuilder &fbb_; 2623 flatbuffers::uoffset_t start_; 2624 void add_subgraph(uint32_t subgraph) { 2625 fbb_.AddElement<uint32_t>(CallOptions::VT_SUBGRAPH, subgraph, 0); 2626 } 2627 explicit CallOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) 2628 : fbb_(_fbb) { 2629 start_ = fbb_.StartTable(); 2630 } 2631 CallOptionsBuilder &operator=(const CallOptionsBuilder &); 2632 flatbuffers::Offset<CallOptions> Finish() { 2633 const auto end = fbb_.EndTable(start_); 2634 auto o = flatbuffers::Offset<CallOptions>(end); 2635 return o; 2636 } 2637 }; 2638 2639 inline flatbuffers::Offset<CallOptions> CreateCallOptions( 2640 flatbuffers::FlatBufferBuilder &_fbb, 2641 uint32_t subgraph = 0) { 2642 CallOptionsBuilder builder_(_fbb); 2643 builder_.add_subgraph(subgraph); 2644 return builder_.Finish(); 2645 } 2646 2647 flatbuffers::Offset<CallOptions> CreateCallOptions(flatbuffers::FlatBufferBuilder &_fbb, const CallOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 2648 2649 struct PadOptionsT : public flatbuffers::NativeTable { 2650 typedef PadOptions TableType; 2651 PadOptionsT() { 2652 } 2653 }; 2654 2655 struct PadOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 2656 typedef PadOptionsT NativeTableType; 2657 bool Verify(flatbuffers::Verifier &verifier) const { 2658 return VerifyTableStart(verifier) && 2659 verifier.EndTable(); 2660 } 2661 PadOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 2662 void UnPackTo(PadOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 2663 static flatbuffers::Offset<PadOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const PadOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 2664 }; 2665 2666 struct PadOptionsBuilder { 2667 flatbuffers::FlatBufferBuilder &fbb_; 2668 flatbuffers::uoffset_t start_; 2669 explicit PadOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) 2670 : fbb_(_fbb) { 2671 start_ = fbb_.StartTable(); 2672 } 2673 PadOptionsBuilder &operator=(const PadOptionsBuilder &); 2674 flatbuffers::Offset<PadOptions> Finish() { 2675 const auto end = fbb_.EndTable(start_); 2676 auto o = flatbuffers::Offset<PadOptions>(end); 2677 return o; 2678 } 2679 }; 2680 2681 inline flatbuffers::Offset<PadOptions> CreatePadOptions( 2682 flatbuffers::FlatBufferBuilder &_fbb) { 2683 PadOptionsBuilder builder_(_fbb); 2684 return builder_.Finish(); 2685 } 2686 2687 flatbuffers::Offset<PadOptions> CreatePadOptions(flatbuffers::FlatBufferBuilder &_fbb, const PadOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 2688 2689 struct ReshapeOptionsT : public flatbuffers::NativeTable { 2690 typedef ReshapeOptions TableType; 2691 std::vector<int32_t> new_shape; 2692 ReshapeOptionsT() { 2693 } 2694 }; 2695 2696 struct ReshapeOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 2697 typedef ReshapeOptionsT NativeTableType; 2698 enum { 2699 VT_NEW_SHAPE = 4 2700 }; 2701 const flatbuffers::Vector<int32_t> *new_shape() const { 2702 return GetPointer<const flatbuffers::Vector<int32_t> *>(VT_NEW_SHAPE); 2703 } 2704 bool Verify(flatbuffers::Verifier &verifier) const { 2705 return VerifyTableStart(verifier) && 2706 VerifyOffset(verifier, VT_NEW_SHAPE) && 2707 verifier.Verify(new_shape()) && 2708 verifier.EndTable(); 2709 } 2710 ReshapeOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 2711 void UnPackTo(ReshapeOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 2712 static flatbuffers::Offset<ReshapeOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const ReshapeOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 2713 }; 2714 2715 struct ReshapeOptionsBuilder { 2716 flatbuffers::FlatBufferBuilder &fbb_; 2717 flatbuffers::uoffset_t start_; 2718 void add_new_shape(flatbuffers::Offset<flatbuffers::Vector<int32_t>> new_shape) { 2719 fbb_.AddOffset(ReshapeOptions::VT_NEW_SHAPE, new_shape); 2720 } 2721 explicit ReshapeOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) 2722 : fbb_(_fbb) { 2723 start_ = fbb_.StartTable(); 2724 } 2725 ReshapeOptionsBuilder &operator=(const ReshapeOptionsBuilder &); 2726 flatbuffers::Offset<ReshapeOptions> Finish() { 2727 const auto end = fbb_.EndTable(start_); 2728 auto o = flatbuffers::Offset<ReshapeOptions>(end); 2729 return o; 2730 } 2731 }; 2732 2733 inline flatbuffers::Offset<ReshapeOptions> CreateReshapeOptions( 2734 flatbuffers::FlatBufferBuilder &_fbb, 2735 flatbuffers::Offset<flatbuffers::Vector<int32_t>> new_shape = 0) { 2736 ReshapeOptionsBuilder builder_(_fbb); 2737 builder_.add_new_shape(new_shape); 2738 return builder_.Finish(); 2739 } 2740 2741 inline flatbuffers::Offset<ReshapeOptions> CreateReshapeOptionsDirect( 2742 flatbuffers::FlatBufferBuilder &_fbb, 2743 const std::vector<int32_t> *new_shape = nullptr) { 2744 return tflite::CreateReshapeOptions( 2745 _fbb, 2746 new_shape ? _fbb.CreateVector<int32_t>(*new_shape) : 0); 2747 } 2748 2749 flatbuffers::Offset<ReshapeOptions> CreateReshapeOptions(flatbuffers::FlatBufferBuilder &_fbb, const ReshapeOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 2750 2751 struct SpaceToBatchNDOptionsT : public flatbuffers::NativeTable { 2752 typedef SpaceToBatchNDOptions TableType; 2753 SpaceToBatchNDOptionsT() { 2754 } 2755 }; 2756 2757 struct SpaceToBatchNDOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 2758 typedef SpaceToBatchNDOptionsT NativeTableType; 2759 bool Verify(flatbuffers::Verifier &verifier) const { 2760 return VerifyTableStart(verifier) && 2761 verifier.EndTable(); 2762 } 2763 SpaceToBatchNDOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 2764 void UnPackTo(SpaceToBatchNDOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 2765 static flatbuffers::Offset<SpaceToBatchNDOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const SpaceToBatchNDOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 2766 }; 2767 2768 struct SpaceToBatchNDOptionsBuilder { 2769 flatbuffers::FlatBufferBuilder &fbb_; 2770 flatbuffers::uoffset_t start_; 2771 explicit SpaceToBatchNDOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) 2772 : fbb_(_fbb) { 2773 start_ = fbb_.StartTable(); 2774 } 2775 SpaceToBatchNDOptionsBuilder &operator=(const SpaceToBatchNDOptionsBuilder &); 2776 flatbuffers::Offset<SpaceToBatchNDOptions> Finish() { 2777 const auto end = fbb_.EndTable(start_); 2778 auto o = flatbuffers::Offset<SpaceToBatchNDOptions>(end); 2779 return o; 2780 } 2781 }; 2782 2783 inline flatbuffers::Offset<SpaceToBatchNDOptions> CreateSpaceToBatchNDOptions( 2784 flatbuffers::FlatBufferBuilder &_fbb) { 2785 SpaceToBatchNDOptionsBuilder builder_(_fbb); 2786 return builder_.Finish(); 2787 } 2788 2789 flatbuffers::Offset<SpaceToBatchNDOptions> CreateSpaceToBatchNDOptions(flatbuffers::FlatBufferBuilder &_fbb, const SpaceToBatchNDOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 2790 2791 struct BatchToSpaceNDOptionsT : public flatbuffers::NativeTable { 2792 typedef BatchToSpaceNDOptions TableType; 2793 BatchToSpaceNDOptionsT() { 2794 } 2795 }; 2796 2797 struct BatchToSpaceNDOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 2798 typedef BatchToSpaceNDOptionsT NativeTableType; 2799 bool Verify(flatbuffers::Verifier &verifier) const { 2800 return VerifyTableStart(verifier) && 2801 verifier.EndTable(); 2802 } 2803 BatchToSpaceNDOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 2804 void UnPackTo(BatchToSpaceNDOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 2805 static flatbuffers::Offset<BatchToSpaceNDOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const BatchToSpaceNDOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 2806 }; 2807 2808 struct BatchToSpaceNDOptionsBuilder { 2809 flatbuffers::FlatBufferBuilder &fbb_; 2810 flatbuffers::uoffset_t start_; 2811 explicit BatchToSpaceNDOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) 2812 : fbb_(_fbb) { 2813 start_ = fbb_.StartTable(); 2814 } 2815 BatchToSpaceNDOptionsBuilder &operator=(const BatchToSpaceNDOptionsBuilder &); 2816 flatbuffers::Offset<BatchToSpaceNDOptions> Finish() { 2817 const auto end = fbb_.EndTable(start_); 2818 auto o = flatbuffers::Offset<BatchToSpaceNDOptions>(end); 2819 return o; 2820 } 2821 }; 2822 2823 inline flatbuffers::Offset<BatchToSpaceNDOptions> CreateBatchToSpaceNDOptions( 2824 flatbuffers::FlatBufferBuilder &_fbb) { 2825 BatchToSpaceNDOptionsBuilder builder_(_fbb); 2826 return builder_.Finish(); 2827 } 2828 2829 flatbuffers::Offset<BatchToSpaceNDOptions> CreateBatchToSpaceNDOptions(flatbuffers::FlatBufferBuilder &_fbb, const BatchToSpaceNDOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 2830 2831 struct SkipGramOptionsT : public flatbuffers::NativeTable { 2832 typedef SkipGramOptions TableType; 2833 int32_t ngram_size; 2834 int32_t max_skip_size; 2835 bool include_all_ngrams; 2836 SkipGramOptionsT() 2837 : ngram_size(0), 2838 max_skip_size(0), 2839 include_all_ngrams(false) { 2840 } 2841 }; 2842 2843 struct SkipGramOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 2844 typedef SkipGramOptionsT NativeTableType; 2845 enum { 2846 VT_NGRAM_SIZE = 4, 2847 VT_MAX_SKIP_SIZE = 6, 2848 VT_INCLUDE_ALL_NGRAMS = 8 2849 }; 2850 int32_t ngram_size() const { 2851 return GetField<int32_t>(VT_NGRAM_SIZE, 0); 2852 } 2853 int32_t max_skip_size() const { 2854 return GetField<int32_t>(VT_MAX_SKIP_SIZE, 0); 2855 } 2856 bool include_all_ngrams() const { 2857 return GetField<uint8_t>(VT_INCLUDE_ALL_NGRAMS, 0) != 0; 2858 } 2859 bool Verify(flatbuffers::Verifier &verifier) const { 2860 return VerifyTableStart(verifier) && 2861 VerifyField<int32_t>(verifier, VT_NGRAM_SIZE) && 2862 VerifyField<int32_t>(verifier, VT_MAX_SKIP_SIZE) && 2863 VerifyField<uint8_t>(verifier, VT_INCLUDE_ALL_NGRAMS) && 2864 verifier.EndTable(); 2865 } 2866 SkipGramOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 2867 void UnPackTo(SkipGramOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 2868 static flatbuffers::Offset<SkipGramOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const SkipGramOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 2869 }; 2870 2871 struct SkipGramOptionsBuilder { 2872 flatbuffers::FlatBufferBuilder &fbb_; 2873 flatbuffers::uoffset_t start_; 2874 void add_ngram_size(int32_t ngram_size) { 2875 fbb_.AddElement<int32_t>(SkipGramOptions::VT_NGRAM_SIZE, ngram_size, 0); 2876 } 2877 void add_max_skip_size(int32_t max_skip_size) { 2878 fbb_.AddElement<int32_t>(SkipGramOptions::VT_MAX_SKIP_SIZE, max_skip_size, 0); 2879 } 2880 void add_include_all_ngrams(bool include_all_ngrams) { 2881 fbb_.AddElement<uint8_t>(SkipGramOptions::VT_INCLUDE_ALL_NGRAMS, static_cast<uint8_t>(include_all_ngrams), 0); 2882 } 2883 explicit SkipGramOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) 2884 : fbb_(_fbb) { 2885 start_ = fbb_.StartTable(); 2886 } 2887 SkipGramOptionsBuilder &operator=(const SkipGramOptionsBuilder &); 2888 flatbuffers::Offset<SkipGramOptions> Finish() { 2889 const auto end = fbb_.EndTable(start_); 2890 auto o = flatbuffers::Offset<SkipGramOptions>(end); 2891 return o; 2892 } 2893 }; 2894 2895 inline flatbuffers::Offset<SkipGramOptions> CreateSkipGramOptions( 2896 flatbuffers::FlatBufferBuilder &_fbb, 2897 int32_t ngram_size = 0, 2898 int32_t max_skip_size = 0, 2899 bool include_all_ngrams = false) { 2900 SkipGramOptionsBuilder builder_(_fbb); 2901 builder_.add_max_skip_size(max_skip_size); 2902 builder_.add_ngram_size(ngram_size); 2903 builder_.add_include_all_ngrams(include_all_ngrams); 2904 return builder_.Finish(); 2905 } 2906 2907 flatbuffers::Offset<SkipGramOptions> CreateSkipGramOptions(flatbuffers::FlatBufferBuilder &_fbb, const SkipGramOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 2908 2909 struct SpaceToDepthOptionsT : public flatbuffers::NativeTable { 2910 typedef SpaceToDepthOptions TableType; 2911 int32_t block_size; 2912 SpaceToDepthOptionsT() 2913 : block_size(0) { 2914 } 2915 }; 2916 2917 struct SpaceToDepthOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 2918 typedef SpaceToDepthOptionsT NativeTableType; 2919 enum { 2920 VT_BLOCK_SIZE = 4 2921 }; 2922 int32_t block_size() const { 2923 return GetField<int32_t>(VT_BLOCK_SIZE, 0); 2924 } 2925 bool Verify(flatbuffers::Verifier &verifier) const { 2926 return VerifyTableStart(verifier) && 2927 VerifyField<int32_t>(verifier, VT_BLOCK_SIZE) && 2928 verifier.EndTable(); 2929 } 2930 SpaceToDepthOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 2931 void UnPackTo(SpaceToDepthOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 2932 static flatbuffers::Offset<SpaceToDepthOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const SpaceToDepthOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 2933 }; 2934 2935 struct SpaceToDepthOptionsBuilder { 2936 flatbuffers::FlatBufferBuilder &fbb_; 2937 flatbuffers::uoffset_t start_; 2938 void add_block_size(int32_t block_size) { 2939 fbb_.AddElement<int32_t>(SpaceToDepthOptions::VT_BLOCK_SIZE, block_size, 0); 2940 } 2941 explicit SpaceToDepthOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) 2942 : fbb_(_fbb) { 2943 start_ = fbb_.StartTable(); 2944 } 2945 SpaceToDepthOptionsBuilder &operator=(const SpaceToDepthOptionsBuilder &); 2946 flatbuffers::Offset<SpaceToDepthOptions> Finish() { 2947 const auto end = fbb_.EndTable(start_); 2948 auto o = flatbuffers::Offset<SpaceToDepthOptions>(end); 2949 return o; 2950 } 2951 }; 2952 2953 inline flatbuffers::Offset<SpaceToDepthOptions> CreateSpaceToDepthOptions( 2954 flatbuffers::FlatBufferBuilder &_fbb, 2955 int32_t block_size = 0) { 2956 SpaceToDepthOptionsBuilder builder_(_fbb); 2957 builder_.add_block_size(block_size); 2958 return builder_.Finish(); 2959 } 2960 2961 flatbuffers::Offset<SpaceToDepthOptions> CreateSpaceToDepthOptions(flatbuffers::FlatBufferBuilder &_fbb, const SpaceToDepthOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 2962 2963 struct SubOptionsT : public flatbuffers::NativeTable { 2964 typedef SubOptions TableType; 2965 ActivationFunctionType fused_activation_function; 2966 SubOptionsT() 2967 : fused_activation_function(ActivationFunctionType_NONE) { 2968 } 2969 }; 2970 2971 struct SubOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 2972 typedef SubOptionsT NativeTableType; 2973 enum { 2974 VT_FUSED_ACTIVATION_FUNCTION = 4 2975 }; 2976 ActivationFunctionType fused_activation_function() const { 2977 return static_cast<ActivationFunctionType>(GetField<int8_t>(VT_FUSED_ACTIVATION_FUNCTION, 0)); 2978 } 2979 bool Verify(flatbuffers::Verifier &verifier) const { 2980 return VerifyTableStart(verifier) && 2981 VerifyField<int8_t>(verifier, VT_FUSED_ACTIVATION_FUNCTION) && 2982 verifier.EndTable(); 2983 } 2984 SubOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 2985 void UnPackTo(SubOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 2986 static flatbuffers::Offset<SubOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const SubOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 2987 }; 2988 2989 struct SubOptionsBuilder { 2990 flatbuffers::FlatBufferBuilder &fbb_; 2991 flatbuffers::uoffset_t start_; 2992 void add_fused_activation_function(ActivationFunctionType fused_activation_function) { 2993 fbb_.AddElement<int8_t>(SubOptions::VT_FUSED_ACTIVATION_FUNCTION, static_cast<int8_t>(fused_activation_function), 0); 2994 } 2995 explicit SubOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) 2996 : fbb_(_fbb) { 2997 start_ = fbb_.StartTable(); 2998 } 2999 SubOptionsBuilder &operator=(const SubOptionsBuilder &); 3000 flatbuffers::Offset<SubOptions> Finish() { 3001 const auto end = fbb_.EndTable(start_); 3002 auto o = flatbuffers::Offset<SubOptions>(end); 3003 return o; 3004 } 3005 }; 3006 3007 inline flatbuffers::Offset<SubOptions> CreateSubOptions( 3008 flatbuffers::FlatBufferBuilder &_fbb, 3009 ActivationFunctionType fused_activation_function = ActivationFunctionType_NONE) { 3010 SubOptionsBuilder builder_(_fbb); 3011 builder_.add_fused_activation_function(fused_activation_function); 3012 return builder_.Finish(); 3013 } 3014 3015 flatbuffers::Offset<SubOptions> CreateSubOptions(flatbuffers::FlatBufferBuilder &_fbb, const SubOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 3016 3017 struct DivOptionsT : public flatbuffers::NativeTable { 3018 typedef DivOptions TableType; 3019 ActivationFunctionType fused_activation_function; 3020 DivOptionsT() 3021 : fused_activation_function(ActivationFunctionType_NONE) { 3022 } 3023 }; 3024 3025 struct DivOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 3026 typedef DivOptionsT NativeTableType; 3027 enum { 3028 VT_FUSED_ACTIVATION_FUNCTION = 4 3029 }; 3030 ActivationFunctionType fused_activation_function() const { 3031 return static_cast<ActivationFunctionType>(GetField<int8_t>(VT_FUSED_ACTIVATION_FUNCTION, 0)); 3032 } 3033 bool Verify(flatbuffers::Verifier &verifier) const { 3034 return VerifyTableStart(verifier) && 3035 VerifyField<int8_t>(verifier, VT_FUSED_ACTIVATION_FUNCTION) && 3036 verifier.EndTable(); 3037 } 3038 DivOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 3039 void UnPackTo(DivOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 3040 static flatbuffers::Offset<DivOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const DivOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 3041 }; 3042 3043 struct DivOptionsBuilder { 3044 flatbuffers::FlatBufferBuilder &fbb_; 3045 flatbuffers::uoffset_t start_; 3046 void add_fused_activation_function(ActivationFunctionType fused_activation_function) { 3047 fbb_.AddElement<int8_t>(DivOptions::VT_FUSED_ACTIVATION_FUNCTION, static_cast<int8_t>(fused_activation_function), 0); 3048 } 3049 explicit DivOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) 3050 : fbb_(_fbb) { 3051 start_ = fbb_.StartTable(); 3052 } 3053 DivOptionsBuilder &operator=(const DivOptionsBuilder &); 3054 flatbuffers::Offset<DivOptions> Finish() { 3055 const auto end = fbb_.EndTable(start_); 3056 auto o = flatbuffers::Offset<DivOptions>(end); 3057 return o; 3058 } 3059 }; 3060 3061 inline flatbuffers::Offset<DivOptions> CreateDivOptions( 3062 flatbuffers::FlatBufferBuilder &_fbb, 3063 ActivationFunctionType fused_activation_function = ActivationFunctionType_NONE) { 3064 DivOptionsBuilder builder_(_fbb); 3065 builder_.add_fused_activation_function(fused_activation_function); 3066 return builder_.Finish(); 3067 } 3068 3069 flatbuffers::Offset<DivOptions> CreateDivOptions(flatbuffers::FlatBufferBuilder &_fbb, const DivOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 3070 3071 struct TopKV2OptionsT : public flatbuffers::NativeTable { 3072 typedef TopKV2Options TableType; 3073 TopKV2OptionsT() { 3074 } 3075 }; 3076 3077 struct TopKV2Options FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 3078 typedef TopKV2OptionsT NativeTableType; 3079 bool Verify(flatbuffers::Verifier &verifier) const { 3080 return VerifyTableStart(verifier) && 3081 verifier.EndTable(); 3082 } 3083 TopKV2OptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 3084 void UnPackTo(TopKV2OptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 3085 static flatbuffers::Offset<TopKV2Options> Pack(flatbuffers::FlatBufferBuilder &_fbb, const TopKV2OptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 3086 }; 3087 3088 struct TopKV2OptionsBuilder { 3089 flatbuffers::FlatBufferBuilder &fbb_; 3090 flatbuffers::uoffset_t start_; 3091 explicit TopKV2OptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) 3092 : fbb_(_fbb) { 3093 start_ = fbb_.StartTable(); 3094 } 3095 TopKV2OptionsBuilder &operator=(const TopKV2OptionsBuilder &); 3096 flatbuffers::Offset<TopKV2Options> Finish() { 3097 const auto end = fbb_.EndTable(start_); 3098 auto o = flatbuffers::Offset<TopKV2Options>(end); 3099 return o; 3100 } 3101 }; 3102 3103 inline flatbuffers::Offset<TopKV2Options> CreateTopKV2Options( 3104 flatbuffers::FlatBufferBuilder &_fbb) { 3105 TopKV2OptionsBuilder builder_(_fbb); 3106 return builder_.Finish(); 3107 } 3108 3109 flatbuffers::Offset<TopKV2Options> CreateTopKV2Options(flatbuffers::FlatBufferBuilder &_fbb, const TopKV2OptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 3110 3111 struct EmbeddingLookupSparseOptionsT : public flatbuffers::NativeTable { 3112 typedef EmbeddingLookupSparseOptions TableType; 3113 CombinerType combiner; 3114 EmbeddingLookupSparseOptionsT() 3115 : combiner(CombinerType_SUM) { 3116 } 3117 }; 3118 3119 struct EmbeddingLookupSparseOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 3120 typedef EmbeddingLookupSparseOptionsT NativeTableType; 3121 enum { 3122 VT_COMBINER = 4 3123 }; 3124 CombinerType combiner() const { 3125 return static_cast<CombinerType>(GetField<int8_t>(VT_COMBINER, 0)); 3126 } 3127 bool Verify(flatbuffers::Verifier &verifier) const { 3128 return VerifyTableStart(verifier) && 3129 VerifyField<int8_t>(verifier, VT_COMBINER) && 3130 verifier.EndTable(); 3131 } 3132 EmbeddingLookupSparseOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 3133 void UnPackTo(EmbeddingLookupSparseOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 3134 static flatbuffers::Offset<EmbeddingLookupSparseOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const EmbeddingLookupSparseOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 3135 }; 3136 3137 struct EmbeddingLookupSparseOptionsBuilder { 3138 flatbuffers::FlatBufferBuilder &fbb_; 3139 flatbuffers::uoffset_t start_; 3140 void add_combiner(CombinerType combiner) { 3141 fbb_.AddElement<int8_t>(EmbeddingLookupSparseOptions::VT_COMBINER, static_cast<int8_t>(combiner), 0); 3142 } 3143 explicit EmbeddingLookupSparseOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) 3144 : fbb_(_fbb) { 3145 start_ = fbb_.StartTable(); 3146 } 3147 EmbeddingLookupSparseOptionsBuilder &operator=(const EmbeddingLookupSparseOptionsBuilder &); 3148 flatbuffers::Offset<EmbeddingLookupSparseOptions> Finish() { 3149 const auto end = fbb_.EndTable(start_); 3150 auto o = flatbuffers::Offset<EmbeddingLookupSparseOptions>(end); 3151 return o; 3152 } 3153 }; 3154 3155 inline flatbuffers::Offset<EmbeddingLookupSparseOptions> CreateEmbeddingLookupSparseOptions( 3156 flatbuffers::FlatBufferBuilder &_fbb, 3157 CombinerType combiner = CombinerType_SUM) { 3158 EmbeddingLookupSparseOptionsBuilder builder_(_fbb); 3159 builder_.add_combiner(combiner); 3160 return builder_.Finish(); 3161 } 3162 3163 flatbuffers::Offset<EmbeddingLookupSparseOptions> CreateEmbeddingLookupSparseOptions(flatbuffers::FlatBufferBuilder &_fbb, const EmbeddingLookupSparseOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 3164 3165 struct GatherOptionsT : public flatbuffers::NativeTable { 3166 typedef GatherOptions TableType; 3167 int32_t axis; 3168 GatherOptionsT() 3169 : axis(0) { 3170 } 3171 }; 3172 3173 struct GatherOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 3174 typedef GatherOptionsT NativeTableType; 3175 enum { 3176 VT_AXIS = 4 3177 }; 3178 int32_t axis() const { 3179 return GetField<int32_t>(VT_AXIS, 0); 3180 } 3181 bool Verify(flatbuffers::Verifier &verifier) const { 3182 return VerifyTableStart(verifier) && 3183 VerifyField<int32_t>(verifier, VT_AXIS) && 3184 verifier.EndTable(); 3185 } 3186 GatherOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 3187 void UnPackTo(GatherOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 3188 static flatbuffers::Offset<GatherOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const GatherOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 3189 }; 3190 3191 struct GatherOptionsBuilder { 3192 flatbuffers::FlatBufferBuilder &fbb_; 3193 flatbuffers::uoffset_t start_; 3194 void add_axis(int32_t axis) { 3195 fbb_.AddElement<int32_t>(GatherOptions::VT_AXIS, axis, 0); 3196 } 3197 explicit GatherOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) 3198 : fbb_(_fbb) { 3199 start_ = fbb_.StartTable(); 3200 } 3201 GatherOptionsBuilder &operator=(const GatherOptionsBuilder &); 3202 flatbuffers::Offset<GatherOptions> Finish() { 3203 const auto end = fbb_.EndTable(start_); 3204 auto o = flatbuffers::Offset<GatherOptions>(end); 3205 return o; 3206 } 3207 }; 3208 3209 inline flatbuffers::Offset<GatherOptions> CreateGatherOptions( 3210 flatbuffers::FlatBufferBuilder &_fbb, 3211 int32_t axis = 0) { 3212 GatherOptionsBuilder builder_(_fbb); 3213 builder_.add_axis(axis); 3214 return builder_.Finish(); 3215 } 3216 3217 flatbuffers::Offset<GatherOptions> CreateGatherOptions(flatbuffers::FlatBufferBuilder &_fbb, const GatherOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 3218 3219 struct TransposeOptionsT : public flatbuffers::NativeTable { 3220 typedef TransposeOptions TableType; 3221 TransposeOptionsT() { 3222 } 3223 }; 3224 3225 struct TransposeOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 3226 typedef TransposeOptionsT NativeTableType; 3227 bool Verify(flatbuffers::Verifier &verifier) const { 3228 return VerifyTableStart(verifier) && 3229 verifier.EndTable(); 3230 } 3231 TransposeOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 3232 void UnPackTo(TransposeOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 3233 static flatbuffers::Offset<TransposeOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const TransposeOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 3234 }; 3235 3236 struct TransposeOptionsBuilder { 3237 flatbuffers::FlatBufferBuilder &fbb_; 3238 flatbuffers::uoffset_t start_; 3239 explicit TransposeOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) 3240 : fbb_(_fbb) { 3241 start_ = fbb_.StartTable(); 3242 } 3243 TransposeOptionsBuilder &operator=(const TransposeOptionsBuilder &); 3244 flatbuffers::Offset<TransposeOptions> Finish() { 3245 const auto end = fbb_.EndTable(start_); 3246 auto o = flatbuffers::Offset<TransposeOptions>(end); 3247 return o; 3248 } 3249 }; 3250 3251 inline flatbuffers::Offset<TransposeOptions> CreateTransposeOptions( 3252 flatbuffers::FlatBufferBuilder &_fbb) { 3253 TransposeOptionsBuilder builder_(_fbb); 3254 return builder_.Finish(); 3255 } 3256 3257 flatbuffers::Offset<TransposeOptions> CreateTransposeOptions(flatbuffers::FlatBufferBuilder &_fbb, const TransposeOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 3258 3259 struct ExpOptionsT : public flatbuffers::NativeTable { 3260 typedef ExpOptions TableType; 3261 ExpOptionsT() { 3262 } 3263 }; 3264 3265 struct ExpOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 3266 typedef ExpOptionsT NativeTableType; 3267 bool Verify(flatbuffers::Verifier &verifier) const { 3268 return VerifyTableStart(verifier) && 3269 verifier.EndTable(); 3270 } 3271 ExpOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 3272 void UnPackTo(ExpOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 3273 static flatbuffers::Offset<ExpOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const ExpOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 3274 }; 3275 3276 struct ExpOptionsBuilder { 3277 flatbuffers::FlatBufferBuilder &fbb_; 3278 flatbuffers::uoffset_t start_; 3279 explicit ExpOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) 3280 : fbb_(_fbb) { 3281 start_ = fbb_.StartTable(); 3282 } 3283 ExpOptionsBuilder &operator=(const ExpOptionsBuilder &); 3284 flatbuffers::Offset<ExpOptions> Finish() { 3285 const auto end = fbb_.EndTable(start_); 3286 auto o = flatbuffers::Offset<ExpOptions>(end); 3287 return o; 3288 } 3289 }; 3290 3291 inline flatbuffers::Offset<ExpOptions> CreateExpOptions( 3292 flatbuffers::FlatBufferBuilder &_fbb) { 3293 ExpOptionsBuilder builder_(_fbb); 3294 return builder_.Finish(); 3295 } 3296 3297 flatbuffers::Offset<ExpOptions> CreateExpOptions(flatbuffers::FlatBufferBuilder &_fbb, const ExpOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 3298 3299 struct MeanOptionsT : public flatbuffers::NativeTable { 3300 typedef MeanOptions TableType; 3301 bool keep_dims; 3302 MeanOptionsT() 3303 : keep_dims(false) { 3304 } 3305 }; 3306 3307 struct MeanOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 3308 typedef MeanOptionsT NativeTableType; 3309 enum { 3310 VT_KEEP_DIMS = 4 3311 }; 3312 bool keep_dims() const { 3313 return GetField<uint8_t>(VT_KEEP_DIMS, 0) != 0; 3314 } 3315 bool Verify(flatbuffers::Verifier &verifier) const { 3316 return VerifyTableStart(verifier) && 3317 VerifyField<uint8_t>(verifier, VT_KEEP_DIMS) && 3318 verifier.EndTable(); 3319 } 3320 MeanOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 3321 void UnPackTo(MeanOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 3322 static flatbuffers::Offset<MeanOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const MeanOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 3323 }; 3324 3325 struct MeanOptionsBuilder { 3326 flatbuffers::FlatBufferBuilder &fbb_; 3327 flatbuffers::uoffset_t start_; 3328 void add_keep_dims(bool keep_dims) { 3329 fbb_.AddElement<uint8_t>(MeanOptions::VT_KEEP_DIMS, static_cast<uint8_t>(keep_dims), 0); 3330 } 3331 explicit MeanOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) 3332 : fbb_(_fbb) { 3333 start_ = fbb_.StartTable(); 3334 } 3335 MeanOptionsBuilder &operator=(const MeanOptionsBuilder &); 3336 flatbuffers::Offset<MeanOptions> Finish() { 3337 const auto end = fbb_.EndTable(start_); 3338 auto o = flatbuffers::Offset<MeanOptions>(end); 3339 return o; 3340 } 3341 }; 3342 3343 inline flatbuffers::Offset<MeanOptions> CreateMeanOptions( 3344 flatbuffers::FlatBufferBuilder &_fbb, 3345 bool keep_dims = false) { 3346 MeanOptionsBuilder builder_(_fbb); 3347 builder_.add_keep_dims(keep_dims); 3348 return builder_.Finish(); 3349 } 3350 3351 flatbuffers::Offset<MeanOptions> CreateMeanOptions(flatbuffers::FlatBufferBuilder &_fbb, const MeanOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 3352 3353 struct SqueezeOptionsT : public flatbuffers::NativeTable { 3354 typedef SqueezeOptions TableType; 3355 std::vector<int32_t> squeeze_dims; 3356 SqueezeOptionsT() { 3357 } 3358 }; 3359 3360 struct SqueezeOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 3361 typedef SqueezeOptionsT NativeTableType; 3362 enum { 3363 VT_SQUEEZE_DIMS = 4 3364 }; 3365 const flatbuffers::Vector<int32_t> *squeeze_dims() const { 3366 return GetPointer<const flatbuffers::Vector<int32_t> *>(VT_SQUEEZE_DIMS); 3367 } 3368 bool Verify(flatbuffers::Verifier &verifier) const { 3369 return VerifyTableStart(verifier) && 3370 VerifyOffset(verifier, VT_SQUEEZE_DIMS) && 3371 verifier.Verify(squeeze_dims()) && 3372 verifier.EndTable(); 3373 } 3374 SqueezeOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 3375 void UnPackTo(SqueezeOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 3376 static flatbuffers::Offset<SqueezeOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const SqueezeOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 3377 }; 3378 3379 struct SqueezeOptionsBuilder { 3380 flatbuffers::FlatBufferBuilder &fbb_; 3381 flatbuffers::uoffset_t start_; 3382 void add_squeeze_dims(flatbuffers::Offset<flatbuffers::Vector<int32_t>> squeeze_dims) { 3383 fbb_.AddOffset(SqueezeOptions::VT_SQUEEZE_DIMS, squeeze_dims); 3384 } 3385 explicit SqueezeOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) 3386 : fbb_(_fbb) { 3387 start_ = fbb_.StartTable(); 3388 } 3389 SqueezeOptionsBuilder &operator=(const SqueezeOptionsBuilder &); 3390 flatbuffers::Offset<SqueezeOptions> Finish() { 3391 const auto end = fbb_.EndTable(start_); 3392 auto o = flatbuffers::Offset<SqueezeOptions>(end); 3393 return o; 3394 } 3395 }; 3396 3397 inline flatbuffers::Offset<SqueezeOptions> CreateSqueezeOptions( 3398 flatbuffers::FlatBufferBuilder &_fbb, 3399 flatbuffers::Offset<flatbuffers::Vector<int32_t>> squeeze_dims = 0) { 3400 SqueezeOptionsBuilder builder_(_fbb); 3401 builder_.add_squeeze_dims(squeeze_dims); 3402 return builder_.Finish(); 3403 } 3404 3405 inline flatbuffers::Offset<SqueezeOptions> CreateSqueezeOptionsDirect( 3406 flatbuffers::FlatBufferBuilder &_fbb, 3407 const std::vector<int32_t> *squeeze_dims = nullptr) { 3408 return tflite::CreateSqueezeOptions( 3409 _fbb, 3410 squeeze_dims ? _fbb.CreateVector<int32_t>(*squeeze_dims) : 0); 3411 } 3412 3413 flatbuffers::Offset<SqueezeOptions> CreateSqueezeOptions(flatbuffers::FlatBufferBuilder &_fbb, const SqueezeOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 3414 3415 struct SplitOptionsT : public flatbuffers::NativeTable { 3416 typedef SplitOptions TableType; 3417 int32_t num_splits; 3418 SplitOptionsT() 3419 : num_splits(0) { 3420 } 3421 }; 3422 3423 struct SplitOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 3424 typedef SplitOptionsT NativeTableType; 3425 enum { 3426 VT_NUM_SPLITS = 4 3427 }; 3428 int32_t num_splits() const { 3429 return GetField<int32_t>(VT_NUM_SPLITS, 0); 3430 } 3431 bool Verify(flatbuffers::Verifier &verifier) const { 3432 return VerifyTableStart(verifier) && 3433 VerifyField<int32_t>(verifier, VT_NUM_SPLITS) && 3434 verifier.EndTable(); 3435 } 3436 SplitOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 3437 void UnPackTo(SplitOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 3438 static flatbuffers::Offset<SplitOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const SplitOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 3439 }; 3440 3441 struct SplitOptionsBuilder { 3442 flatbuffers::FlatBufferBuilder &fbb_; 3443 flatbuffers::uoffset_t start_; 3444 void add_num_splits(int32_t num_splits) { 3445 fbb_.AddElement<int32_t>(SplitOptions::VT_NUM_SPLITS, num_splits, 0); 3446 } 3447 explicit SplitOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) 3448 : fbb_(_fbb) { 3449 start_ = fbb_.StartTable(); 3450 } 3451 SplitOptionsBuilder &operator=(const SplitOptionsBuilder &); 3452 flatbuffers::Offset<SplitOptions> Finish() { 3453 const auto end = fbb_.EndTable(start_); 3454 auto o = flatbuffers::Offset<SplitOptions>(end); 3455 return o; 3456 } 3457 }; 3458 3459 inline flatbuffers::Offset<SplitOptions> CreateSplitOptions( 3460 flatbuffers::FlatBufferBuilder &_fbb, 3461 int32_t num_splits = 0) { 3462 SplitOptionsBuilder builder_(_fbb); 3463 builder_.add_num_splits(num_splits); 3464 return builder_.Finish(); 3465 } 3466 3467 flatbuffers::Offset<SplitOptions> CreateSplitOptions(flatbuffers::FlatBufferBuilder &_fbb, const SplitOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 3468 3469 struct StridedSliceOptionsT : public flatbuffers::NativeTable { 3470 typedef StridedSliceOptions TableType; 3471 int32_t begin_mask; 3472 int32_t end_mask; 3473 int32_t ellipsis_mask; 3474 int32_t new_axis_mask; 3475 int32_t shrink_axis_mask; 3476 StridedSliceOptionsT() 3477 : begin_mask(0), 3478 end_mask(0), 3479 ellipsis_mask(0), 3480 new_axis_mask(0), 3481 shrink_axis_mask(0) { 3482 } 3483 }; 3484 3485 struct StridedSliceOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 3486 typedef StridedSliceOptionsT NativeTableType; 3487 enum { 3488 VT_BEGIN_MASK = 4, 3489 VT_END_MASK = 6, 3490 VT_ELLIPSIS_MASK = 8, 3491 VT_NEW_AXIS_MASK = 10, 3492 VT_SHRINK_AXIS_MASK = 12 3493 }; 3494 int32_t begin_mask() const { 3495 return GetField<int32_t>(VT_BEGIN_MASK, 0); 3496 } 3497 int32_t end_mask() const { 3498 return GetField<int32_t>(VT_END_MASK, 0); 3499 } 3500 int32_t ellipsis_mask() const { 3501 return GetField<int32_t>(VT_ELLIPSIS_MASK, 0); 3502 } 3503 int32_t new_axis_mask() const { 3504 return GetField<int32_t>(VT_NEW_AXIS_MASK, 0); 3505 } 3506 int32_t shrink_axis_mask() const { 3507 return GetField<int32_t>(VT_SHRINK_AXIS_MASK, 0); 3508 } 3509 bool Verify(flatbuffers::Verifier &verifier) const { 3510 return VerifyTableStart(verifier) && 3511 VerifyField<int32_t>(verifier, VT_BEGIN_MASK) && 3512 VerifyField<int32_t>(verifier, VT_END_MASK) && 3513 VerifyField<int32_t>(verifier, VT_ELLIPSIS_MASK) && 3514 VerifyField<int32_t>(verifier, VT_NEW_AXIS_MASK) && 3515 VerifyField<int32_t>(verifier, VT_SHRINK_AXIS_MASK) && 3516 verifier.EndTable(); 3517 } 3518 StridedSliceOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 3519 void UnPackTo(StridedSliceOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 3520 static flatbuffers::Offset<StridedSliceOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const StridedSliceOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 3521 }; 3522 3523 struct StridedSliceOptionsBuilder { 3524 flatbuffers::FlatBufferBuilder &fbb_; 3525 flatbuffers::uoffset_t start_; 3526 void add_begin_mask(int32_t begin_mask) { 3527 fbb_.AddElement<int32_t>(StridedSliceOptions::VT_BEGIN_MASK, begin_mask, 0); 3528 } 3529 void add_end_mask(int32_t end_mask) { 3530 fbb_.AddElement<int32_t>(StridedSliceOptions::VT_END_MASK, end_mask, 0); 3531 } 3532 void add_ellipsis_mask(int32_t ellipsis_mask) { 3533 fbb_.AddElement<int32_t>(StridedSliceOptions::VT_ELLIPSIS_MASK, ellipsis_mask, 0); 3534 } 3535 void add_new_axis_mask(int32_t new_axis_mask) { 3536 fbb_.AddElement<int32_t>(StridedSliceOptions::VT_NEW_AXIS_MASK, new_axis_mask, 0); 3537 } 3538 void add_shrink_axis_mask(int32_t shrink_axis_mask) { 3539 fbb_.AddElement<int32_t>(StridedSliceOptions::VT_SHRINK_AXIS_MASK, shrink_axis_mask, 0); 3540 } 3541 explicit StridedSliceOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) 3542 : fbb_(_fbb) { 3543 start_ = fbb_.StartTable(); 3544 } 3545 StridedSliceOptionsBuilder &operator=(const StridedSliceOptionsBuilder &); 3546 flatbuffers::Offset<StridedSliceOptions> Finish() { 3547 const auto end = fbb_.EndTable(start_); 3548 auto o = flatbuffers::Offset<StridedSliceOptions>(end); 3549 return o; 3550 } 3551 }; 3552 3553 inline flatbuffers::Offset<StridedSliceOptions> CreateStridedSliceOptions( 3554 flatbuffers::FlatBufferBuilder &_fbb, 3555 int32_t begin_mask = 0, 3556 int32_t end_mask = 0, 3557 int32_t ellipsis_mask = 0, 3558 int32_t new_axis_mask = 0, 3559 int32_t shrink_axis_mask = 0) { 3560 StridedSliceOptionsBuilder builder_(_fbb); 3561 builder_.add_shrink_axis_mask(shrink_axis_mask); 3562 builder_.add_new_axis_mask(new_axis_mask); 3563 builder_.add_ellipsis_mask(ellipsis_mask); 3564 builder_.add_end_mask(end_mask); 3565 builder_.add_begin_mask(begin_mask); 3566 return builder_.Finish(); 3567 } 3568 3569 flatbuffers::Offset<StridedSliceOptions> CreateStridedSliceOptions(flatbuffers::FlatBufferBuilder &_fbb, const StridedSliceOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 3570 3571 struct OperatorCodeT : public flatbuffers::NativeTable { 3572 typedef OperatorCode TableType; 3573 BuiltinOperator builtin_code; 3574 std::string custom_code; 3575 OperatorCodeT() 3576 : builtin_code(BuiltinOperator_ADD) { 3577 } 3578 }; 3579 3580 struct OperatorCode FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 3581 typedef OperatorCodeT NativeTableType; 3582 enum { 3583 VT_BUILTIN_CODE = 4, 3584 VT_CUSTOM_CODE = 6 3585 }; 3586 BuiltinOperator builtin_code() const { 3587 return static_cast<BuiltinOperator>(GetField<int8_t>(VT_BUILTIN_CODE, 0)); 3588 } 3589 const flatbuffers::String *custom_code() const { 3590 return GetPointer<const flatbuffers::String *>(VT_CUSTOM_CODE); 3591 } 3592 bool Verify(flatbuffers::Verifier &verifier) const { 3593 return VerifyTableStart(verifier) && 3594 VerifyField<int8_t>(verifier, VT_BUILTIN_CODE) && 3595 VerifyOffset(verifier, VT_CUSTOM_CODE) && 3596 verifier.Verify(custom_code()) && 3597 verifier.EndTable(); 3598 } 3599 OperatorCodeT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 3600 void UnPackTo(OperatorCodeT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 3601 static flatbuffers::Offset<OperatorCode> Pack(flatbuffers::FlatBufferBuilder &_fbb, const OperatorCodeT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 3602 }; 3603 3604 struct OperatorCodeBuilder { 3605 flatbuffers::FlatBufferBuilder &fbb_; 3606 flatbuffers::uoffset_t start_; 3607 void add_builtin_code(BuiltinOperator builtin_code) { 3608 fbb_.AddElement<int8_t>(OperatorCode::VT_BUILTIN_CODE, static_cast<int8_t>(builtin_code), 0); 3609 } 3610 void add_custom_code(flatbuffers::Offset<flatbuffers::String> custom_code) { 3611 fbb_.AddOffset(OperatorCode::VT_CUSTOM_CODE, custom_code); 3612 } 3613 explicit OperatorCodeBuilder(flatbuffers::FlatBufferBuilder &_fbb) 3614 : fbb_(_fbb) { 3615 start_ = fbb_.StartTable(); 3616 } 3617 OperatorCodeBuilder &operator=(const OperatorCodeBuilder &); 3618 flatbuffers::Offset<OperatorCode> Finish() { 3619 const auto end = fbb_.EndTable(start_); 3620 auto o = flatbuffers::Offset<OperatorCode>(end); 3621 return o; 3622 } 3623 }; 3624 3625 inline flatbuffers::Offset<OperatorCode> CreateOperatorCode( 3626 flatbuffers::FlatBufferBuilder &_fbb, 3627 BuiltinOperator builtin_code = BuiltinOperator_ADD, 3628 flatbuffers::Offset<flatbuffers::String> custom_code = 0) { 3629 OperatorCodeBuilder builder_(_fbb); 3630 builder_.add_custom_code(custom_code); 3631 builder_.add_builtin_code(builtin_code); 3632 return builder_.Finish(); 3633 } 3634 3635 inline flatbuffers::Offset<OperatorCode> CreateOperatorCodeDirect( 3636 flatbuffers::FlatBufferBuilder &_fbb, 3637 BuiltinOperator builtin_code = BuiltinOperator_ADD, 3638 const char *custom_code = nullptr) { 3639 return tflite::CreateOperatorCode( 3640 _fbb, 3641 builtin_code, 3642 custom_code ? _fbb.CreateString(custom_code) : 0); 3643 } 3644 3645 flatbuffers::Offset<OperatorCode> CreateOperatorCode(flatbuffers::FlatBufferBuilder &_fbb, const OperatorCodeT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 3646 3647 struct OperatorT : public flatbuffers::NativeTable { 3648 typedef Operator TableType; 3649 uint32_t opcode_index; 3650 std::vector<int32_t> inputs; 3651 std::vector<int32_t> outputs; 3652 BuiltinOptionsUnion builtin_options; 3653 std::vector<uint8_t> custom_options; 3654 CustomOptionsFormat custom_options_format; 3655 OperatorT() 3656 : opcode_index(0), 3657 custom_options_format(CustomOptionsFormat_FLEXBUFFERS) { 3658 } 3659 }; 3660 3661 struct Operator FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 3662 typedef OperatorT NativeTableType; 3663 enum { 3664 VT_OPCODE_INDEX = 4, 3665 VT_INPUTS = 6, 3666 VT_OUTPUTS = 8, 3667 VT_BUILTIN_OPTIONS_TYPE = 10, 3668 VT_BUILTIN_OPTIONS = 12, 3669 VT_CUSTOM_OPTIONS = 14, 3670 VT_CUSTOM_OPTIONS_FORMAT = 16 3671 }; 3672 uint32_t opcode_index() const { 3673 return GetField<uint32_t>(VT_OPCODE_INDEX, 0); 3674 } 3675 const flatbuffers::Vector<int32_t> *inputs() const { 3676 return GetPointer<const flatbuffers::Vector<int32_t> *>(VT_INPUTS); 3677 } 3678 const flatbuffers::Vector<int32_t> *outputs() const { 3679 return GetPointer<const flatbuffers::Vector<int32_t> *>(VT_OUTPUTS); 3680 } 3681 BuiltinOptions builtin_options_type() const { 3682 return static_cast<BuiltinOptions>(GetField<uint8_t>(VT_BUILTIN_OPTIONS_TYPE, 0)); 3683 } 3684 const void *builtin_options() const { 3685 return GetPointer<const void *>(VT_BUILTIN_OPTIONS); 3686 } 3687 template<typename T> const T *builtin_options_as() const; 3688 const Conv2DOptions *builtin_options_as_Conv2DOptions() const { 3689 return builtin_options_type() == BuiltinOptions_Conv2DOptions ? static_cast<const Conv2DOptions *>(builtin_options()) : nullptr; 3690 } 3691 const DepthwiseConv2DOptions *builtin_options_as_DepthwiseConv2DOptions() const { 3692 return builtin_options_type() == BuiltinOptions_DepthwiseConv2DOptions ? static_cast<const DepthwiseConv2DOptions *>(builtin_options()) : nullptr; 3693 } 3694 const ConcatEmbeddingsOptions *builtin_options_as_ConcatEmbeddingsOptions() const { 3695 return builtin_options_type() == BuiltinOptions_ConcatEmbeddingsOptions ? static_cast<const ConcatEmbeddingsOptions *>(builtin_options()) : nullptr; 3696 } 3697 const LSHProjectionOptions *builtin_options_as_LSHProjectionOptions() const { 3698 return builtin_options_type() == BuiltinOptions_LSHProjectionOptions ? static_cast<const LSHProjectionOptions *>(builtin_options()) : nullptr; 3699 } 3700 const Pool2DOptions *builtin_options_as_Pool2DOptions() const { 3701 return builtin_options_type() == BuiltinOptions_Pool2DOptions ? static_cast<const Pool2DOptions *>(builtin_options()) : nullptr; 3702 } 3703 const SVDFOptions *builtin_options_as_SVDFOptions() const { 3704 return builtin_options_type() == BuiltinOptions_SVDFOptions ? static_cast<const SVDFOptions *>(builtin_options()) : nullptr; 3705 } 3706 const RNNOptions *builtin_options_as_RNNOptions() const { 3707 return builtin_options_type() == BuiltinOptions_RNNOptions ? static_cast<const RNNOptions *>(builtin_options()) : nullptr; 3708 } 3709 const FullyConnectedOptions *builtin_options_as_FullyConnectedOptions() const { 3710 return builtin_options_type() == BuiltinOptions_FullyConnectedOptions ? static_cast<const FullyConnectedOptions *>(builtin_options()) : nullptr; 3711 } 3712 const SoftmaxOptions *builtin_options_as_SoftmaxOptions() const { 3713 return builtin_options_type() == BuiltinOptions_SoftmaxOptions ? static_cast<const SoftmaxOptions *>(builtin_options()) : nullptr; 3714 } 3715 const ConcatenationOptions *builtin_options_as_ConcatenationOptions() const { 3716 return builtin_options_type() == BuiltinOptions_ConcatenationOptions ? static_cast<const ConcatenationOptions *>(builtin_options()) : nullptr; 3717 } 3718 const AddOptions *builtin_options_as_AddOptions() const { 3719 return builtin_options_type() == BuiltinOptions_AddOptions ? static_cast<const AddOptions *>(builtin_options()) : nullptr; 3720 } 3721 const L2NormOptions *builtin_options_as_L2NormOptions() const { 3722 return builtin_options_type() == BuiltinOptions_L2NormOptions ? static_cast<const L2NormOptions *>(builtin_options()) : nullptr; 3723 } 3724 const LocalResponseNormalizationOptions *builtin_options_as_LocalResponseNormalizationOptions() const { 3725 return builtin_options_type() == BuiltinOptions_LocalResponseNormalizationOptions ? static_cast<const LocalResponseNormalizationOptions *>(builtin_options()) : nullptr; 3726 } 3727 const LSTMOptions *builtin_options_as_LSTMOptions() const { 3728 return builtin_options_type() == BuiltinOptions_LSTMOptions ? static_cast<const LSTMOptions *>(builtin_options()) : nullptr; 3729 } 3730 const ResizeBilinearOptions *builtin_options_as_ResizeBilinearOptions() const { 3731 return builtin_options_type() == BuiltinOptions_ResizeBilinearOptions ? static_cast<const ResizeBilinearOptions *>(builtin_options()) : nullptr; 3732 } 3733 const CallOptions *builtin_options_as_CallOptions() const { 3734 return builtin_options_type() == BuiltinOptions_CallOptions ? static_cast<const CallOptions *>(builtin_options()) : nullptr; 3735 } 3736 const ReshapeOptions *builtin_options_as_ReshapeOptions() const { 3737 return builtin_options_type() == BuiltinOptions_ReshapeOptions ? static_cast<const ReshapeOptions *>(builtin_options()) : nullptr; 3738 } 3739 const SkipGramOptions *builtin_options_as_SkipGramOptions() const { 3740 return builtin_options_type() == BuiltinOptions_SkipGramOptions ? static_cast<const SkipGramOptions *>(builtin_options()) : nullptr; 3741 } 3742 const SpaceToDepthOptions *builtin_options_as_SpaceToDepthOptions() const { 3743 return builtin_options_type() == BuiltinOptions_SpaceToDepthOptions ? static_cast<const SpaceToDepthOptions *>(builtin_options()) : nullptr; 3744 } 3745 const EmbeddingLookupSparseOptions *builtin_options_as_EmbeddingLookupSparseOptions() const { 3746 return builtin_options_type() == BuiltinOptions_EmbeddingLookupSparseOptions ? static_cast<const EmbeddingLookupSparseOptions *>(builtin_options()) : nullptr; 3747 } 3748 const MulOptions *builtin_options_as_MulOptions() const { 3749 return builtin_options_type() == BuiltinOptions_MulOptions ? static_cast<const MulOptions *>(builtin_options()) : nullptr; 3750 } 3751 const PadOptions *builtin_options_as_PadOptions() const { 3752 return builtin_options_type() == BuiltinOptions_PadOptions ? static_cast<const PadOptions *>(builtin_options()) : nullptr; 3753 } 3754 const GatherOptions *builtin_options_as_GatherOptions() const { 3755 return builtin_options_type() == BuiltinOptions_GatherOptions ? static_cast<const GatherOptions *>(builtin_options()) : nullptr; 3756 } 3757 const BatchToSpaceNDOptions *builtin_options_as_BatchToSpaceNDOptions() const { 3758 return builtin_options_type() == BuiltinOptions_BatchToSpaceNDOptions ? static_cast<const BatchToSpaceNDOptions *>(builtin_options()) : nullptr; 3759 } 3760 const SpaceToBatchNDOptions *builtin_options_as_SpaceToBatchNDOptions() const { 3761 return builtin_options_type() == BuiltinOptions_SpaceToBatchNDOptions ? static_cast<const SpaceToBatchNDOptions *>(builtin_options()) : nullptr; 3762 } 3763 const TransposeOptions *builtin_options_as_TransposeOptions() const { 3764 return builtin_options_type() == BuiltinOptions_TransposeOptions ? static_cast<const TransposeOptions *>(builtin_options()) : nullptr; 3765 } 3766 const MeanOptions *builtin_options_as_MeanOptions() const { 3767 return builtin_options_type() == BuiltinOptions_MeanOptions ? static_cast<const MeanOptions *>(builtin_options()) : nullptr; 3768 } 3769 const SubOptions *builtin_options_as_SubOptions() const { 3770 return builtin_options_type() == BuiltinOptions_SubOptions ? static_cast<const SubOptions *>(builtin_options()) : nullptr; 3771 } 3772 const DivOptions *builtin_options_as_DivOptions() const { 3773 return builtin_options_type() == BuiltinOptions_DivOptions ? static_cast<const DivOptions *>(builtin_options()) : nullptr; 3774 } 3775 const SqueezeOptions *builtin_options_as_SqueezeOptions() const { 3776 return builtin_options_type() == BuiltinOptions_SqueezeOptions ? static_cast<const SqueezeOptions *>(builtin_options()) : nullptr; 3777 } 3778 const SequenceRNNOptions *builtin_options_as_SequenceRNNOptions() const { 3779 return builtin_options_type() == BuiltinOptions_SequenceRNNOptions ? static_cast<const SequenceRNNOptions *>(builtin_options()) : nullptr; 3780 } 3781 const StridedSliceOptions *builtin_options_as_StridedSliceOptions() const { 3782 return builtin_options_type() == BuiltinOptions_StridedSliceOptions ? static_cast<const StridedSliceOptions *>(builtin_options()) : nullptr; 3783 } 3784 const ExpOptions *builtin_options_as_ExpOptions() const { 3785 return builtin_options_type() == BuiltinOptions_ExpOptions ? static_cast<const ExpOptions *>(builtin_options()) : nullptr; 3786 } 3787 const TopKV2Options *builtin_options_as_TopKV2Options() const { 3788 return builtin_options_type() == BuiltinOptions_TopKV2Options ? static_cast<const TopKV2Options *>(builtin_options()) : nullptr; 3789 } 3790 const SplitOptions *builtin_options_as_SplitOptions() const { 3791 return builtin_options_type() == BuiltinOptions_SplitOptions ? static_cast<const SplitOptions *>(builtin_options()) : nullptr; 3792 } 3793 const flatbuffers::Vector<uint8_t> *custom_options() const { 3794 return GetPointer<const flatbuffers::Vector<uint8_t> *>(VT_CUSTOM_OPTIONS); 3795 } 3796 CustomOptionsFormat custom_options_format() const { 3797 return static_cast<CustomOptionsFormat>(GetField<int8_t>(VT_CUSTOM_OPTIONS_FORMAT, 0)); 3798 } 3799 bool Verify(flatbuffers::Verifier &verifier) const { 3800 return VerifyTableStart(verifier) && 3801 VerifyField<uint32_t>(verifier, VT_OPCODE_INDEX) && 3802 VerifyOffset(verifier, VT_INPUTS) && 3803 verifier.Verify(inputs()) && 3804 VerifyOffset(verifier, VT_OUTPUTS) && 3805 verifier.Verify(outputs()) && 3806 VerifyField<uint8_t>(verifier, VT_BUILTIN_OPTIONS_TYPE) && 3807 VerifyOffset(verifier, VT_BUILTIN_OPTIONS) && 3808 VerifyBuiltinOptions(verifier, builtin_options(), builtin_options_type()) && 3809 VerifyOffset(verifier, VT_CUSTOM_OPTIONS) && 3810 verifier.Verify(custom_options()) && 3811 VerifyField<int8_t>(verifier, VT_CUSTOM_OPTIONS_FORMAT) && 3812 verifier.EndTable(); 3813 } 3814 OperatorT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 3815 void UnPackTo(OperatorT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 3816 static flatbuffers::Offset<Operator> Pack(flatbuffers::FlatBufferBuilder &_fbb, const OperatorT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 3817 }; 3818 3819 template<> inline const Conv2DOptions *Operator::builtin_options_as<Conv2DOptions>() const { 3820 return builtin_options_as_Conv2DOptions(); 3821 } 3822 3823 template<> inline const DepthwiseConv2DOptions *Operator::builtin_options_as<DepthwiseConv2DOptions>() const { 3824 return builtin_options_as_DepthwiseConv2DOptions(); 3825 } 3826 3827 template<> inline const ConcatEmbeddingsOptions *Operator::builtin_options_as<ConcatEmbeddingsOptions>() const { 3828 return builtin_options_as_ConcatEmbeddingsOptions(); 3829 } 3830 3831 template<> inline const LSHProjectionOptions *Operator::builtin_options_as<LSHProjectionOptions>() const { 3832 return builtin_options_as_LSHProjectionOptions(); 3833 } 3834 3835 template<> inline const Pool2DOptions *Operator::builtin_options_as<Pool2DOptions>() const { 3836 return builtin_options_as_Pool2DOptions(); 3837 } 3838 3839 template<> inline const SVDFOptions *Operator::builtin_options_as<SVDFOptions>() const { 3840 return builtin_options_as_SVDFOptions(); 3841 } 3842 3843 template<> inline const RNNOptions *Operator::builtin_options_as<RNNOptions>() const { 3844 return builtin_options_as_RNNOptions(); 3845 } 3846 3847 template<> inline const FullyConnectedOptions *Operator::builtin_options_as<FullyConnectedOptions>() const { 3848 return builtin_options_as_FullyConnectedOptions(); 3849 } 3850 3851 template<> inline const SoftmaxOptions *Operator::builtin_options_as<SoftmaxOptions>() const { 3852 return builtin_options_as_SoftmaxOptions(); 3853 } 3854 3855 template<> inline const ConcatenationOptions *Operator::builtin_options_as<ConcatenationOptions>() const { 3856 return builtin_options_as_ConcatenationOptions(); 3857 } 3858 3859 template<> inline const AddOptions *Operator::builtin_options_as<AddOptions>() const { 3860 return builtin_options_as_AddOptions(); 3861 } 3862 3863 template<> inline const L2NormOptions *Operator::builtin_options_as<L2NormOptions>() const { 3864 return builtin_options_as_L2NormOptions(); 3865 } 3866 3867 template<> inline const LocalResponseNormalizationOptions *Operator::builtin_options_as<LocalResponseNormalizationOptions>() const { 3868 return builtin_options_as_LocalResponseNormalizationOptions(); 3869 } 3870 3871 template<> inline const LSTMOptions *Operator::builtin_options_as<LSTMOptions>() const { 3872 return builtin_options_as_LSTMOptions(); 3873 } 3874 3875 template<> inline const ResizeBilinearOptions *Operator::builtin_options_as<ResizeBilinearOptions>() const { 3876 return builtin_options_as_ResizeBilinearOptions(); 3877 } 3878 3879 template<> inline const CallOptions *Operator::builtin_options_as<CallOptions>() const { 3880 return builtin_options_as_CallOptions(); 3881 } 3882 3883 template<> inline const ReshapeOptions *Operator::builtin_options_as<ReshapeOptions>() const { 3884 return builtin_options_as_ReshapeOptions(); 3885 } 3886 3887 template<> inline const SkipGramOptions *Operator::builtin_options_as<SkipGramOptions>() const { 3888 return builtin_options_as_SkipGramOptions(); 3889 } 3890 3891 template<> inline const SpaceToDepthOptions *Operator::builtin_options_as<SpaceToDepthOptions>() const { 3892 return builtin_options_as_SpaceToDepthOptions(); 3893 } 3894 3895 template<> inline const EmbeddingLookupSparseOptions *Operator::builtin_options_as<EmbeddingLookupSparseOptions>() const { 3896 return builtin_options_as_EmbeddingLookupSparseOptions(); 3897 } 3898 3899 template<> inline const MulOptions *Operator::builtin_options_as<MulOptions>() const { 3900 return builtin_options_as_MulOptions(); 3901 } 3902 3903 template<> inline const PadOptions *Operator::builtin_options_as<PadOptions>() const { 3904 return builtin_options_as_PadOptions(); 3905 } 3906 3907 template<> inline const GatherOptions *Operator::builtin_options_as<GatherOptions>() const { 3908 return builtin_options_as_GatherOptions(); 3909 } 3910 3911 template<> inline const BatchToSpaceNDOptions *Operator::builtin_options_as<BatchToSpaceNDOptions>() const { 3912 return builtin_options_as_BatchToSpaceNDOptions(); 3913 } 3914 3915 template<> inline const SpaceToBatchNDOptions *Operator::builtin_options_as<SpaceToBatchNDOptions>() const { 3916 return builtin_options_as_SpaceToBatchNDOptions(); 3917 } 3918 3919 template<> inline const TransposeOptions *Operator::builtin_options_as<TransposeOptions>() const { 3920 return builtin_options_as_TransposeOptions(); 3921 } 3922 3923 template<> inline const MeanOptions *Operator::builtin_options_as<MeanOptions>() const { 3924 return builtin_options_as_MeanOptions(); 3925 } 3926 3927 template<> inline const SubOptions *Operator::builtin_options_as<SubOptions>() const { 3928 return builtin_options_as_SubOptions(); 3929 } 3930 3931 template<> inline const DivOptions *Operator::builtin_options_as<DivOptions>() const { 3932 return builtin_options_as_DivOptions(); 3933 } 3934 3935 template<> inline const SqueezeOptions *Operator::builtin_options_as<SqueezeOptions>() const { 3936 return builtin_options_as_SqueezeOptions(); 3937 } 3938 3939 template<> inline const SequenceRNNOptions *Operator::builtin_options_as<SequenceRNNOptions>() const { 3940 return builtin_options_as_SequenceRNNOptions(); 3941 } 3942 3943 template<> inline const StridedSliceOptions *Operator::builtin_options_as<StridedSliceOptions>() const { 3944 return builtin_options_as_StridedSliceOptions(); 3945 } 3946 3947 template<> inline const ExpOptions *Operator::builtin_options_as<ExpOptions>() const { 3948 return builtin_options_as_ExpOptions(); 3949 } 3950 3951 template<> inline const TopKV2Options *Operator::builtin_options_as<TopKV2Options>() const { 3952 return builtin_options_as_TopKV2Options(); 3953 } 3954 3955 template<> inline const SplitOptions *Operator::builtin_options_as<SplitOptions>() const { 3956 return builtin_options_as_SplitOptions(); 3957 } 3958 3959 struct OperatorBuilder { 3960 flatbuffers::FlatBufferBuilder &fbb_; 3961 flatbuffers::uoffset_t start_; 3962 void add_opcode_index(uint32_t opcode_index) { 3963 fbb_.AddElement<uint32_t>(Operator::VT_OPCODE_INDEX, opcode_index, 0); 3964 } 3965 void add_inputs(flatbuffers::Offset<flatbuffers::Vector<int32_t>> inputs) { 3966 fbb_.AddOffset(Operator::VT_INPUTS, inputs); 3967 } 3968 void add_outputs(flatbuffers::Offset<flatbuffers::Vector<int32_t>> outputs) { 3969 fbb_.AddOffset(Operator::VT_OUTPUTS, outputs); 3970 } 3971 void add_builtin_options_type(BuiltinOptions builtin_options_type) { 3972 fbb_.AddElement<uint8_t>(Operator::VT_BUILTIN_OPTIONS_TYPE, static_cast<uint8_t>(builtin_options_type), 0); 3973 } 3974 void add_builtin_options(flatbuffers::Offset<void> builtin_options) { 3975 fbb_.AddOffset(Operator::VT_BUILTIN_OPTIONS, builtin_options); 3976 } 3977 void add_custom_options(flatbuffers::Offset<flatbuffers::Vector<uint8_t>> custom_options) { 3978 fbb_.AddOffset(Operator::VT_CUSTOM_OPTIONS, custom_options); 3979 } 3980 void add_custom_options_format(CustomOptionsFormat custom_options_format) { 3981 fbb_.AddElement<int8_t>(Operator::VT_CUSTOM_OPTIONS_FORMAT, static_cast<int8_t>(custom_options_format), 0); 3982 } 3983 explicit OperatorBuilder(flatbuffers::FlatBufferBuilder &_fbb) 3984 : fbb_(_fbb) { 3985 start_ = fbb_.StartTable(); 3986 } 3987 OperatorBuilder &operator=(const OperatorBuilder &); 3988 flatbuffers::Offset<Operator> Finish() { 3989 const auto end = fbb_.EndTable(start_); 3990 auto o = flatbuffers::Offset<Operator>(end); 3991 return o; 3992 } 3993 }; 3994 3995 inline flatbuffers::Offset<Operator> CreateOperator( 3996 flatbuffers::FlatBufferBuilder &_fbb, 3997 uint32_t opcode_index = 0, 3998 flatbuffers::Offset<flatbuffers::Vector<int32_t>> inputs = 0, 3999 flatbuffers::Offset<flatbuffers::Vector<int32_t>> outputs = 0, 4000 BuiltinOptions builtin_options_type = BuiltinOptions_NONE, 4001 flatbuffers::Offset<void> builtin_options = 0, 4002 flatbuffers::Offset<flatbuffers::Vector<uint8_t>> custom_options = 0, 4003 CustomOptionsFormat custom_options_format = CustomOptionsFormat_FLEXBUFFERS) { 4004 OperatorBuilder builder_(_fbb); 4005 builder_.add_custom_options(custom_options); 4006 builder_.add_builtin_options(builtin_options); 4007 builder_.add_outputs(outputs); 4008 builder_.add_inputs(inputs); 4009 builder_.add_opcode_index(opcode_index); 4010 builder_.add_custom_options_format(custom_options_format); 4011 builder_.add_builtin_options_type(builtin_options_type); 4012 return builder_.Finish(); 4013 } 4014 4015 inline flatbuffers::Offset<Operator> CreateOperatorDirect( 4016 flatbuffers::FlatBufferBuilder &_fbb, 4017 uint32_t opcode_index = 0, 4018 const std::vector<int32_t> *inputs = nullptr, 4019 const std::vector<int32_t> *outputs = nullptr, 4020 BuiltinOptions builtin_options_type = BuiltinOptions_NONE, 4021 flatbuffers::Offset<void> builtin_options = 0, 4022 const std::vector<uint8_t> *custom_options = nullptr, 4023 CustomOptionsFormat custom_options_format = CustomOptionsFormat_FLEXBUFFERS) { 4024 return tflite::CreateOperator( 4025 _fbb, 4026 opcode_index, 4027 inputs ? _fbb.CreateVector<int32_t>(*inputs) : 0, 4028 outputs ? _fbb.CreateVector<int32_t>(*outputs) : 0, 4029 builtin_options_type, 4030 builtin_options, 4031 custom_options ? _fbb.CreateVector<uint8_t>(*custom_options) : 0, 4032 custom_options_format); 4033 } 4034 4035 flatbuffers::Offset<Operator> CreateOperator(flatbuffers::FlatBufferBuilder &_fbb, const OperatorT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 4036 4037 struct SubGraphT : public flatbuffers::NativeTable { 4038 typedef SubGraph TableType; 4039 std::vector<std::unique_ptr<TensorT>> tensors; 4040 std::vector<int32_t> inputs; 4041 std::vector<int32_t> outputs; 4042 std::vector<std::unique_ptr<OperatorT>> operators; 4043 std::string name; 4044 SubGraphT() { 4045 } 4046 }; 4047 4048 struct SubGraph FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 4049 typedef SubGraphT NativeTableType; 4050 enum { 4051 VT_TENSORS = 4, 4052 VT_INPUTS = 6, 4053 VT_OUTPUTS = 8, 4054 VT_OPERATORS = 10, 4055 VT_NAME = 12 4056 }; 4057 const flatbuffers::Vector<flatbuffers::Offset<Tensor>> *tensors() const { 4058 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<Tensor>> *>(VT_TENSORS); 4059 } 4060 const flatbuffers::Vector<int32_t> *inputs() const { 4061 return GetPointer<const flatbuffers::Vector<int32_t> *>(VT_INPUTS); 4062 } 4063 const flatbuffers::Vector<int32_t> *outputs() const { 4064 return GetPointer<const flatbuffers::Vector<int32_t> *>(VT_OUTPUTS); 4065 } 4066 const flatbuffers::Vector<flatbuffers::Offset<Operator>> *operators() const { 4067 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<Operator>> *>(VT_OPERATORS); 4068 } 4069 const flatbuffers::String *name() const { 4070 return GetPointer<const flatbuffers::String *>(VT_NAME); 4071 } 4072 bool Verify(flatbuffers::Verifier &verifier) const { 4073 return VerifyTableStart(verifier) && 4074 VerifyOffset(verifier, VT_TENSORS) && 4075 verifier.Verify(tensors()) && 4076 verifier.VerifyVectorOfTables(tensors()) && 4077 VerifyOffset(verifier, VT_INPUTS) && 4078 verifier.Verify(inputs()) && 4079 VerifyOffset(verifier, VT_OUTPUTS) && 4080 verifier.Verify(outputs()) && 4081 VerifyOffset(verifier, VT_OPERATORS) && 4082 verifier.Verify(operators()) && 4083 verifier.VerifyVectorOfTables(operators()) && 4084 VerifyOffset(verifier, VT_NAME) && 4085 verifier.Verify(name()) && 4086 verifier.EndTable(); 4087 } 4088 SubGraphT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 4089 void UnPackTo(SubGraphT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 4090 static flatbuffers::Offset<SubGraph> Pack(flatbuffers::FlatBufferBuilder &_fbb, const SubGraphT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 4091 }; 4092 4093 struct SubGraphBuilder { 4094 flatbuffers::FlatBufferBuilder &fbb_; 4095 flatbuffers::uoffset_t start_; 4096 void add_tensors(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<Tensor>>> tensors) { 4097 fbb_.AddOffset(SubGraph::VT_TENSORS, tensors); 4098 } 4099 void add_inputs(flatbuffers::Offset<flatbuffers::Vector<int32_t>> inputs) { 4100 fbb_.AddOffset(SubGraph::VT_INPUTS, inputs); 4101 } 4102 void add_outputs(flatbuffers::Offset<flatbuffers::Vector<int32_t>> outputs) { 4103 fbb_.AddOffset(SubGraph::VT_OUTPUTS, outputs); 4104 } 4105 void add_operators(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<Operator>>> operators) { 4106 fbb_.AddOffset(SubGraph::VT_OPERATORS, operators); 4107 } 4108 void add_name(flatbuffers::Offset<flatbuffers::String> name) { 4109 fbb_.AddOffset(SubGraph::VT_NAME, name); 4110 } 4111 explicit SubGraphBuilder(flatbuffers::FlatBufferBuilder &_fbb) 4112 : fbb_(_fbb) { 4113 start_ = fbb_.StartTable(); 4114 } 4115 SubGraphBuilder &operator=(const SubGraphBuilder &); 4116 flatbuffers::Offset<SubGraph> Finish() { 4117 const auto end = fbb_.EndTable(start_); 4118 auto o = flatbuffers::Offset<SubGraph>(end); 4119 return o; 4120 } 4121 }; 4122 4123 inline flatbuffers::Offset<SubGraph> CreateSubGraph( 4124 flatbuffers::FlatBufferBuilder &_fbb, 4125 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<Tensor>>> tensors = 0, 4126 flatbuffers::Offset<flatbuffers::Vector<int32_t>> inputs = 0, 4127 flatbuffers::Offset<flatbuffers::Vector<int32_t>> outputs = 0, 4128 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<Operator>>> operators = 0, 4129 flatbuffers::Offset<flatbuffers::String> name = 0) { 4130 SubGraphBuilder builder_(_fbb); 4131 builder_.add_name(name); 4132 builder_.add_operators(operators); 4133 builder_.add_outputs(outputs); 4134 builder_.add_inputs(inputs); 4135 builder_.add_tensors(tensors); 4136 return builder_.Finish(); 4137 } 4138 4139 inline flatbuffers::Offset<SubGraph> CreateSubGraphDirect( 4140 flatbuffers::FlatBufferBuilder &_fbb, 4141 const std::vector<flatbuffers::Offset<Tensor>> *tensors = nullptr, 4142 const std::vector<int32_t> *inputs = nullptr, 4143 const std::vector<int32_t> *outputs = nullptr, 4144 const std::vector<flatbuffers::Offset<Operator>> *operators = nullptr, 4145 const char *name = nullptr) { 4146 return tflite::CreateSubGraph( 4147 _fbb, 4148 tensors ? _fbb.CreateVector<flatbuffers::Offset<Tensor>>(*tensors) : 0, 4149 inputs ? _fbb.CreateVector<int32_t>(*inputs) : 0, 4150 outputs ? _fbb.CreateVector<int32_t>(*outputs) : 0, 4151 operators ? _fbb.CreateVector<flatbuffers::Offset<Operator>>(*operators) : 0, 4152 name ? _fbb.CreateString(name) : 0); 4153 } 4154 4155 flatbuffers::Offset<SubGraph> CreateSubGraph(flatbuffers::FlatBufferBuilder &_fbb, const SubGraphT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 4156 4157 struct BufferT : public flatbuffers::NativeTable { 4158 typedef Buffer TableType; 4159 std::vector<uint8_t> data; 4160 BufferT() { 4161 } 4162 }; 4163 4164 struct Buffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 4165 typedef BufferT NativeTableType; 4166 enum { 4167 VT_DATA = 4 4168 }; 4169 const flatbuffers::Vector<uint8_t> *data() const { 4170 return GetPointer<const flatbuffers::Vector<uint8_t> *>(VT_DATA); 4171 } 4172 bool Verify(flatbuffers::Verifier &verifier) const { 4173 return VerifyTableStart(verifier) && 4174 VerifyOffset(verifier, VT_DATA) && 4175 verifier.Verify(data()) && 4176 verifier.EndTable(); 4177 } 4178 BufferT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 4179 void UnPackTo(BufferT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 4180 static flatbuffers::Offset<Buffer> Pack(flatbuffers::FlatBufferBuilder &_fbb, const BufferT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 4181 }; 4182 4183 struct BufferBuilder { 4184 flatbuffers::FlatBufferBuilder &fbb_; 4185 flatbuffers::uoffset_t start_; 4186 void add_data(flatbuffers::Offset<flatbuffers::Vector<uint8_t>> data) { 4187 fbb_.AddOffset(Buffer::VT_DATA, data); 4188 } 4189 explicit BufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) 4190 : fbb_(_fbb) { 4191 start_ = fbb_.StartTable(); 4192 } 4193 BufferBuilder &operator=(const BufferBuilder &); 4194 flatbuffers::Offset<Buffer> Finish() { 4195 const auto end = fbb_.EndTable(start_); 4196 auto o = flatbuffers::Offset<Buffer>(end); 4197 return o; 4198 } 4199 }; 4200 4201 inline flatbuffers::Offset<Buffer> CreateBuffer( 4202 flatbuffers::FlatBufferBuilder &_fbb, 4203 flatbuffers::Offset<flatbuffers::Vector<uint8_t>> data = 0) { 4204 BufferBuilder builder_(_fbb); 4205 builder_.add_data(data); 4206 return builder_.Finish(); 4207 } 4208 4209 inline flatbuffers::Offset<Buffer> CreateBufferDirect( 4210 flatbuffers::FlatBufferBuilder &_fbb, 4211 const std::vector<uint8_t> *data = nullptr) { 4212 return tflite::CreateBuffer( 4213 _fbb, 4214 data ? _fbb.CreateVector<uint8_t>(*data) : 0); 4215 } 4216 4217 flatbuffers::Offset<Buffer> CreateBuffer(flatbuffers::FlatBufferBuilder &_fbb, const BufferT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 4218 4219 struct ModelT : public flatbuffers::NativeTable { 4220 typedef Model TableType; 4221 uint32_t version; 4222 std::vector<std::unique_ptr<OperatorCodeT>> operator_codes; 4223 std::vector<std::unique_ptr<SubGraphT>> subgraphs; 4224 std::string description; 4225 std::vector<std::unique_ptr<BufferT>> buffers; 4226 ModelT() 4227 : version(0) { 4228 } 4229 }; 4230 4231 struct Model FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { 4232 typedef ModelT NativeTableType; 4233 enum { 4234 VT_VERSION = 4, 4235 VT_OPERATOR_CODES = 6, 4236 VT_SUBGRAPHS = 8, 4237 VT_DESCRIPTION = 10, 4238 VT_BUFFERS = 12 4239 }; 4240 uint32_t version() const { 4241 return GetField<uint32_t>(VT_VERSION, 0); 4242 } 4243 const flatbuffers::Vector<flatbuffers::Offset<OperatorCode>> *operator_codes() const { 4244 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<OperatorCode>> *>(VT_OPERATOR_CODES); 4245 } 4246 const flatbuffers::Vector<flatbuffers::Offset<SubGraph>> *subgraphs() const { 4247 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<SubGraph>> *>(VT_SUBGRAPHS); 4248 } 4249 const flatbuffers::String *description() const { 4250 return GetPointer<const flatbuffers::String *>(VT_DESCRIPTION); 4251 } 4252 const flatbuffers::Vector<flatbuffers::Offset<Buffer>> *buffers() const { 4253 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<Buffer>> *>(VT_BUFFERS); 4254 } 4255 bool Verify(flatbuffers::Verifier &verifier) const { 4256 return VerifyTableStart(verifier) && 4257 VerifyField<uint32_t>(verifier, VT_VERSION) && 4258 VerifyOffset(verifier, VT_OPERATOR_CODES) && 4259 verifier.Verify(operator_codes()) && 4260 verifier.VerifyVectorOfTables(operator_codes()) && 4261 VerifyOffset(verifier, VT_SUBGRAPHS) && 4262 verifier.Verify(subgraphs()) && 4263 verifier.VerifyVectorOfTables(subgraphs()) && 4264 VerifyOffset(verifier, VT_DESCRIPTION) && 4265 verifier.Verify(description()) && 4266 VerifyOffset(verifier, VT_BUFFERS) && 4267 verifier.Verify(buffers()) && 4268 verifier.VerifyVectorOfTables(buffers()) && 4269 verifier.EndTable(); 4270 } 4271 ModelT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; 4272 void UnPackTo(ModelT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; 4273 static flatbuffers::Offset<Model> Pack(flatbuffers::FlatBufferBuilder &_fbb, const ModelT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 4274 }; 4275 4276 struct ModelBuilder { 4277 flatbuffers::FlatBufferBuilder &fbb_; 4278 flatbuffers::uoffset_t start_; 4279 void add_version(uint32_t version) { 4280 fbb_.AddElement<uint32_t>(Model::VT_VERSION, version, 0); 4281 } 4282 void add_operator_codes(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<OperatorCode>>> operator_codes) { 4283 fbb_.AddOffset(Model::VT_OPERATOR_CODES, operator_codes); 4284 } 4285 void add_subgraphs(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<SubGraph>>> subgraphs) { 4286 fbb_.AddOffset(Model::VT_SUBGRAPHS, subgraphs); 4287 } 4288 void add_description(flatbuffers::Offset<flatbuffers::String> description) { 4289 fbb_.AddOffset(Model::VT_DESCRIPTION, description); 4290 } 4291 void add_buffers(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<Buffer>>> buffers) { 4292 fbb_.AddOffset(Model::VT_BUFFERS, buffers); 4293 } 4294 explicit ModelBuilder(flatbuffers::FlatBufferBuilder &_fbb) 4295 : fbb_(_fbb) { 4296 start_ = fbb_.StartTable(); 4297 } 4298 ModelBuilder &operator=(const ModelBuilder &); 4299 flatbuffers::Offset<Model> Finish() { 4300 const auto end = fbb_.EndTable(start_); 4301 auto o = flatbuffers::Offset<Model>(end); 4302 return o; 4303 } 4304 }; 4305 4306 inline flatbuffers::Offset<Model> CreateModel( 4307 flatbuffers::FlatBufferBuilder &_fbb, 4308 uint32_t version = 0, 4309 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<OperatorCode>>> operator_codes = 0, 4310 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<SubGraph>>> subgraphs = 0, 4311 flatbuffers::Offset<flatbuffers::String> description = 0, 4312 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<Buffer>>> buffers = 0) { 4313 ModelBuilder builder_(_fbb); 4314 builder_.add_buffers(buffers); 4315 builder_.add_description(description); 4316 builder_.add_subgraphs(subgraphs); 4317 builder_.add_operator_codes(operator_codes); 4318 builder_.add_version(version); 4319 return builder_.Finish(); 4320 } 4321 4322 inline flatbuffers::Offset<Model> CreateModelDirect( 4323 flatbuffers::FlatBufferBuilder &_fbb, 4324 uint32_t version = 0, 4325 const std::vector<flatbuffers::Offset<OperatorCode>> *operator_codes = nullptr, 4326 const std::vector<flatbuffers::Offset<SubGraph>> *subgraphs = nullptr, 4327 const char *description = nullptr, 4328 const std::vector<flatbuffers::Offset<Buffer>> *buffers = nullptr) { 4329 return tflite::CreateModel( 4330 _fbb, 4331 version, 4332 operator_codes ? _fbb.CreateVector<flatbuffers::Offset<OperatorCode>>(*operator_codes) : 0, 4333 subgraphs ? _fbb.CreateVector<flatbuffers::Offset<SubGraph>>(*subgraphs) : 0, 4334 description ? _fbb.CreateString(description) : 0, 4335 buffers ? _fbb.CreateVector<flatbuffers::Offset<Buffer>>(*buffers) : 0); 4336 } 4337 4338 flatbuffers::Offset<Model> CreateModel(flatbuffers::FlatBufferBuilder &_fbb, const ModelT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); 4339 4340 inline QuantizationParametersT *QuantizationParameters::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 4341 auto _o = new QuantizationParametersT(); 4342 UnPackTo(_o, _resolver); 4343 return _o; 4344 } 4345 4346 inline void QuantizationParameters::UnPackTo(QuantizationParametersT *_o, const flatbuffers::resolver_function_t *_resolver) const { 4347 (void)_o; 4348 (void)_resolver; 4349 { auto _e = min(); if (_e) { _o->min.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->min[_i] = _e->Get(_i); } } }; 4350 { auto _e = max(); if (_e) { _o->max.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->max[_i] = _e->Get(_i); } } }; 4351 { auto _e = scale(); if (_e) { _o->scale.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->scale[_i] = _e->Get(_i); } } }; 4352 { auto _e = zero_point(); if (_e) { _o->zero_point.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->zero_point[_i] = _e->Get(_i); } } }; 4353 } 4354 4355 inline flatbuffers::Offset<QuantizationParameters> QuantizationParameters::Pack(flatbuffers::FlatBufferBuilder &_fbb, const QuantizationParametersT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 4356 return CreateQuantizationParameters(_fbb, _o, _rehasher); 4357 } 4358 4359 inline flatbuffers::Offset<QuantizationParameters> CreateQuantizationParameters(flatbuffers::FlatBufferBuilder &_fbb, const QuantizationParametersT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 4360 (void)_rehasher; 4361 (void)_o; 4362 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const QuantizationParametersT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 4363 auto _min = _o->min.size() ? _fbb.CreateVector(_o->min) : 0; 4364 auto _max = _o->max.size() ? _fbb.CreateVector(_o->max) : 0; 4365 auto _scale = _o->scale.size() ? _fbb.CreateVector(_o->scale) : 0; 4366 auto _zero_point = _o->zero_point.size() ? _fbb.CreateVector(_o->zero_point) : 0; 4367 return tflite::CreateQuantizationParameters( 4368 _fbb, 4369 _min, 4370 _max, 4371 _scale, 4372 _zero_point); 4373 } 4374 4375 inline TensorT *Tensor::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 4376 auto _o = new TensorT(); 4377 UnPackTo(_o, _resolver); 4378 return _o; 4379 } 4380 4381 inline void Tensor::UnPackTo(TensorT *_o, const flatbuffers::resolver_function_t *_resolver) const { 4382 (void)_o; 4383 (void)_resolver; 4384 { auto _e = shape(); if (_e) { _o->shape.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->shape[_i] = _e->Get(_i); } } }; 4385 { auto _e = type(); _o->type = _e; }; 4386 { auto _e = buffer(); _o->buffer = _e; }; 4387 { auto _e = name(); if (_e) _o->name = _e->str(); }; 4388 { auto _e = quantization(); if (_e) _o->quantization = std::unique_ptr<QuantizationParametersT>(_e->UnPack(_resolver)); }; 4389 } 4390 4391 inline flatbuffers::Offset<Tensor> Tensor::Pack(flatbuffers::FlatBufferBuilder &_fbb, const TensorT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 4392 return CreateTensor(_fbb, _o, _rehasher); 4393 } 4394 4395 inline flatbuffers::Offset<Tensor> CreateTensor(flatbuffers::FlatBufferBuilder &_fbb, const TensorT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 4396 (void)_rehasher; 4397 (void)_o; 4398 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const TensorT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 4399 auto _shape = _o->shape.size() ? _fbb.CreateVector(_o->shape) : 0; 4400 auto _type = _o->type; 4401 auto _buffer = _o->buffer; 4402 auto _name = _o->name.empty() ? 0 : _fbb.CreateString(_o->name); 4403 auto _quantization = _o->quantization ? CreateQuantizationParameters(_fbb, _o->quantization.get(), _rehasher) : 0; 4404 return tflite::CreateTensor( 4405 _fbb, 4406 _shape, 4407 _type, 4408 _buffer, 4409 _name, 4410 _quantization); 4411 } 4412 4413 inline Conv2DOptionsT *Conv2DOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 4414 auto _o = new Conv2DOptionsT(); 4415 UnPackTo(_o, _resolver); 4416 return _o; 4417 } 4418 4419 inline void Conv2DOptions::UnPackTo(Conv2DOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const { 4420 (void)_o; 4421 (void)_resolver; 4422 { auto _e = padding(); _o->padding = _e; }; 4423 { auto _e = stride_w(); _o->stride_w = _e; }; 4424 { auto _e = stride_h(); _o->stride_h = _e; }; 4425 { auto _e = fused_activation_function(); _o->fused_activation_function = _e; }; 4426 } 4427 4428 inline flatbuffers::Offset<Conv2DOptions> Conv2DOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const Conv2DOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 4429 return CreateConv2DOptions(_fbb, _o, _rehasher); 4430 } 4431 4432 inline flatbuffers::Offset<Conv2DOptions> CreateConv2DOptions(flatbuffers::FlatBufferBuilder &_fbb, const Conv2DOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 4433 (void)_rehasher; 4434 (void)_o; 4435 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const Conv2DOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 4436 auto _padding = _o->padding; 4437 auto _stride_w = _o->stride_w; 4438 auto _stride_h = _o->stride_h; 4439 auto _fused_activation_function = _o->fused_activation_function; 4440 return tflite::CreateConv2DOptions( 4441 _fbb, 4442 _padding, 4443 _stride_w, 4444 _stride_h, 4445 _fused_activation_function); 4446 } 4447 4448 inline Pool2DOptionsT *Pool2DOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 4449 auto _o = new Pool2DOptionsT(); 4450 UnPackTo(_o, _resolver); 4451 return _o; 4452 } 4453 4454 inline void Pool2DOptions::UnPackTo(Pool2DOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const { 4455 (void)_o; 4456 (void)_resolver; 4457 { auto _e = padding(); _o->padding = _e; }; 4458 { auto _e = stride_w(); _o->stride_w = _e; }; 4459 { auto _e = stride_h(); _o->stride_h = _e; }; 4460 { auto _e = filter_width(); _o->filter_width = _e; }; 4461 { auto _e = filter_height(); _o->filter_height = _e; }; 4462 { auto _e = fused_activation_function(); _o->fused_activation_function = _e; }; 4463 } 4464 4465 inline flatbuffers::Offset<Pool2DOptions> Pool2DOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const Pool2DOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 4466 return CreatePool2DOptions(_fbb, _o, _rehasher); 4467 } 4468 4469 inline flatbuffers::Offset<Pool2DOptions> CreatePool2DOptions(flatbuffers::FlatBufferBuilder &_fbb, const Pool2DOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 4470 (void)_rehasher; 4471 (void)_o; 4472 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const Pool2DOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 4473 auto _padding = _o->padding; 4474 auto _stride_w = _o->stride_w; 4475 auto _stride_h = _o->stride_h; 4476 auto _filter_width = _o->filter_width; 4477 auto _filter_height = _o->filter_height; 4478 auto _fused_activation_function = _o->fused_activation_function; 4479 return tflite::CreatePool2DOptions( 4480 _fbb, 4481 _padding, 4482 _stride_w, 4483 _stride_h, 4484 _filter_width, 4485 _filter_height, 4486 _fused_activation_function); 4487 } 4488 4489 inline DepthwiseConv2DOptionsT *DepthwiseConv2DOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 4490 auto _o = new DepthwiseConv2DOptionsT(); 4491 UnPackTo(_o, _resolver); 4492 return _o; 4493 } 4494 4495 inline void DepthwiseConv2DOptions::UnPackTo(DepthwiseConv2DOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const { 4496 (void)_o; 4497 (void)_resolver; 4498 { auto _e = padding(); _o->padding = _e; }; 4499 { auto _e = stride_w(); _o->stride_w = _e; }; 4500 { auto _e = stride_h(); _o->stride_h = _e; }; 4501 { auto _e = depth_multiplier(); _o->depth_multiplier = _e; }; 4502 { auto _e = fused_activation_function(); _o->fused_activation_function = _e; }; 4503 } 4504 4505 inline flatbuffers::Offset<DepthwiseConv2DOptions> DepthwiseConv2DOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const DepthwiseConv2DOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 4506 return CreateDepthwiseConv2DOptions(_fbb, _o, _rehasher); 4507 } 4508 4509 inline flatbuffers::Offset<DepthwiseConv2DOptions> CreateDepthwiseConv2DOptions(flatbuffers::FlatBufferBuilder &_fbb, const DepthwiseConv2DOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 4510 (void)_rehasher; 4511 (void)_o; 4512 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const DepthwiseConv2DOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 4513 auto _padding = _o->padding; 4514 auto _stride_w = _o->stride_w; 4515 auto _stride_h = _o->stride_h; 4516 auto _depth_multiplier = _o->depth_multiplier; 4517 auto _fused_activation_function = _o->fused_activation_function; 4518 return tflite::CreateDepthwiseConv2DOptions( 4519 _fbb, 4520 _padding, 4521 _stride_w, 4522 _stride_h, 4523 _depth_multiplier, 4524 _fused_activation_function); 4525 } 4526 4527 inline ConcatEmbeddingsOptionsT *ConcatEmbeddingsOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 4528 auto _o = new ConcatEmbeddingsOptionsT(); 4529 UnPackTo(_o, _resolver); 4530 return _o; 4531 } 4532 4533 inline void ConcatEmbeddingsOptions::UnPackTo(ConcatEmbeddingsOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const { 4534 (void)_o; 4535 (void)_resolver; 4536 { auto _e = num_channels(); _o->num_channels = _e; }; 4537 { auto _e = num_columns_per_channel(); if (_e) { _o->num_columns_per_channel.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->num_columns_per_channel[_i] = _e->Get(_i); } } }; 4538 { auto _e = embedding_dim_per_channel(); if (_e) { _o->embedding_dim_per_channel.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->embedding_dim_per_channel[_i] = _e->Get(_i); } } }; 4539 } 4540 4541 inline flatbuffers::Offset<ConcatEmbeddingsOptions> ConcatEmbeddingsOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const ConcatEmbeddingsOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 4542 return CreateConcatEmbeddingsOptions(_fbb, _o, _rehasher); 4543 } 4544 4545 inline flatbuffers::Offset<ConcatEmbeddingsOptions> CreateConcatEmbeddingsOptions(flatbuffers::FlatBufferBuilder &_fbb, const ConcatEmbeddingsOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 4546 (void)_rehasher; 4547 (void)_o; 4548 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const ConcatEmbeddingsOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 4549 auto _num_channels = _o->num_channels; 4550 auto _num_columns_per_channel = _o->num_columns_per_channel.size() ? _fbb.CreateVector(_o->num_columns_per_channel) : 0; 4551 auto _embedding_dim_per_channel = _o->embedding_dim_per_channel.size() ? _fbb.CreateVector(_o->embedding_dim_per_channel) : 0; 4552 return tflite::CreateConcatEmbeddingsOptions( 4553 _fbb, 4554 _num_channels, 4555 _num_columns_per_channel, 4556 _embedding_dim_per_channel); 4557 } 4558 4559 inline LSHProjectionOptionsT *LSHProjectionOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 4560 auto _o = new LSHProjectionOptionsT(); 4561 UnPackTo(_o, _resolver); 4562 return _o; 4563 } 4564 4565 inline void LSHProjectionOptions::UnPackTo(LSHProjectionOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const { 4566 (void)_o; 4567 (void)_resolver; 4568 { auto _e = type(); _o->type = _e; }; 4569 } 4570 4571 inline flatbuffers::Offset<LSHProjectionOptions> LSHProjectionOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const LSHProjectionOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 4572 return CreateLSHProjectionOptions(_fbb, _o, _rehasher); 4573 } 4574 4575 inline flatbuffers::Offset<LSHProjectionOptions> CreateLSHProjectionOptions(flatbuffers::FlatBufferBuilder &_fbb, const LSHProjectionOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 4576 (void)_rehasher; 4577 (void)_o; 4578 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const LSHProjectionOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 4579 auto _type = _o->type; 4580 return tflite::CreateLSHProjectionOptions( 4581 _fbb, 4582 _type); 4583 } 4584 4585 inline SVDFOptionsT *SVDFOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 4586 auto _o = new SVDFOptionsT(); 4587 UnPackTo(_o, _resolver); 4588 return _o; 4589 } 4590 4591 inline void SVDFOptions::UnPackTo(SVDFOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const { 4592 (void)_o; 4593 (void)_resolver; 4594 { auto _e = rank(); _o->rank = _e; }; 4595 { auto _e = fused_activation_function(); _o->fused_activation_function = _e; }; 4596 } 4597 4598 inline flatbuffers::Offset<SVDFOptions> SVDFOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const SVDFOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 4599 return CreateSVDFOptions(_fbb, _o, _rehasher); 4600 } 4601 4602 inline flatbuffers::Offset<SVDFOptions> CreateSVDFOptions(flatbuffers::FlatBufferBuilder &_fbb, const SVDFOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 4603 (void)_rehasher; 4604 (void)_o; 4605 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const SVDFOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 4606 auto _rank = _o->rank; 4607 auto _fused_activation_function = _o->fused_activation_function; 4608 return tflite::CreateSVDFOptions( 4609 _fbb, 4610 _rank, 4611 _fused_activation_function); 4612 } 4613 4614 inline RNNOptionsT *RNNOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 4615 auto _o = new RNNOptionsT(); 4616 UnPackTo(_o, _resolver); 4617 return _o; 4618 } 4619 4620 inline void RNNOptions::UnPackTo(RNNOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const { 4621 (void)_o; 4622 (void)_resolver; 4623 { auto _e = fused_activation_function(); _o->fused_activation_function = _e; }; 4624 } 4625 4626 inline flatbuffers::Offset<RNNOptions> RNNOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const RNNOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 4627 return CreateRNNOptions(_fbb, _o, _rehasher); 4628 } 4629 4630 inline flatbuffers::Offset<RNNOptions> CreateRNNOptions(flatbuffers::FlatBufferBuilder &_fbb, const RNNOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 4631 (void)_rehasher; 4632 (void)_o; 4633 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const RNNOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 4634 auto _fused_activation_function = _o->fused_activation_function; 4635 return tflite::CreateRNNOptions( 4636 _fbb, 4637 _fused_activation_function); 4638 } 4639 4640 inline SequenceRNNOptionsT *SequenceRNNOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 4641 auto _o = new SequenceRNNOptionsT(); 4642 UnPackTo(_o, _resolver); 4643 return _o; 4644 } 4645 4646 inline void SequenceRNNOptions::UnPackTo(SequenceRNNOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const { 4647 (void)_o; 4648 (void)_resolver; 4649 { auto _e = time_major(); _o->time_major = _e; }; 4650 { auto _e = fused_activation_function(); _o->fused_activation_function = _e; }; 4651 } 4652 4653 inline flatbuffers::Offset<SequenceRNNOptions> SequenceRNNOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const SequenceRNNOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 4654 return CreateSequenceRNNOptions(_fbb, _o, _rehasher); 4655 } 4656 4657 inline flatbuffers::Offset<SequenceRNNOptions> CreateSequenceRNNOptions(flatbuffers::FlatBufferBuilder &_fbb, const SequenceRNNOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 4658 (void)_rehasher; 4659 (void)_o; 4660 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const SequenceRNNOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 4661 auto _time_major = _o->time_major; 4662 auto _fused_activation_function = _o->fused_activation_function; 4663 return tflite::CreateSequenceRNNOptions( 4664 _fbb, 4665 _time_major, 4666 _fused_activation_function); 4667 } 4668 4669 inline BidirectionalSequenceRNNOptionsT *BidirectionalSequenceRNNOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 4670 auto _o = new BidirectionalSequenceRNNOptionsT(); 4671 UnPackTo(_o, _resolver); 4672 return _o; 4673 } 4674 4675 inline void BidirectionalSequenceRNNOptions::UnPackTo(BidirectionalSequenceRNNOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const { 4676 (void)_o; 4677 (void)_resolver; 4678 { auto _e = time_major(); _o->time_major = _e; }; 4679 { auto _e = fused_activation_function(); _o->fused_activation_function = _e; }; 4680 } 4681 4682 inline flatbuffers::Offset<BidirectionalSequenceRNNOptions> BidirectionalSequenceRNNOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const BidirectionalSequenceRNNOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 4683 return CreateBidirectionalSequenceRNNOptions(_fbb, _o, _rehasher); 4684 } 4685 4686 inline flatbuffers::Offset<BidirectionalSequenceRNNOptions> CreateBidirectionalSequenceRNNOptions(flatbuffers::FlatBufferBuilder &_fbb, const BidirectionalSequenceRNNOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 4687 (void)_rehasher; 4688 (void)_o; 4689 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const BidirectionalSequenceRNNOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 4690 auto _time_major = _o->time_major; 4691 auto _fused_activation_function = _o->fused_activation_function; 4692 return tflite::CreateBidirectionalSequenceRNNOptions( 4693 _fbb, 4694 _time_major, 4695 _fused_activation_function); 4696 } 4697 4698 inline FullyConnectedOptionsT *FullyConnectedOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 4699 auto _o = new FullyConnectedOptionsT(); 4700 UnPackTo(_o, _resolver); 4701 return _o; 4702 } 4703 4704 inline void FullyConnectedOptions::UnPackTo(FullyConnectedOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const { 4705 (void)_o; 4706 (void)_resolver; 4707 { auto _e = fused_activation_function(); _o->fused_activation_function = _e; }; 4708 } 4709 4710 inline flatbuffers::Offset<FullyConnectedOptions> FullyConnectedOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const FullyConnectedOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 4711 return CreateFullyConnectedOptions(_fbb, _o, _rehasher); 4712 } 4713 4714 inline flatbuffers::Offset<FullyConnectedOptions> CreateFullyConnectedOptions(flatbuffers::FlatBufferBuilder &_fbb, const FullyConnectedOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 4715 (void)_rehasher; 4716 (void)_o; 4717 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const FullyConnectedOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 4718 auto _fused_activation_function = _o->fused_activation_function; 4719 return tflite::CreateFullyConnectedOptions( 4720 _fbb, 4721 _fused_activation_function); 4722 } 4723 4724 inline SoftmaxOptionsT *SoftmaxOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 4725 auto _o = new SoftmaxOptionsT(); 4726 UnPackTo(_o, _resolver); 4727 return _o; 4728 } 4729 4730 inline void SoftmaxOptions::UnPackTo(SoftmaxOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const { 4731 (void)_o; 4732 (void)_resolver; 4733 { auto _e = beta(); _o->beta = _e; }; 4734 } 4735 4736 inline flatbuffers::Offset<SoftmaxOptions> SoftmaxOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const SoftmaxOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 4737 return CreateSoftmaxOptions(_fbb, _o, _rehasher); 4738 } 4739 4740 inline flatbuffers::Offset<SoftmaxOptions> CreateSoftmaxOptions(flatbuffers::FlatBufferBuilder &_fbb, const SoftmaxOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 4741 (void)_rehasher; 4742 (void)_o; 4743 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const SoftmaxOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 4744 auto _beta = _o->beta; 4745 return tflite::CreateSoftmaxOptions( 4746 _fbb, 4747 _beta); 4748 } 4749 4750 inline ConcatenationOptionsT *ConcatenationOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 4751 auto _o = new ConcatenationOptionsT(); 4752 UnPackTo(_o, _resolver); 4753 return _o; 4754 } 4755 4756 inline void ConcatenationOptions::UnPackTo(ConcatenationOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const { 4757 (void)_o; 4758 (void)_resolver; 4759 { auto _e = axis(); _o->axis = _e; }; 4760 { auto _e = fused_activation_function(); _o->fused_activation_function = _e; }; 4761 } 4762 4763 inline flatbuffers::Offset<ConcatenationOptions> ConcatenationOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const ConcatenationOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 4764 return CreateConcatenationOptions(_fbb, _o, _rehasher); 4765 } 4766 4767 inline flatbuffers::Offset<ConcatenationOptions> CreateConcatenationOptions(flatbuffers::FlatBufferBuilder &_fbb, const ConcatenationOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 4768 (void)_rehasher; 4769 (void)_o; 4770 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const ConcatenationOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 4771 auto _axis = _o->axis; 4772 auto _fused_activation_function = _o->fused_activation_function; 4773 return tflite::CreateConcatenationOptions( 4774 _fbb, 4775 _axis, 4776 _fused_activation_function); 4777 } 4778 4779 inline AddOptionsT *AddOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 4780 auto _o = new AddOptionsT(); 4781 UnPackTo(_o, _resolver); 4782 return _o; 4783 } 4784 4785 inline void AddOptions::UnPackTo(AddOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const { 4786 (void)_o; 4787 (void)_resolver; 4788 { auto _e = fused_activation_function(); _o->fused_activation_function = _e; }; 4789 } 4790 4791 inline flatbuffers::Offset<AddOptions> AddOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const AddOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 4792 return CreateAddOptions(_fbb, _o, _rehasher); 4793 } 4794 4795 inline flatbuffers::Offset<AddOptions> CreateAddOptions(flatbuffers::FlatBufferBuilder &_fbb, const AddOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 4796 (void)_rehasher; 4797 (void)_o; 4798 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const AddOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 4799 auto _fused_activation_function = _o->fused_activation_function; 4800 return tflite::CreateAddOptions( 4801 _fbb, 4802 _fused_activation_function); 4803 } 4804 4805 inline MulOptionsT *MulOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 4806 auto _o = new MulOptionsT(); 4807 UnPackTo(_o, _resolver); 4808 return _o; 4809 } 4810 4811 inline void MulOptions::UnPackTo(MulOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const { 4812 (void)_o; 4813 (void)_resolver; 4814 { auto _e = fused_activation_function(); _o->fused_activation_function = _e; }; 4815 } 4816 4817 inline flatbuffers::Offset<MulOptions> MulOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const MulOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 4818 return CreateMulOptions(_fbb, _o, _rehasher); 4819 } 4820 4821 inline flatbuffers::Offset<MulOptions> CreateMulOptions(flatbuffers::FlatBufferBuilder &_fbb, const MulOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 4822 (void)_rehasher; 4823 (void)_o; 4824 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const MulOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 4825 auto _fused_activation_function = _o->fused_activation_function; 4826 return tflite::CreateMulOptions( 4827 _fbb, 4828 _fused_activation_function); 4829 } 4830 4831 inline L2NormOptionsT *L2NormOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 4832 auto _o = new L2NormOptionsT(); 4833 UnPackTo(_o, _resolver); 4834 return _o; 4835 } 4836 4837 inline void L2NormOptions::UnPackTo(L2NormOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const { 4838 (void)_o; 4839 (void)_resolver; 4840 { auto _e = fused_activation_function(); _o->fused_activation_function = _e; }; 4841 } 4842 4843 inline flatbuffers::Offset<L2NormOptions> L2NormOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const L2NormOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 4844 return CreateL2NormOptions(_fbb, _o, _rehasher); 4845 } 4846 4847 inline flatbuffers::Offset<L2NormOptions> CreateL2NormOptions(flatbuffers::FlatBufferBuilder &_fbb, const L2NormOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 4848 (void)_rehasher; 4849 (void)_o; 4850 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const L2NormOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 4851 auto _fused_activation_function = _o->fused_activation_function; 4852 return tflite::CreateL2NormOptions( 4853 _fbb, 4854 _fused_activation_function); 4855 } 4856 4857 inline LocalResponseNormalizationOptionsT *LocalResponseNormalizationOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 4858 auto _o = new LocalResponseNormalizationOptionsT(); 4859 UnPackTo(_o, _resolver); 4860 return _o; 4861 } 4862 4863 inline void LocalResponseNormalizationOptions::UnPackTo(LocalResponseNormalizationOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const { 4864 (void)_o; 4865 (void)_resolver; 4866 { auto _e = radius(); _o->radius = _e; }; 4867 { auto _e = bias(); _o->bias = _e; }; 4868 { auto _e = alpha(); _o->alpha = _e; }; 4869 { auto _e = beta(); _o->beta = _e; }; 4870 } 4871 4872 inline flatbuffers::Offset<LocalResponseNormalizationOptions> LocalResponseNormalizationOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const LocalResponseNormalizationOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 4873 return CreateLocalResponseNormalizationOptions(_fbb, _o, _rehasher); 4874 } 4875 4876 inline flatbuffers::Offset<LocalResponseNormalizationOptions> CreateLocalResponseNormalizationOptions(flatbuffers::FlatBufferBuilder &_fbb, const LocalResponseNormalizationOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 4877 (void)_rehasher; 4878 (void)_o; 4879 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const LocalResponseNormalizationOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 4880 auto _radius = _o->radius; 4881 auto _bias = _o->bias; 4882 auto _alpha = _o->alpha; 4883 auto _beta = _o->beta; 4884 return tflite::CreateLocalResponseNormalizationOptions( 4885 _fbb, 4886 _radius, 4887 _bias, 4888 _alpha, 4889 _beta); 4890 } 4891 4892 inline LSTMOptionsT *LSTMOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 4893 auto _o = new LSTMOptionsT(); 4894 UnPackTo(_o, _resolver); 4895 return _o; 4896 } 4897 4898 inline void LSTMOptions::UnPackTo(LSTMOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const { 4899 (void)_o; 4900 (void)_resolver; 4901 { auto _e = fused_activation_function(); _o->fused_activation_function = _e; }; 4902 { auto _e = cell_clip(); _o->cell_clip = _e; }; 4903 { auto _e = proj_clip(); _o->proj_clip = _e; }; 4904 } 4905 4906 inline flatbuffers::Offset<LSTMOptions> LSTMOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const LSTMOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 4907 return CreateLSTMOptions(_fbb, _o, _rehasher); 4908 } 4909 4910 inline flatbuffers::Offset<LSTMOptions> CreateLSTMOptions(flatbuffers::FlatBufferBuilder &_fbb, const LSTMOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 4911 (void)_rehasher; 4912 (void)_o; 4913 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const LSTMOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 4914 auto _fused_activation_function = _o->fused_activation_function; 4915 auto _cell_clip = _o->cell_clip; 4916 auto _proj_clip = _o->proj_clip; 4917 return tflite::CreateLSTMOptions( 4918 _fbb, 4919 _fused_activation_function, 4920 _cell_clip, 4921 _proj_clip); 4922 } 4923 4924 inline ResizeBilinearOptionsT *ResizeBilinearOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 4925 auto _o = new ResizeBilinearOptionsT(); 4926 UnPackTo(_o, _resolver); 4927 return _o; 4928 } 4929 4930 inline void ResizeBilinearOptions::UnPackTo(ResizeBilinearOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const { 4931 (void)_o; 4932 (void)_resolver; 4933 { auto _e = align_corners(); _o->align_corners = _e; }; 4934 } 4935 4936 inline flatbuffers::Offset<ResizeBilinearOptions> ResizeBilinearOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const ResizeBilinearOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 4937 return CreateResizeBilinearOptions(_fbb, _o, _rehasher); 4938 } 4939 4940 inline flatbuffers::Offset<ResizeBilinearOptions> CreateResizeBilinearOptions(flatbuffers::FlatBufferBuilder &_fbb, const ResizeBilinearOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 4941 (void)_rehasher; 4942 (void)_o; 4943 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const ResizeBilinearOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 4944 auto _align_corners = _o->align_corners; 4945 return tflite::CreateResizeBilinearOptions( 4946 _fbb, 4947 _align_corners); 4948 } 4949 4950 inline CallOptionsT *CallOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 4951 auto _o = new CallOptionsT(); 4952 UnPackTo(_o, _resolver); 4953 return _o; 4954 } 4955 4956 inline void CallOptions::UnPackTo(CallOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const { 4957 (void)_o; 4958 (void)_resolver; 4959 { auto _e = subgraph(); _o->subgraph = _e; }; 4960 } 4961 4962 inline flatbuffers::Offset<CallOptions> CallOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const CallOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 4963 return CreateCallOptions(_fbb, _o, _rehasher); 4964 } 4965 4966 inline flatbuffers::Offset<CallOptions> CreateCallOptions(flatbuffers::FlatBufferBuilder &_fbb, const CallOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 4967 (void)_rehasher; 4968 (void)_o; 4969 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const CallOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 4970 auto _subgraph = _o->subgraph; 4971 return tflite::CreateCallOptions( 4972 _fbb, 4973 _subgraph); 4974 } 4975 4976 inline PadOptionsT *PadOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 4977 auto _o = new PadOptionsT(); 4978 UnPackTo(_o, _resolver); 4979 return _o; 4980 } 4981 4982 inline void PadOptions::UnPackTo(PadOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const { 4983 (void)_o; 4984 (void)_resolver; 4985 } 4986 4987 inline flatbuffers::Offset<PadOptions> PadOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const PadOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 4988 return CreatePadOptions(_fbb, _o, _rehasher); 4989 } 4990 4991 inline flatbuffers::Offset<PadOptions> CreatePadOptions(flatbuffers::FlatBufferBuilder &_fbb, const PadOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 4992 (void)_rehasher; 4993 (void)_o; 4994 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const PadOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 4995 return tflite::CreatePadOptions( 4996 _fbb); 4997 } 4998 4999 inline ReshapeOptionsT *ReshapeOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 5000 auto _o = new ReshapeOptionsT(); 5001 UnPackTo(_o, _resolver); 5002 return _o; 5003 } 5004 5005 inline void ReshapeOptions::UnPackTo(ReshapeOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const { 5006 (void)_o; 5007 (void)_resolver; 5008 { auto _e = new_shape(); if (_e) { _o->new_shape.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->new_shape[_i] = _e->Get(_i); } } }; 5009 } 5010 5011 inline flatbuffers::Offset<ReshapeOptions> ReshapeOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const ReshapeOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 5012 return CreateReshapeOptions(_fbb, _o, _rehasher); 5013 } 5014 5015 inline flatbuffers::Offset<ReshapeOptions> CreateReshapeOptions(flatbuffers::FlatBufferBuilder &_fbb, const ReshapeOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 5016 (void)_rehasher; 5017 (void)_o; 5018 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const ReshapeOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 5019 auto _new_shape = _o->new_shape.size() ? _fbb.CreateVector(_o->new_shape) : 0; 5020 return tflite::CreateReshapeOptions( 5021 _fbb, 5022 _new_shape); 5023 } 5024 5025 inline SpaceToBatchNDOptionsT *SpaceToBatchNDOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 5026 auto _o = new SpaceToBatchNDOptionsT(); 5027 UnPackTo(_o, _resolver); 5028 return _o; 5029 } 5030 5031 inline void SpaceToBatchNDOptions::UnPackTo(SpaceToBatchNDOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const { 5032 (void)_o; 5033 (void)_resolver; 5034 } 5035 5036 inline flatbuffers::Offset<SpaceToBatchNDOptions> SpaceToBatchNDOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const SpaceToBatchNDOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 5037 return CreateSpaceToBatchNDOptions(_fbb, _o, _rehasher); 5038 } 5039 5040 inline flatbuffers::Offset<SpaceToBatchNDOptions> CreateSpaceToBatchNDOptions(flatbuffers::FlatBufferBuilder &_fbb, const SpaceToBatchNDOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 5041 (void)_rehasher; 5042 (void)_o; 5043 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const SpaceToBatchNDOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 5044 return tflite::CreateSpaceToBatchNDOptions( 5045 _fbb); 5046 } 5047 5048 inline BatchToSpaceNDOptionsT *BatchToSpaceNDOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 5049 auto _o = new BatchToSpaceNDOptionsT(); 5050 UnPackTo(_o, _resolver); 5051 return _o; 5052 } 5053 5054 inline void BatchToSpaceNDOptions::UnPackTo(BatchToSpaceNDOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const { 5055 (void)_o; 5056 (void)_resolver; 5057 } 5058 5059 inline flatbuffers::Offset<BatchToSpaceNDOptions> BatchToSpaceNDOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const BatchToSpaceNDOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 5060 return CreateBatchToSpaceNDOptions(_fbb, _o, _rehasher); 5061 } 5062 5063 inline flatbuffers::Offset<BatchToSpaceNDOptions> CreateBatchToSpaceNDOptions(flatbuffers::FlatBufferBuilder &_fbb, const BatchToSpaceNDOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 5064 (void)_rehasher; 5065 (void)_o; 5066 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const BatchToSpaceNDOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 5067 return tflite::CreateBatchToSpaceNDOptions( 5068 _fbb); 5069 } 5070 5071 inline SkipGramOptionsT *SkipGramOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 5072 auto _o = new SkipGramOptionsT(); 5073 UnPackTo(_o, _resolver); 5074 return _o; 5075 } 5076 5077 inline void SkipGramOptions::UnPackTo(SkipGramOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const { 5078 (void)_o; 5079 (void)_resolver; 5080 { auto _e = ngram_size(); _o->ngram_size = _e; }; 5081 { auto _e = max_skip_size(); _o->max_skip_size = _e; }; 5082 { auto _e = include_all_ngrams(); _o->include_all_ngrams = _e; }; 5083 } 5084 5085 inline flatbuffers::Offset<SkipGramOptions> SkipGramOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const SkipGramOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 5086 return CreateSkipGramOptions(_fbb, _o, _rehasher); 5087 } 5088 5089 inline flatbuffers::Offset<SkipGramOptions> CreateSkipGramOptions(flatbuffers::FlatBufferBuilder &_fbb, const SkipGramOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 5090 (void)_rehasher; 5091 (void)_o; 5092 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const SkipGramOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 5093 auto _ngram_size = _o->ngram_size; 5094 auto _max_skip_size = _o->max_skip_size; 5095 auto _include_all_ngrams = _o->include_all_ngrams; 5096 return tflite::CreateSkipGramOptions( 5097 _fbb, 5098 _ngram_size, 5099 _max_skip_size, 5100 _include_all_ngrams); 5101 } 5102 5103 inline SpaceToDepthOptionsT *SpaceToDepthOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 5104 auto _o = new SpaceToDepthOptionsT(); 5105 UnPackTo(_o, _resolver); 5106 return _o; 5107 } 5108 5109 inline void SpaceToDepthOptions::UnPackTo(SpaceToDepthOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const { 5110 (void)_o; 5111 (void)_resolver; 5112 { auto _e = block_size(); _o->block_size = _e; }; 5113 } 5114 5115 inline flatbuffers::Offset<SpaceToDepthOptions> SpaceToDepthOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const SpaceToDepthOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 5116 return CreateSpaceToDepthOptions(_fbb, _o, _rehasher); 5117 } 5118 5119 inline flatbuffers::Offset<SpaceToDepthOptions> CreateSpaceToDepthOptions(flatbuffers::FlatBufferBuilder &_fbb, const SpaceToDepthOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 5120 (void)_rehasher; 5121 (void)_o; 5122 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const SpaceToDepthOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 5123 auto _block_size = _o->block_size; 5124 return tflite::CreateSpaceToDepthOptions( 5125 _fbb, 5126 _block_size); 5127 } 5128 5129 inline SubOptionsT *SubOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 5130 auto _o = new SubOptionsT(); 5131 UnPackTo(_o, _resolver); 5132 return _o; 5133 } 5134 5135 inline void SubOptions::UnPackTo(SubOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const { 5136 (void)_o; 5137 (void)_resolver; 5138 { auto _e = fused_activation_function(); _o->fused_activation_function = _e; }; 5139 } 5140 5141 inline flatbuffers::Offset<SubOptions> SubOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const SubOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 5142 return CreateSubOptions(_fbb, _o, _rehasher); 5143 } 5144 5145 inline flatbuffers::Offset<SubOptions> CreateSubOptions(flatbuffers::FlatBufferBuilder &_fbb, const SubOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 5146 (void)_rehasher; 5147 (void)_o; 5148 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const SubOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 5149 auto _fused_activation_function = _o->fused_activation_function; 5150 return tflite::CreateSubOptions( 5151 _fbb, 5152 _fused_activation_function); 5153 } 5154 5155 inline DivOptionsT *DivOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 5156 auto _o = new DivOptionsT(); 5157 UnPackTo(_o, _resolver); 5158 return _o; 5159 } 5160 5161 inline void DivOptions::UnPackTo(DivOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const { 5162 (void)_o; 5163 (void)_resolver; 5164 { auto _e = fused_activation_function(); _o->fused_activation_function = _e; }; 5165 } 5166 5167 inline flatbuffers::Offset<DivOptions> DivOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const DivOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 5168 return CreateDivOptions(_fbb, _o, _rehasher); 5169 } 5170 5171 inline flatbuffers::Offset<DivOptions> CreateDivOptions(flatbuffers::FlatBufferBuilder &_fbb, const DivOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 5172 (void)_rehasher; 5173 (void)_o; 5174 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const DivOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 5175 auto _fused_activation_function = _o->fused_activation_function; 5176 return tflite::CreateDivOptions( 5177 _fbb, 5178 _fused_activation_function); 5179 } 5180 5181 inline TopKV2OptionsT *TopKV2Options::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 5182 auto _o = new TopKV2OptionsT(); 5183 UnPackTo(_o, _resolver); 5184 return _o; 5185 } 5186 5187 inline void TopKV2Options::UnPackTo(TopKV2OptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const { 5188 (void)_o; 5189 (void)_resolver; 5190 } 5191 5192 inline flatbuffers::Offset<TopKV2Options> TopKV2Options::Pack(flatbuffers::FlatBufferBuilder &_fbb, const TopKV2OptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 5193 return CreateTopKV2Options(_fbb, _o, _rehasher); 5194 } 5195 5196 inline flatbuffers::Offset<TopKV2Options> CreateTopKV2Options(flatbuffers::FlatBufferBuilder &_fbb, const TopKV2OptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 5197 (void)_rehasher; 5198 (void)_o; 5199 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const TopKV2OptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 5200 return tflite::CreateTopKV2Options( 5201 _fbb); 5202 } 5203 5204 inline EmbeddingLookupSparseOptionsT *EmbeddingLookupSparseOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 5205 auto _o = new EmbeddingLookupSparseOptionsT(); 5206 UnPackTo(_o, _resolver); 5207 return _o; 5208 } 5209 5210 inline void EmbeddingLookupSparseOptions::UnPackTo(EmbeddingLookupSparseOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const { 5211 (void)_o; 5212 (void)_resolver; 5213 { auto _e = combiner(); _o->combiner = _e; }; 5214 } 5215 5216 inline flatbuffers::Offset<EmbeddingLookupSparseOptions> EmbeddingLookupSparseOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const EmbeddingLookupSparseOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 5217 return CreateEmbeddingLookupSparseOptions(_fbb, _o, _rehasher); 5218 } 5219 5220 inline flatbuffers::Offset<EmbeddingLookupSparseOptions> CreateEmbeddingLookupSparseOptions(flatbuffers::FlatBufferBuilder &_fbb, const EmbeddingLookupSparseOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 5221 (void)_rehasher; 5222 (void)_o; 5223 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const EmbeddingLookupSparseOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 5224 auto _combiner = _o->combiner; 5225 return tflite::CreateEmbeddingLookupSparseOptions( 5226 _fbb, 5227 _combiner); 5228 } 5229 5230 inline GatherOptionsT *GatherOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 5231 auto _o = new GatherOptionsT(); 5232 UnPackTo(_o, _resolver); 5233 return _o; 5234 } 5235 5236 inline void GatherOptions::UnPackTo(GatherOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const { 5237 (void)_o; 5238 (void)_resolver; 5239 { auto _e = axis(); _o->axis = _e; }; 5240 } 5241 5242 inline flatbuffers::Offset<GatherOptions> GatherOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const GatherOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 5243 return CreateGatherOptions(_fbb, _o, _rehasher); 5244 } 5245 5246 inline flatbuffers::Offset<GatherOptions> CreateGatherOptions(flatbuffers::FlatBufferBuilder &_fbb, const GatherOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 5247 (void)_rehasher; 5248 (void)_o; 5249 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const GatherOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 5250 auto _axis = _o->axis; 5251 return tflite::CreateGatherOptions( 5252 _fbb, 5253 _axis); 5254 } 5255 5256 inline TransposeOptionsT *TransposeOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 5257 auto _o = new TransposeOptionsT(); 5258 UnPackTo(_o, _resolver); 5259 return _o; 5260 } 5261 5262 inline void TransposeOptions::UnPackTo(TransposeOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const { 5263 (void)_o; 5264 (void)_resolver; 5265 } 5266 5267 inline flatbuffers::Offset<TransposeOptions> TransposeOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const TransposeOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 5268 return CreateTransposeOptions(_fbb, _o, _rehasher); 5269 } 5270 5271 inline flatbuffers::Offset<TransposeOptions> CreateTransposeOptions(flatbuffers::FlatBufferBuilder &_fbb, const TransposeOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 5272 (void)_rehasher; 5273 (void)_o; 5274 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const TransposeOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 5275 return tflite::CreateTransposeOptions( 5276 _fbb); 5277 } 5278 5279 inline ExpOptionsT *ExpOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 5280 auto _o = new ExpOptionsT(); 5281 UnPackTo(_o, _resolver); 5282 return _o; 5283 } 5284 5285 inline void ExpOptions::UnPackTo(ExpOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const { 5286 (void)_o; 5287 (void)_resolver; 5288 } 5289 5290 inline flatbuffers::Offset<ExpOptions> ExpOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const ExpOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 5291 return CreateExpOptions(_fbb, _o, _rehasher); 5292 } 5293 5294 inline flatbuffers::Offset<ExpOptions> CreateExpOptions(flatbuffers::FlatBufferBuilder &_fbb, const ExpOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 5295 (void)_rehasher; 5296 (void)_o; 5297 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const ExpOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 5298 return tflite::CreateExpOptions( 5299 _fbb); 5300 } 5301 5302 inline MeanOptionsT *MeanOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 5303 auto _o = new MeanOptionsT(); 5304 UnPackTo(_o, _resolver); 5305 return _o; 5306 } 5307 5308 inline void MeanOptions::UnPackTo(MeanOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const { 5309 (void)_o; 5310 (void)_resolver; 5311 { auto _e = keep_dims(); _o->keep_dims = _e; }; 5312 } 5313 5314 inline flatbuffers::Offset<MeanOptions> MeanOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const MeanOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 5315 return CreateMeanOptions(_fbb, _o, _rehasher); 5316 } 5317 5318 inline flatbuffers::Offset<MeanOptions> CreateMeanOptions(flatbuffers::FlatBufferBuilder &_fbb, const MeanOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 5319 (void)_rehasher; 5320 (void)_o; 5321 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const MeanOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 5322 auto _keep_dims = _o->keep_dims; 5323 return tflite::CreateMeanOptions( 5324 _fbb, 5325 _keep_dims); 5326 } 5327 5328 inline SqueezeOptionsT *SqueezeOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 5329 auto _o = new SqueezeOptionsT(); 5330 UnPackTo(_o, _resolver); 5331 return _o; 5332 } 5333 5334 inline void SqueezeOptions::UnPackTo(SqueezeOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const { 5335 (void)_o; 5336 (void)_resolver; 5337 { auto _e = squeeze_dims(); if (_e) { _o->squeeze_dims.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->squeeze_dims[_i] = _e->Get(_i); } } }; 5338 } 5339 5340 inline flatbuffers::Offset<SqueezeOptions> SqueezeOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const SqueezeOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 5341 return CreateSqueezeOptions(_fbb, _o, _rehasher); 5342 } 5343 5344 inline flatbuffers::Offset<SqueezeOptions> CreateSqueezeOptions(flatbuffers::FlatBufferBuilder &_fbb, const SqueezeOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 5345 (void)_rehasher; 5346 (void)_o; 5347 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const SqueezeOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 5348 auto _squeeze_dims = _o->squeeze_dims.size() ? _fbb.CreateVector(_o->squeeze_dims) : 0; 5349 return tflite::CreateSqueezeOptions( 5350 _fbb, 5351 _squeeze_dims); 5352 } 5353 5354 inline SplitOptionsT *SplitOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 5355 auto _o = new SplitOptionsT(); 5356 UnPackTo(_o, _resolver); 5357 return _o; 5358 } 5359 5360 inline void SplitOptions::UnPackTo(SplitOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const { 5361 (void)_o; 5362 (void)_resolver; 5363 { auto _e = num_splits(); _o->num_splits = _e; }; 5364 } 5365 5366 inline flatbuffers::Offset<SplitOptions> SplitOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const SplitOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 5367 return CreateSplitOptions(_fbb, _o, _rehasher); 5368 } 5369 5370 inline flatbuffers::Offset<SplitOptions> CreateSplitOptions(flatbuffers::FlatBufferBuilder &_fbb, const SplitOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 5371 (void)_rehasher; 5372 (void)_o; 5373 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const SplitOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 5374 auto _num_splits = _o->num_splits; 5375 return tflite::CreateSplitOptions( 5376 _fbb, 5377 _num_splits); 5378 } 5379 5380 inline StridedSliceOptionsT *StridedSliceOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 5381 auto _o = new StridedSliceOptionsT(); 5382 UnPackTo(_o, _resolver); 5383 return _o; 5384 } 5385 5386 inline void StridedSliceOptions::UnPackTo(StridedSliceOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const { 5387 (void)_o; 5388 (void)_resolver; 5389 { auto _e = begin_mask(); _o->begin_mask = _e; }; 5390 { auto _e = end_mask(); _o->end_mask = _e; }; 5391 { auto _e = ellipsis_mask(); _o->ellipsis_mask = _e; }; 5392 { auto _e = new_axis_mask(); _o->new_axis_mask = _e; }; 5393 { auto _e = shrink_axis_mask(); _o->shrink_axis_mask = _e; }; 5394 } 5395 5396 inline flatbuffers::Offset<StridedSliceOptions> StridedSliceOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const StridedSliceOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 5397 return CreateStridedSliceOptions(_fbb, _o, _rehasher); 5398 } 5399 5400 inline flatbuffers::Offset<StridedSliceOptions> CreateStridedSliceOptions(flatbuffers::FlatBufferBuilder &_fbb, const StridedSliceOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 5401 (void)_rehasher; 5402 (void)_o; 5403 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const StridedSliceOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 5404 auto _begin_mask = _o->begin_mask; 5405 auto _end_mask = _o->end_mask; 5406 auto _ellipsis_mask = _o->ellipsis_mask; 5407 auto _new_axis_mask = _o->new_axis_mask; 5408 auto _shrink_axis_mask = _o->shrink_axis_mask; 5409 return tflite::CreateStridedSliceOptions( 5410 _fbb, 5411 _begin_mask, 5412 _end_mask, 5413 _ellipsis_mask, 5414 _new_axis_mask, 5415 _shrink_axis_mask); 5416 } 5417 5418 inline OperatorCodeT *OperatorCode::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 5419 auto _o = new OperatorCodeT(); 5420 UnPackTo(_o, _resolver); 5421 return _o; 5422 } 5423 5424 inline void OperatorCode::UnPackTo(OperatorCodeT *_o, const flatbuffers::resolver_function_t *_resolver) const { 5425 (void)_o; 5426 (void)_resolver; 5427 { auto _e = builtin_code(); _o->builtin_code = _e; }; 5428 { auto _e = custom_code(); if (_e) _o->custom_code = _e->str(); }; 5429 } 5430 5431 inline flatbuffers::Offset<OperatorCode> OperatorCode::Pack(flatbuffers::FlatBufferBuilder &_fbb, const OperatorCodeT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 5432 return CreateOperatorCode(_fbb, _o, _rehasher); 5433 } 5434 5435 inline flatbuffers::Offset<OperatorCode> CreateOperatorCode(flatbuffers::FlatBufferBuilder &_fbb, const OperatorCodeT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 5436 (void)_rehasher; 5437 (void)_o; 5438 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const OperatorCodeT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 5439 auto _builtin_code = _o->builtin_code; 5440 auto _custom_code = _o->custom_code.empty() ? 0 : _fbb.CreateString(_o->custom_code); 5441 return tflite::CreateOperatorCode( 5442 _fbb, 5443 _builtin_code, 5444 _custom_code); 5445 } 5446 5447 inline OperatorT *Operator::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 5448 auto _o = new OperatorT(); 5449 UnPackTo(_o, _resolver); 5450 return _o; 5451 } 5452 5453 inline void Operator::UnPackTo(OperatorT *_o, const flatbuffers::resolver_function_t *_resolver) const { 5454 (void)_o; 5455 (void)_resolver; 5456 { auto _e = opcode_index(); _o->opcode_index = _e; }; 5457 { auto _e = inputs(); if (_e) { _o->inputs.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->inputs[_i] = _e->Get(_i); } } }; 5458 { auto _e = outputs(); if (_e) { _o->outputs.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->outputs[_i] = _e->Get(_i); } } }; 5459 { auto _e = builtin_options_type(); _o->builtin_options.type = _e; }; 5460 { auto _e = builtin_options(); if (_e) _o->builtin_options.value = BuiltinOptionsUnion::UnPack(_e, builtin_options_type(), _resolver); }; 5461 { auto _e = custom_options(); if (_e) { _o->custom_options.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->custom_options[_i] = _e->Get(_i); } } }; 5462 { auto _e = custom_options_format(); _o->custom_options_format = _e; }; 5463 } 5464 5465 inline flatbuffers::Offset<Operator> Operator::Pack(flatbuffers::FlatBufferBuilder &_fbb, const OperatorT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 5466 return CreateOperator(_fbb, _o, _rehasher); 5467 } 5468 5469 inline flatbuffers::Offset<Operator> CreateOperator(flatbuffers::FlatBufferBuilder &_fbb, const OperatorT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 5470 (void)_rehasher; 5471 (void)_o; 5472 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const OperatorT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 5473 auto _opcode_index = _o->opcode_index; 5474 auto _inputs = _o->inputs.size() ? _fbb.CreateVector(_o->inputs) : 0; 5475 auto _outputs = _o->outputs.size() ? _fbb.CreateVector(_o->outputs) : 0; 5476 auto _builtin_options_type = _o->builtin_options.type; 5477 auto _builtin_options = _o->builtin_options.Pack(_fbb); 5478 auto _custom_options = _o->custom_options.size() ? _fbb.CreateVector(_o->custom_options) : 0; 5479 auto _custom_options_format = _o->custom_options_format; 5480 return tflite::CreateOperator( 5481 _fbb, 5482 _opcode_index, 5483 _inputs, 5484 _outputs, 5485 _builtin_options_type, 5486 _builtin_options, 5487 _custom_options, 5488 _custom_options_format); 5489 } 5490 5491 inline SubGraphT *SubGraph::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 5492 auto _o = new SubGraphT(); 5493 UnPackTo(_o, _resolver); 5494 return _o; 5495 } 5496 5497 inline void SubGraph::UnPackTo(SubGraphT *_o, const flatbuffers::resolver_function_t *_resolver) const { 5498 (void)_o; 5499 (void)_resolver; 5500 { auto _e = tensors(); if (_e) { _o->tensors.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->tensors[_i] = std::unique_ptr<TensorT>(_e->Get(_i)->UnPack(_resolver)); } } }; 5501 { auto _e = inputs(); if (_e) { _o->inputs.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->inputs[_i] = _e->Get(_i); } } }; 5502 { auto _e = outputs(); if (_e) { _o->outputs.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->outputs[_i] = _e->Get(_i); } } }; 5503 { auto _e = operators(); if (_e) { _o->operators.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->operators[_i] = std::unique_ptr<OperatorT>(_e->Get(_i)->UnPack(_resolver)); } } }; 5504 { auto _e = name(); if (_e) _o->name = _e->str(); }; 5505 } 5506 5507 inline flatbuffers::Offset<SubGraph> SubGraph::Pack(flatbuffers::FlatBufferBuilder &_fbb, const SubGraphT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 5508 return CreateSubGraph(_fbb, _o, _rehasher); 5509 } 5510 5511 inline flatbuffers::Offset<SubGraph> CreateSubGraph(flatbuffers::FlatBufferBuilder &_fbb, const SubGraphT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 5512 (void)_rehasher; 5513 (void)_o; 5514 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const SubGraphT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 5515 auto _tensors = _o->tensors.size() ? _fbb.CreateVector<flatbuffers::Offset<Tensor>> (_o->tensors.size(), [](size_t i, _VectorArgs *__va) { return CreateTensor(*__va->__fbb, __va->__o->tensors[i].get(), __va->__rehasher); }, &_va ) : 0; 5516 auto _inputs = _o->inputs.size() ? _fbb.CreateVector(_o->inputs) : 0; 5517 auto _outputs = _o->outputs.size() ? _fbb.CreateVector(_o->outputs) : 0; 5518 auto _operators = _o->operators.size() ? _fbb.CreateVector<flatbuffers::Offset<Operator>> (_o->operators.size(), [](size_t i, _VectorArgs *__va) { return CreateOperator(*__va->__fbb, __va->__o->operators[i].get(), __va->__rehasher); }, &_va ) : 0; 5519 auto _name = _o->name.empty() ? 0 : _fbb.CreateString(_o->name); 5520 return tflite::CreateSubGraph( 5521 _fbb, 5522 _tensors, 5523 _inputs, 5524 _outputs, 5525 _operators, 5526 _name); 5527 } 5528 5529 inline BufferT *Buffer::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 5530 auto _o = new BufferT(); 5531 UnPackTo(_o, _resolver); 5532 return _o; 5533 } 5534 5535 inline void Buffer::UnPackTo(BufferT *_o, const flatbuffers::resolver_function_t *_resolver) const { 5536 (void)_o; 5537 (void)_resolver; 5538 { auto _e = data(); if (_e) { _o->data.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->data[_i] = _e->Get(_i); } } }; 5539 } 5540 5541 inline flatbuffers::Offset<Buffer> Buffer::Pack(flatbuffers::FlatBufferBuilder &_fbb, const BufferT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 5542 return CreateBuffer(_fbb, _o, _rehasher); 5543 } 5544 5545 inline flatbuffers::Offset<Buffer> CreateBuffer(flatbuffers::FlatBufferBuilder &_fbb, const BufferT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 5546 (void)_rehasher; 5547 (void)_o; 5548 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const BufferT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 5549 auto _data = _o->data.size() ? _fbb.CreateVector(_o->data) : 0; 5550 return tflite::CreateBuffer( 5551 _fbb, 5552 _data); 5553 } 5554 5555 inline ModelT *Model::UnPack(const flatbuffers::resolver_function_t *_resolver) const { 5556 auto _o = new ModelT(); 5557 UnPackTo(_o, _resolver); 5558 return _o; 5559 } 5560 5561 inline void Model::UnPackTo(ModelT *_o, const flatbuffers::resolver_function_t *_resolver) const { 5562 (void)_o; 5563 (void)_resolver; 5564 { auto _e = version(); _o->version = _e; }; 5565 { auto _e = operator_codes(); if (_e) { _o->operator_codes.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->operator_codes[_i] = std::unique_ptr<OperatorCodeT>(_e->Get(_i)->UnPack(_resolver)); } } }; 5566 { auto _e = subgraphs(); if (_e) { _o->subgraphs.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->subgraphs[_i] = std::unique_ptr<SubGraphT>(_e->Get(_i)->UnPack(_resolver)); } } }; 5567 { auto _e = description(); if (_e) _o->description = _e->str(); }; 5568 { auto _e = buffers(); if (_e) { _o->buffers.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->buffers[_i] = std::unique_ptr<BufferT>(_e->Get(_i)->UnPack(_resolver)); } } }; 5569 } 5570 5571 inline flatbuffers::Offset<Model> Model::Pack(flatbuffers::FlatBufferBuilder &_fbb, const ModelT* _o, const flatbuffers::rehasher_function_t *_rehasher) { 5572 return CreateModel(_fbb, _o, _rehasher); 5573 } 5574 5575 inline flatbuffers::Offset<Model> CreateModel(flatbuffers::FlatBufferBuilder &_fbb, const ModelT *_o, const flatbuffers::rehasher_function_t *_rehasher) { 5576 (void)_rehasher; 5577 (void)_o; 5578 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const ModelT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; 5579 auto _version = _o->version; 5580 auto _operator_codes = _o->operator_codes.size() ? _fbb.CreateVector<flatbuffers::Offset<OperatorCode>> (_o->operator_codes.size(), [](size_t i, _VectorArgs *__va) { return CreateOperatorCode(*__va->__fbb, __va->__o->operator_codes[i].get(), __va->__rehasher); }, &_va ) : 0; 5581 auto _subgraphs = _o->subgraphs.size() ? _fbb.CreateVector<flatbuffers::Offset<SubGraph>> (_o->subgraphs.size(), [](size_t i, _VectorArgs *__va) { return CreateSubGraph(*__va->__fbb, __va->__o->subgraphs[i].get(), __va->__rehasher); }, &_va ) : 0; 5582 auto _description = _o->description.empty() ? 0 : _fbb.CreateString(_o->description); 5583 auto _buffers = _o->buffers.size() ? _fbb.CreateVector<flatbuffers::Offset<Buffer>> (_o->buffers.size(), [](size_t i, _VectorArgs *__va) { return CreateBuffer(*__va->__fbb, __va->__o->buffers[i].get(), __va->__rehasher); }, &_va ) : 0; 5584 return tflite::CreateModel( 5585 _fbb, 5586 _version, 5587 _operator_codes, 5588 _subgraphs, 5589 _description, 5590 _buffers); 5591 } 5592 5593 inline bool VerifyBuiltinOptions(flatbuffers::Verifier &verifier, const void *obj, BuiltinOptions type) { 5594 switch (type) { 5595 case BuiltinOptions_NONE: { 5596 return true; 5597 } 5598 case BuiltinOptions_Conv2DOptions: { 5599 auto ptr = reinterpret_cast<const Conv2DOptions *>(obj); 5600 return verifier.VerifyTable(ptr); 5601 } 5602 case BuiltinOptions_DepthwiseConv2DOptions: { 5603 auto ptr = reinterpret_cast<const DepthwiseConv2DOptions *>(obj); 5604 return verifier.VerifyTable(ptr); 5605 } 5606 case BuiltinOptions_ConcatEmbeddingsOptions: { 5607 auto ptr = reinterpret_cast<const ConcatEmbeddingsOptions *>(obj); 5608 return verifier.VerifyTable(ptr); 5609 } 5610 case BuiltinOptions_LSHProjectionOptions: { 5611 auto ptr = reinterpret_cast<const LSHProjectionOptions *>(obj); 5612 return verifier.VerifyTable(ptr); 5613 } 5614 case BuiltinOptions_Pool2DOptions: { 5615 auto ptr = reinterpret_cast<const Pool2DOptions *>(obj); 5616 return verifier.VerifyTable(ptr); 5617 } 5618 case BuiltinOptions_SVDFOptions: { 5619 auto ptr = reinterpret_cast<const SVDFOptions *>(obj); 5620 return verifier.VerifyTable(ptr); 5621 } 5622 case BuiltinOptions_RNNOptions: { 5623 auto ptr = reinterpret_cast<const RNNOptions *>(obj); 5624 return verifier.VerifyTable(ptr); 5625 } 5626 case BuiltinOptions_FullyConnectedOptions: { 5627 auto ptr = reinterpret_cast<const FullyConnectedOptions *>(obj); 5628 return verifier.VerifyTable(ptr); 5629 } 5630 case BuiltinOptions_SoftmaxOptions: { 5631 auto ptr = reinterpret_cast<const SoftmaxOptions *>(obj); 5632 return verifier.VerifyTable(ptr); 5633 } 5634 case BuiltinOptions_ConcatenationOptions: { 5635 auto ptr = reinterpret_cast<const ConcatenationOptions *>(obj); 5636 return verifier.VerifyTable(ptr); 5637 } 5638 case BuiltinOptions_AddOptions: { 5639 auto ptr = reinterpret_cast<const AddOptions *>(obj); 5640 return verifier.VerifyTable(ptr); 5641 } 5642 case BuiltinOptions_L2NormOptions: { 5643 auto ptr = reinterpret_cast<const L2NormOptions *>(obj); 5644 return verifier.VerifyTable(ptr); 5645 } 5646 case BuiltinOptions_LocalResponseNormalizationOptions: { 5647 auto ptr = reinterpret_cast<const LocalResponseNormalizationOptions *>(obj); 5648 return verifier.VerifyTable(ptr); 5649 } 5650 case BuiltinOptions_LSTMOptions: { 5651 auto ptr = reinterpret_cast<const LSTMOptions *>(obj); 5652 return verifier.VerifyTable(ptr); 5653 } 5654 case BuiltinOptions_ResizeBilinearOptions: { 5655 auto ptr = reinterpret_cast<const ResizeBilinearOptions *>(obj); 5656 return verifier.VerifyTable(ptr); 5657 } 5658 case BuiltinOptions_CallOptions: { 5659 auto ptr = reinterpret_cast<const CallOptions *>(obj); 5660 return verifier.VerifyTable(ptr); 5661 } 5662 case BuiltinOptions_ReshapeOptions: { 5663 auto ptr = reinterpret_cast<const ReshapeOptions *>(obj); 5664 return verifier.VerifyTable(ptr); 5665 } 5666 case BuiltinOptions_SkipGramOptions: { 5667 auto ptr = reinterpret_cast<const SkipGramOptions *>(obj); 5668 return verifier.VerifyTable(ptr); 5669 } 5670 case BuiltinOptions_SpaceToDepthOptions: { 5671 auto ptr = reinterpret_cast<const SpaceToDepthOptions *>(obj); 5672 return verifier.VerifyTable(ptr); 5673 } 5674 case BuiltinOptions_EmbeddingLookupSparseOptions: { 5675 auto ptr = reinterpret_cast<const EmbeddingLookupSparseOptions *>(obj); 5676 return verifier.VerifyTable(ptr); 5677 } 5678 case BuiltinOptions_MulOptions: { 5679 auto ptr = reinterpret_cast<const MulOptions *>(obj); 5680 return verifier.VerifyTable(ptr); 5681 } 5682 case BuiltinOptions_PadOptions: { 5683 auto ptr = reinterpret_cast<const PadOptions *>(obj); 5684 return verifier.VerifyTable(ptr); 5685 } 5686 case BuiltinOptions_GatherOptions: { 5687 auto ptr = reinterpret_cast<const GatherOptions *>(obj); 5688 return verifier.VerifyTable(ptr); 5689 } 5690 case BuiltinOptions_BatchToSpaceNDOptions: { 5691 auto ptr = reinterpret_cast<const BatchToSpaceNDOptions *>(obj); 5692 return verifier.VerifyTable(ptr); 5693 } 5694 case BuiltinOptions_SpaceToBatchNDOptions: { 5695 auto ptr = reinterpret_cast<const SpaceToBatchNDOptions *>(obj); 5696 return verifier.VerifyTable(ptr); 5697 } 5698 case BuiltinOptions_TransposeOptions: { 5699 auto ptr = reinterpret_cast<const TransposeOptions *>(obj); 5700 return verifier.VerifyTable(ptr); 5701 } 5702 case BuiltinOptions_MeanOptions: { 5703 auto ptr = reinterpret_cast<const MeanOptions *>(obj); 5704 return verifier.VerifyTable(ptr); 5705 } 5706 case BuiltinOptions_SubOptions: { 5707 auto ptr = reinterpret_cast<const SubOptions *>(obj); 5708 return verifier.VerifyTable(ptr); 5709 } 5710 case BuiltinOptions_DivOptions: { 5711 auto ptr = reinterpret_cast<const DivOptions *>(obj); 5712 return verifier.VerifyTable(ptr); 5713 } 5714 case BuiltinOptions_SqueezeOptions: { 5715 auto ptr = reinterpret_cast<const SqueezeOptions *>(obj); 5716 return verifier.VerifyTable(ptr); 5717 } 5718 case BuiltinOptions_SequenceRNNOptions: { 5719 auto ptr = reinterpret_cast<const SequenceRNNOptions *>(obj); 5720 return verifier.VerifyTable(ptr); 5721 } 5722 case BuiltinOptions_StridedSliceOptions: { 5723 auto ptr = reinterpret_cast<const StridedSliceOptions *>(obj); 5724 return verifier.VerifyTable(ptr); 5725 } 5726 case BuiltinOptions_ExpOptions: { 5727 auto ptr = reinterpret_cast<const ExpOptions *>(obj); 5728 return verifier.VerifyTable(ptr); 5729 } 5730 case BuiltinOptions_TopKV2Options: { 5731 auto ptr = reinterpret_cast<const TopKV2Options *>(obj); 5732 return verifier.VerifyTable(ptr); 5733 } 5734 case BuiltinOptions_SplitOptions: { 5735 auto ptr = reinterpret_cast<const SplitOptions *>(obj); 5736 return verifier.VerifyTable(ptr); 5737 } 5738 default: return false; 5739 } 5740 } 5741 5742 inline bool VerifyBuiltinOptionsVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector<flatbuffers::Offset<void>> *values, const flatbuffers::Vector<uint8_t> *types) { 5743 if (!values || !types) return !values && !types; 5744 if (values->size() != types->size()) return false; 5745 for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) { 5746 if (!VerifyBuiltinOptions( 5747 verifier, values->Get(i), types->GetEnum<BuiltinOptions>(i))) { 5748 return false; 5749 } 5750 } 5751 return true; 5752 } 5753 5754 inline void *BuiltinOptionsUnion::UnPack(const void *obj, BuiltinOptions type, const flatbuffers::resolver_function_t *resolver) { 5755 switch (type) { 5756 case BuiltinOptions_Conv2DOptions: { 5757 auto ptr = reinterpret_cast<const Conv2DOptions *>(obj); 5758 return ptr->UnPack(resolver); 5759 } 5760 case BuiltinOptions_DepthwiseConv2DOptions: { 5761 auto ptr = reinterpret_cast<const DepthwiseConv2DOptions *>(obj); 5762 return ptr->UnPack(resolver); 5763 } 5764 case BuiltinOptions_ConcatEmbeddingsOptions: { 5765 auto ptr = reinterpret_cast<const ConcatEmbeddingsOptions *>(obj); 5766 return ptr->UnPack(resolver); 5767 } 5768 case BuiltinOptions_LSHProjectionOptions: { 5769 auto ptr = reinterpret_cast<const LSHProjectionOptions *>(obj); 5770 return ptr->UnPack(resolver); 5771 } 5772 case BuiltinOptions_Pool2DOptions: { 5773 auto ptr = reinterpret_cast<const Pool2DOptions *>(obj); 5774 return ptr->UnPack(resolver); 5775 } 5776 case BuiltinOptions_SVDFOptions: { 5777 auto ptr = reinterpret_cast<const SVDFOptions *>(obj); 5778 return ptr->UnPack(resolver); 5779 } 5780 case BuiltinOptions_RNNOptions: { 5781 auto ptr = reinterpret_cast<const RNNOptions *>(obj); 5782 return ptr->UnPack(resolver); 5783 } 5784 case BuiltinOptions_FullyConnectedOptions: { 5785 auto ptr = reinterpret_cast<const FullyConnectedOptions *>(obj); 5786 return ptr->UnPack(resolver); 5787 } 5788 case BuiltinOptions_SoftmaxOptions: { 5789 auto ptr = reinterpret_cast<const SoftmaxOptions *>(obj); 5790 return ptr->UnPack(resolver); 5791 } 5792 case BuiltinOptions_ConcatenationOptions: { 5793 auto ptr = reinterpret_cast<const ConcatenationOptions *>(obj); 5794 return ptr->UnPack(resolver); 5795 } 5796 case BuiltinOptions_AddOptions: { 5797 auto ptr = reinterpret_cast<const AddOptions *>(obj); 5798 return ptr->UnPack(resolver); 5799 } 5800 case BuiltinOptions_L2NormOptions: { 5801 auto ptr = reinterpret_cast<const L2NormOptions *>(obj); 5802 return ptr->UnPack(resolver); 5803 } 5804 case BuiltinOptions_LocalResponseNormalizationOptions: { 5805 auto ptr = reinterpret_cast<const LocalResponseNormalizationOptions *>(obj); 5806 return ptr->UnPack(resolver); 5807 } 5808 case BuiltinOptions_LSTMOptions: { 5809 auto ptr = reinterpret_cast<const LSTMOptions *>(obj); 5810 return ptr->UnPack(resolver); 5811 } 5812 case BuiltinOptions_ResizeBilinearOptions: { 5813 auto ptr = reinterpret_cast<const ResizeBilinearOptions *>(obj); 5814 return ptr->UnPack(resolver); 5815 } 5816 case BuiltinOptions_CallOptions: { 5817 auto ptr = reinterpret_cast<const CallOptions *>(obj); 5818 return ptr->UnPack(resolver); 5819 } 5820 case BuiltinOptions_ReshapeOptions: { 5821 auto ptr = reinterpret_cast<const ReshapeOptions *>(obj); 5822 return ptr->UnPack(resolver); 5823 } 5824 case BuiltinOptions_SkipGramOptions: { 5825 auto ptr = reinterpret_cast<const SkipGramOptions *>(obj); 5826 return ptr->UnPack(resolver); 5827 } 5828 case BuiltinOptions_SpaceToDepthOptions: { 5829 auto ptr = reinterpret_cast<const SpaceToDepthOptions *>(obj); 5830 return ptr->UnPack(resolver); 5831 } 5832 case BuiltinOptions_EmbeddingLookupSparseOptions: { 5833 auto ptr = reinterpret_cast<const EmbeddingLookupSparseOptions *>(obj); 5834 return ptr->UnPack(resolver); 5835 } 5836 case BuiltinOptions_MulOptions: { 5837 auto ptr = reinterpret_cast<const MulOptions *>(obj); 5838 return ptr->UnPack(resolver); 5839 } 5840 case BuiltinOptions_PadOptions: { 5841 auto ptr = reinterpret_cast<const PadOptions *>(obj); 5842 return ptr->UnPack(resolver); 5843 } 5844 case BuiltinOptions_GatherOptions: { 5845 auto ptr = reinterpret_cast<const GatherOptions *>(obj); 5846 return ptr->UnPack(resolver); 5847 } 5848 case BuiltinOptions_BatchToSpaceNDOptions: { 5849 auto ptr = reinterpret_cast<const BatchToSpaceNDOptions *>(obj); 5850 return ptr->UnPack(resolver); 5851 } 5852 case BuiltinOptions_SpaceToBatchNDOptions: { 5853 auto ptr = reinterpret_cast<const SpaceToBatchNDOptions *>(obj); 5854 return ptr->UnPack(resolver); 5855 } 5856 case BuiltinOptions_TransposeOptions: { 5857 auto ptr = reinterpret_cast<const TransposeOptions *>(obj); 5858 return ptr->UnPack(resolver); 5859 } 5860 case BuiltinOptions_MeanOptions: { 5861 auto ptr = reinterpret_cast<const MeanOptions *>(obj); 5862 return ptr->UnPack(resolver); 5863 } 5864 case BuiltinOptions_SubOptions: { 5865 auto ptr = reinterpret_cast<const SubOptions *>(obj); 5866 return ptr->UnPack(resolver); 5867 } 5868 case BuiltinOptions_DivOptions: { 5869 auto ptr = reinterpret_cast<const DivOptions *>(obj); 5870 return ptr->UnPack(resolver); 5871 } 5872 case BuiltinOptions_SqueezeOptions: { 5873 auto ptr = reinterpret_cast<const SqueezeOptions *>(obj); 5874 return ptr->UnPack(resolver); 5875 } 5876 case BuiltinOptions_SequenceRNNOptions: { 5877 auto ptr = reinterpret_cast<const SequenceRNNOptions *>(obj); 5878 return ptr->UnPack(resolver); 5879 } 5880 case BuiltinOptions_StridedSliceOptions: { 5881 auto ptr = reinterpret_cast<const StridedSliceOptions *>(obj); 5882 return ptr->UnPack(resolver); 5883 } 5884 case BuiltinOptions_ExpOptions: { 5885 auto ptr = reinterpret_cast<const ExpOptions *>(obj); 5886 return ptr->UnPack(resolver); 5887 } 5888 case BuiltinOptions_TopKV2Options: { 5889 auto ptr = reinterpret_cast<const TopKV2Options *>(obj); 5890 return ptr->UnPack(resolver); 5891 } 5892 case BuiltinOptions_SplitOptions: { 5893 auto ptr = reinterpret_cast<const SplitOptions *>(obj); 5894 return ptr->UnPack(resolver); 5895 } 5896 default: return nullptr; 5897 } 5898 } 5899 5900 inline flatbuffers::Offset<void> BuiltinOptionsUnion::Pack(flatbuffers::FlatBufferBuilder &_fbb, const flatbuffers::rehasher_function_t *_rehasher) const { 5901 switch (type) { 5902 case BuiltinOptions_Conv2DOptions: { 5903 auto ptr = reinterpret_cast<const Conv2DOptionsT *>(value); 5904 return CreateConv2DOptions(_fbb, ptr, _rehasher).Union(); 5905 } 5906 case BuiltinOptions_DepthwiseConv2DOptions: { 5907 auto ptr = reinterpret_cast<const DepthwiseConv2DOptionsT *>(value); 5908 return CreateDepthwiseConv2DOptions(_fbb, ptr, _rehasher).Union(); 5909 } 5910 case BuiltinOptions_ConcatEmbeddingsOptions: { 5911 auto ptr = reinterpret_cast<const ConcatEmbeddingsOptionsT *>(value); 5912 return CreateConcatEmbeddingsOptions(_fbb, ptr, _rehasher).Union(); 5913 } 5914 case BuiltinOptions_LSHProjectionOptions: { 5915 auto ptr = reinterpret_cast<const LSHProjectionOptionsT *>(value); 5916 return CreateLSHProjectionOptions(_fbb, ptr, _rehasher).Union(); 5917 } 5918 case BuiltinOptions_Pool2DOptions: { 5919 auto ptr = reinterpret_cast<const Pool2DOptionsT *>(value); 5920 return CreatePool2DOptions(_fbb, ptr, _rehasher).Union(); 5921 } 5922 case BuiltinOptions_SVDFOptions: { 5923 auto ptr = reinterpret_cast<const SVDFOptionsT *>(value); 5924 return CreateSVDFOptions(_fbb, ptr, _rehasher).Union(); 5925 } 5926 case BuiltinOptions_RNNOptions: { 5927 auto ptr = reinterpret_cast<const RNNOptionsT *>(value); 5928 return CreateRNNOptions(_fbb, ptr, _rehasher).Union(); 5929 } 5930 case BuiltinOptions_FullyConnectedOptions: { 5931 auto ptr = reinterpret_cast<const FullyConnectedOptionsT *>(value); 5932 return CreateFullyConnectedOptions(_fbb, ptr, _rehasher).Union(); 5933 } 5934 case BuiltinOptions_SoftmaxOptions: { 5935 auto ptr = reinterpret_cast<const SoftmaxOptionsT *>(value); 5936 return CreateSoftmaxOptions(_fbb, ptr, _rehasher).Union(); 5937 } 5938 case BuiltinOptions_ConcatenationOptions: { 5939 auto ptr = reinterpret_cast<const ConcatenationOptionsT *>(value); 5940 return CreateConcatenationOptions(_fbb, ptr, _rehasher).Union(); 5941 } 5942 case BuiltinOptions_AddOptions: { 5943 auto ptr = reinterpret_cast<const AddOptionsT *>(value); 5944 return CreateAddOptions(_fbb, ptr, _rehasher).Union(); 5945 } 5946 case BuiltinOptions_L2NormOptions: { 5947 auto ptr = reinterpret_cast<const L2NormOptionsT *>(value); 5948 return CreateL2NormOptions(_fbb, ptr, _rehasher).Union(); 5949 } 5950 case BuiltinOptions_LocalResponseNormalizationOptions: { 5951 auto ptr = reinterpret_cast<const LocalResponseNormalizationOptionsT *>(value); 5952 return CreateLocalResponseNormalizationOptions(_fbb, ptr, _rehasher).Union(); 5953 } 5954 case BuiltinOptions_LSTMOptions: { 5955 auto ptr = reinterpret_cast<const LSTMOptionsT *>(value); 5956 return CreateLSTMOptions(_fbb, ptr, _rehasher).Union(); 5957 } 5958 case BuiltinOptions_ResizeBilinearOptions: { 5959 auto ptr = reinterpret_cast<const ResizeBilinearOptionsT *>(value); 5960 return CreateResizeBilinearOptions(_fbb, ptr, _rehasher).Union(); 5961 } 5962 case BuiltinOptions_CallOptions: { 5963 auto ptr = reinterpret_cast<const CallOptionsT *>(value); 5964 return CreateCallOptions(_fbb, ptr, _rehasher).Union(); 5965 } 5966 case BuiltinOptions_ReshapeOptions: { 5967 auto ptr = reinterpret_cast<const ReshapeOptionsT *>(value); 5968 return CreateReshapeOptions(_fbb, ptr, _rehasher).Union(); 5969 } 5970 case BuiltinOptions_SkipGramOptions: { 5971 auto ptr = reinterpret_cast<const SkipGramOptionsT *>(value); 5972 return CreateSkipGramOptions(_fbb, ptr, _rehasher).Union(); 5973 } 5974 case BuiltinOptions_SpaceToDepthOptions: { 5975 auto ptr = reinterpret_cast<const SpaceToDepthOptionsT *>(value); 5976 return CreateSpaceToDepthOptions(_fbb, ptr, _rehasher).Union(); 5977 } 5978 case BuiltinOptions_EmbeddingLookupSparseOptions: { 5979 auto ptr = reinterpret_cast<const EmbeddingLookupSparseOptionsT *>(value); 5980 return CreateEmbeddingLookupSparseOptions(_fbb, ptr, _rehasher).Union(); 5981 } 5982 case BuiltinOptions_MulOptions: { 5983 auto ptr = reinterpret_cast<const MulOptionsT *>(value); 5984 return CreateMulOptions(_fbb, ptr, _rehasher).Union(); 5985 } 5986 case BuiltinOptions_PadOptions: { 5987 auto ptr = reinterpret_cast<const PadOptionsT *>(value); 5988 return CreatePadOptions(_fbb, ptr, _rehasher).Union(); 5989 } 5990 case BuiltinOptions_GatherOptions: { 5991 auto ptr = reinterpret_cast<const GatherOptionsT *>(value); 5992 return CreateGatherOptions(_fbb, ptr, _rehasher).Union(); 5993 } 5994 case BuiltinOptions_BatchToSpaceNDOptions: { 5995 auto ptr = reinterpret_cast<const BatchToSpaceNDOptionsT *>(value); 5996 return CreateBatchToSpaceNDOptions(_fbb, ptr, _rehasher).Union(); 5997 } 5998 case BuiltinOptions_SpaceToBatchNDOptions: { 5999 auto ptr = reinterpret_cast<const SpaceToBatchNDOptionsT *>(value); 6000 return CreateSpaceToBatchNDOptions(_fbb, ptr, _rehasher).Union(); 6001 } 6002 case BuiltinOptions_TransposeOptions: { 6003 auto ptr = reinterpret_cast<const TransposeOptionsT *>(value); 6004 return CreateTransposeOptions(_fbb, ptr, _rehasher).Union(); 6005 } 6006 case BuiltinOptions_MeanOptions: { 6007 auto ptr = reinterpret_cast<const MeanOptionsT *>(value); 6008 return CreateMeanOptions(_fbb, ptr, _rehasher).Union(); 6009 } 6010 case BuiltinOptions_SubOptions: { 6011 auto ptr = reinterpret_cast<const SubOptionsT *>(value); 6012 return CreateSubOptions(_fbb, ptr, _rehasher).Union(); 6013 } 6014 case BuiltinOptions_DivOptions: { 6015 auto ptr = reinterpret_cast<const DivOptionsT *>(value); 6016 return CreateDivOptions(_fbb, ptr, _rehasher).Union(); 6017 } 6018 case BuiltinOptions_SqueezeOptions: { 6019 auto ptr = reinterpret_cast<const SqueezeOptionsT *>(value); 6020 return CreateSqueezeOptions(_fbb, ptr, _rehasher).Union(); 6021 } 6022 case BuiltinOptions_SequenceRNNOptions: { 6023 auto ptr = reinterpret_cast<const SequenceRNNOptionsT *>(value); 6024 return CreateSequenceRNNOptions(_fbb, ptr, _rehasher).Union(); 6025 } 6026 case BuiltinOptions_StridedSliceOptions: { 6027 auto ptr = reinterpret_cast<const StridedSliceOptionsT *>(value); 6028 return CreateStridedSliceOptions(_fbb, ptr, _rehasher).Union(); 6029 } 6030 case BuiltinOptions_ExpOptions: { 6031 auto ptr = reinterpret_cast<const ExpOptionsT *>(value); 6032 return CreateExpOptions(_fbb, ptr, _rehasher).Union(); 6033 } 6034 case BuiltinOptions_TopKV2Options: { 6035 auto ptr = reinterpret_cast<const TopKV2OptionsT *>(value); 6036 return CreateTopKV2Options(_fbb, ptr, _rehasher).Union(); 6037 } 6038 case BuiltinOptions_SplitOptions: { 6039 auto ptr = reinterpret_cast<const SplitOptionsT *>(value); 6040 return CreateSplitOptions(_fbb, ptr, _rehasher).Union(); 6041 } 6042 default: return 0; 6043 } 6044 } 6045 6046 inline BuiltinOptionsUnion::BuiltinOptionsUnion(const BuiltinOptionsUnion &u) FLATBUFFERS_NOEXCEPT : type(u.type), value(nullptr) { 6047 switch (type) { 6048 case BuiltinOptions_Conv2DOptions: { 6049 value = new Conv2DOptionsT(*reinterpret_cast<Conv2DOptionsT *>(u.value)); 6050 break; 6051 } 6052 case BuiltinOptions_DepthwiseConv2DOptions: { 6053 value = new DepthwiseConv2DOptionsT(*reinterpret_cast<DepthwiseConv2DOptionsT *>(u.value)); 6054 break; 6055 } 6056 case BuiltinOptions_ConcatEmbeddingsOptions: { 6057 value = new ConcatEmbeddingsOptionsT(*reinterpret_cast<ConcatEmbeddingsOptionsT *>(u.value)); 6058 break; 6059 } 6060 case BuiltinOptions_LSHProjectionOptions: { 6061 value = new LSHProjectionOptionsT(*reinterpret_cast<LSHProjectionOptionsT *>(u.value)); 6062 break; 6063 } 6064 case BuiltinOptions_Pool2DOptions: { 6065 value = new Pool2DOptionsT(*reinterpret_cast<Pool2DOptionsT *>(u.value)); 6066 break; 6067 } 6068 case BuiltinOptions_SVDFOptions: { 6069 value = new SVDFOptionsT(*reinterpret_cast<SVDFOptionsT *>(u.value)); 6070 break; 6071 } 6072 case BuiltinOptions_RNNOptions: { 6073 value = new RNNOptionsT(*reinterpret_cast<RNNOptionsT *>(u.value)); 6074 break; 6075 } 6076 case BuiltinOptions_FullyConnectedOptions: { 6077 value = new FullyConnectedOptionsT(*reinterpret_cast<FullyConnectedOptionsT *>(u.value)); 6078 break; 6079 } 6080 case BuiltinOptions_SoftmaxOptions: { 6081 value = new SoftmaxOptionsT(*reinterpret_cast<SoftmaxOptionsT *>(u.value)); 6082 break; 6083 } 6084 case BuiltinOptions_ConcatenationOptions: { 6085 value = new ConcatenationOptionsT(*reinterpret_cast<ConcatenationOptionsT *>(u.value)); 6086 break; 6087 } 6088 case BuiltinOptions_AddOptions: { 6089 value = new AddOptionsT(*reinterpret_cast<AddOptionsT *>(u.value)); 6090 break; 6091 } 6092 case BuiltinOptions_L2NormOptions: { 6093 value = new L2NormOptionsT(*reinterpret_cast<L2NormOptionsT *>(u.value)); 6094 break; 6095 } 6096 case BuiltinOptions_LocalResponseNormalizationOptions: { 6097 value = new LocalResponseNormalizationOptionsT(*reinterpret_cast<LocalResponseNormalizationOptionsT *>(u.value)); 6098 break; 6099 } 6100 case BuiltinOptions_LSTMOptions: { 6101 value = new LSTMOptionsT(*reinterpret_cast<LSTMOptionsT *>(u.value)); 6102 break; 6103 } 6104 case BuiltinOptions_ResizeBilinearOptions: { 6105 value = new ResizeBilinearOptionsT(*reinterpret_cast<ResizeBilinearOptionsT *>(u.value)); 6106 break; 6107 } 6108 case BuiltinOptions_CallOptions: { 6109 value = new CallOptionsT(*reinterpret_cast<CallOptionsT *>(u.value)); 6110 break; 6111 } 6112 case BuiltinOptions_ReshapeOptions: { 6113 value = new ReshapeOptionsT(*reinterpret_cast<ReshapeOptionsT *>(u.value)); 6114 break; 6115 } 6116 case BuiltinOptions_SkipGramOptions: { 6117 value = new SkipGramOptionsT(*reinterpret_cast<SkipGramOptionsT *>(u.value)); 6118 break; 6119 } 6120 case BuiltinOptions_SpaceToDepthOptions: { 6121 value = new SpaceToDepthOptionsT(*reinterpret_cast<SpaceToDepthOptionsT *>(u.value)); 6122 break; 6123 } 6124 case BuiltinOptions_EmbeddingLookupSparseOptions: { 6125 value = new EmbeddingLookupSparseOptionsT(*reinterpret_cast<EmbeddingLookupSparseOptionsT *>(u.value)); 6126 break; 6127 } 6128 case BuiltinOptions_MulOptions: { 6129 value = new MulOptionsT(*reinterpret_cast<MulOptionsT *>(u.value)); 6130 break; 6131 } 6132 case BuiltinOptions_PadOptions: { 6133 value = new PadOptionsT(*reinterpret_cast<PadOptionsT *>(u.value)); 6134 break; 6135 } 6136 case BuiltinOptions_GatherOptions: { 6137 value = new GatherOptionsT(*reinterpret_cast<GatherOptionsT *>(u.value)); 6138 break; 6139 } 6140 case BuiltinOptions_BatchToSpaceNDOptions: { 6141 value = new BatchToSpaceNDOptionsT(*reinterpret_cast<BatchToSpaceNDOptionsT *>(u.value)); 6142 break; 6143 } 6144 case BuiltinOptions_SpaceToBatchNDOptions: { 6145 value = new SpaceToBatchNDOptionsT(*reinterpret_cast<SpaceToBatchNDOptionsT *>(u.value)); 6146 break; 6147 } 6148 case BuiltinOptions_TransposeOptions: { 6149 value = new TransposeOptionsT(*reinterpret_cast<TransposeOptionsT *>(u.value)); 6150 break; 6151 } 6152 case BuiltinOptions_MeanOptions: { 6153 value = new MeanOptionsT(*reinterpret_cast<MeanOptionsT *>(u.value)); 6154 break; 6155 } 6156 case BuiltinOptions_SubOptions: { 6157 value = new SubOptionsT(*reinterpret_cast<SubOptionsT *>(u.value)); 6158 break; 6159 } 6160 case BuiltinOptions_DivOptions: { 6161 value = new DivOptionsT(*reinterpret_cast<DivOptionsT *>(u.value)); 6162 break; 6163 } 6164 case BuiltinOptions_SqueezeOptions: { 6165 value = new SqueezeOptionsT(*reinterpret_cast<SqueezeOptionsT *>(u.value)); 6166 break; 6167 } 6168 case BuiltinOptions_SequenceRNNOptions: { 6169 value = new SequenceRNNOptionsT(*reinterpret_cast<SequenceRNNOptionsT *>(u.value)); 6170 break; 6171 } 6172 case BuiltinOptions_StridedSliceOptions: { 6173 value = new StridedSliceOptionsT(*reinterpret_cast<StridedSliceOptionsT *>(u.value)); 6174 break; 6175 } 6176 case BuiltinOptions_ExpOptions: { 6177 value = new ExpOptionsT(*reinterpret_cast<ExpOptionsT *>(u.value)); 6178 break; 6179 } 6180 case BuiltinOptions_TopKV2Options: { 6181 value = new TopKV2OptionsT(*reinterpret_cast<TopKV2OptionsT *>(u.value)); 6182 break; 6183 } 6184 case BuiltinOptions_SplitOptions: { 6185 value = new SplitOptionsT(*reinterpret_cast<SplitOptionsT *>(u.value)); 6186 break; 6187 } 6188 default: 6189 break; 6190 } 6191 } 6192 6193 inline void BuiltinOptionsUnion::Reset() { 6194 switch (type) { 6195 case BuiltinOptions_Conv2DOptions: { 6196 auto ptr = reinterpret_cast<Conv2DOptionsT *>(value); 6197 delete ptr; 6198 break; 6199 } 6200 case BuiltinOptions_DepthwiseConv2DOptions: { 6201 auto ptr = reinterpret_cast<DepthwiseConv2DOptionsT *>(value); 6202 delete ptr; 6203 break; 6204 } 6205 case BuiltinOptions_ConcatEmbeddingsOptions: { 6206 auto ptr = reinterpret_cast<ConcatEmbeddingsOptionsT *>(value); 6207 delete ptr; 6208 break; 6209 } 6210 case BuiltinOptions_LSHProjectionOptions: { 6211 auto ptr = reinterpret_cast<LSHProjectionOptionsT *>(value); 6212 delete ptr; 6213 break; 6214 } 6215 case BuiltinOptions_Pool2DOptions: { 6216 auto ptr = reinterpret_cast<Pool2DOptionsT *>(value); 6217 delete ptr; 6218 break; 6219 } 6220 case BuiltinOptions_SVDFOptions: { 6221 auto ptr = reinterpret_cast<SVDFOptionsT *>(value); 6222 delete ptr; 6223 break; 6224 } 6225 case BuiltinOptions_RNNOptions: { 6226 auto ptr = reinterpret_cast<RNNOptionsT *>(value); 6227 delete ptr; 6228 break; 6229 } 6230 case BuiltinOptions_FullyConnectedOptions: { 6231 auto ptr = reinterpret_cast<FullyConnectedOptionsT *>(value); 6232 delete ptr; 6233 break; 6234 } 6235 case BuiltinOptions_SoftmaxOptions: { 6236 auto ptr = reinterpret_cast<SoftmaxOptionsT *>(value); 6237 delete ptr; 6238 break; 6239 } 6240 case BuiltinOptions_ConcatenationOptions: { 6241 auto ptr = reinterpret_cast<ConcatenationOptionsT *>(value); 6242 delete ptr; 6243 break; 6244 } 6245 case BuiltinOptions_AddOptions: { 6246 auto ptr = reinterpret_cast<AddOptionsT *>(value); 6247 delete ptr; 6248 break; 6249 } 6250 case BuiltinOptions_L2NormOptions: { 6251 auto ptr = reinterpret_cast<L2NormOptionsT *>(value); 6252 delete ptr; 6253 break; 6254 } 6255 case BuiltinOptions_LocalResponseNormalizationOptions: { 6256 auto ptr = reinterpret_cast<LocalResponseNormalizationOptionsT *>(value); 6257 delete ptr; 6258 break; 6259 } 6260 case BuiltinOptions_LSTMOptions: { 6261 auto ptr = reinterpret_cast<LSTMOptionsT *>(value); 6262 delete ptr; 6263 break; 6264 } 6265 case BuiltinOptions_ResizeBilinearOptions: { 6266 auto ptr = reinterpret_cast<ResizeBilinearOptionsT *>(value); 6267 delete ptr; 6268 break; 6269 } 6270 case BuiltinOptions_CallOptions: { 6271 auto ptr = reinterpret_cast<CallOptionsT *>(value); 6272 delete ptr; 6273 break; 6274 } 6275 case BuiltinOptions_ReshapeOptions: { 6276 auto ptr = reinterpret_cast<ReshapeOptionsT *>(value); 6277 delete ptr; 6278 break; 6279 } 6280 case BuiltinOptions_SkipGramOptions: { 6281 auto ptr = reinterpret_cast<SkipGramOptionsT *>(value); 6282 delete ptr; 6283 break; 6284 } 6285 case BuiltinOptions_SpaceToDepthOptions: { 6286 auto ptr = reinterpret_cast<SpaceToDepthOptionsT *>(value); 6287 delete ptr; 6288 break; 6289 } 6290 case BuiltinOptions_EmbeddingLookupSparseOptions: { 6291 auto ptr = reinterpret_cast<EmbeddingLookupSparseOptionsT *>(value); 6292 delete ptr; 6293 break; 6294 } 6295 case BuiltinOptions_MulOptions: { 6296 auto ptr = reinterpret_cast<MulOptionsT *>(value); 6297 delete ptr; 6298 break; 6299 } 6300 case BuiltinOptions_PadOptions: { 6301 auto ptr = reinterpret_cast<PadOptionsT *>(value); 6302 delete ptr; 6303 break; 6304 } 6305 case BuiltinOptions_GatherOptions: { 6306 auto ptr = reinterpret_cast<GatherOptionsT *>(value); 6307 delete ptr; 6308 break; 6309 } 6310 case BuiltinOptions_BatchToSpaceNDOptions: { 6311 auto ptr = reinterpret_cast<BatchToSpaceNDOptionsT *>(value); 6312 delete ptr; 6313 break; 6314 } 6315 case BuiltinOptions_SpaceToBatchNDOptions: { 6316 auto ptr = reinterpret_cast<SpaceToBatchNDOptionsT *>(value); 6317 delete ptr; 6318 break; 6319 } 6320 case BuiltinOptions_TransposeOptions: { 6321 auto ptr = reinterpret_cast<TransposeOptionsT *>(value); 6322 delete ptr; 6323 break; 6324 } 6325 case BuiltinOptions_MeanOptions: { 6326 auto ptr = reinterpret_cast<MeanOptionsT *>(value); 6327 delete ptr; 6328 break; 6329 } 6330 case BuiltinOptions_SubOptions: { 6331 auto ptr = reinterpret_cast<SubOptionsT *>(value); 6332 delete ptr; 6333 break; 6334 } 6335 case BuiltinOptions_DivOptions: { 6336 auto ptr = reinterpret_cast<DivOptionsT *>(value); 6337 delete ptr; 6338 break; 6339 } 6340 case BuiltinOptions_SqueezeOptions: { 6341 auto ptr = reinterpret_cast<SqueezeOptionsT *>(value); 6342 delete ptr; 6343 break; 6344 } 6345 case BuiltinOptions_SequenceRNNOptions: { 6346 auto ptr = reinterpret_cast<SequenceRNNOptionsT *>(value); 6347 delete ptr; 6348 break; 6349 } 6350 case BuiltinOptions_StridedSliceOptions: { 6351 auto ptr = reinterpret_cast<StridedSliceOptionsT *>(value); 6352 delete ptr; 6353 break; 6354 } 6355 case BuiltinOptions_ExpOptions: { 6356 auto ptr = reinterpret_cast<ExpOptionsT *>(value); 6357 delete ptr; 6358 break; 6359 } 6360 case BuiltinOptions_TopKV2Options: { 6361 auto ptr = reinterpret_cast<TopKV2OptionsT *>(value); 6362 delete ptr; 6363 break; 6364 } 6365 case BuiltinOptions_SplitOptions: { 6366 auto ptr = reinterpret_cast<SplitOptionsT *>(value); 6367 delete ptr; 6368 break; 6369 } 6370 default: break; 6371 } 6372 value = nullptr; 6373 type = BuiltinOptions_NONE; 6374 } 6375 6376 inline const tflite::Model *GetModel(const void *buf) { 6377 return flatbuffers::GetRoot<tflite::Model>(buf); 6378 } 6379 6380 inline const char *ModelIdentifier() { 6381 return "TFL3"; 6382 } 6383 6384 inline bool ModelBufferHasIdentifier(const void *buf) { 6385 return flatbuffers::BufferHasIdentifier( 6386 buf, ModelIdentifier()); 6387 } 6388 6389 inline bool VerifyModelBuffer( 6390 flatbuffers::Verifier &verifier) { 6391 return verifier.VerifyBuffer<tflite::Model>(ModelIdentifier()); 6392 } 6393 6394 inline const char *ModelExtension() { 6395 return "tflite"; 6396 } 6397 6398 inline void FinishModelBuffer( 6399 flatbuffers::FlatBufferBuilder &fbb, 6400 flatbuffers::Offset<tflite::Model> root) { 6401 fbb.Finish(root, ModelIdentifier()); 6402 } 6403 6404 inline std::unique_ptr<ModelT> UnPackModel( 6405 const void *buf, 6406 const flatbuffers::resolver_function_t *res = nullptr) { 6407 return std::unique_ptr<ModelT>(GetModel(buf)->UnPack(res)); 6408 } 6409 6410 } // namespace tflite 6411 6412 #endif // FLATBUFFERS_GENERATED_SCHEMA_TFLITE_H_ 6413