forked from alibaba/MNN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TFQuantizeOp_generated.h
2794 lines (2563 loc) · 100 KB
/
TFQuantizeOp_generated.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// automatically generated by the FlatBuffers compiler, do not modify
#ifndef FLATBUFFERS_GENERATED_TFQUANTIZEOP_MNN_H_
#define FLATBUFFERS_GENERATED_TFQUANTIZEOP_MNN_H_
#include "CaffeOp_generated.h"
#include "Tensor_generated.h"
#include "Type_generated.h"
namespace MNN {
struct QuantizedParam;
struct QuantizedParamT;
struct QuantizedAdd;
struct QuantizedAddT;
struct Dequantize;
struct DequantizeT;
struct QuantizedAvgPool;
struct QuantizedAvgPoolT;
struct QuantizedBiasAdd;
struct QuantizedBiasAddT;
struct QuantizedConcat;
struct QuantizedConcatT;
struct QuantizedLogistic;
struct QuantizedLogisticT;
struct QuantizedMatMul;
struct QuantizedMatMulT;
struct QuantizedMaxPool;
struct QuantizedMaxPoolT;
struct QuantizedRelu;
struct QuantizedReluT;
struct QuantizedRelu6;
struct QuantizedRelu6T;
struct QuantizedReshape;
struct QuantizedReshapeT;
struct QuantizedSoftmax;
struct QuantizedSoftmaxT;
struct QuantizeV2;
struct QuantizeV2T;
struct RequantizationRange;
struct RequantizationRangeT;
struct Requantize;
struct RequantizeT;
struct TfQuantizedConv2D;
struct TfQuantizedConv2DT;
inline const flatbuffers::TypeTable *QuantizedParamTypeTable();
inline const flatbuffers::TypeTable *QuantizedAddTypeTable();
inline const flatbuffers::TypeTable *DequantizeTypeTable();
inline const flatbuffers::TypeTable *QuantizedAvgPoolTypeTable();
inline const flatbuffers::TypeTable *QuantizedBiasAddTypeTable();
inline const flatbuffers::TypeTable *QuantizedConcatTypeTable();
inline const flatbuffers::TypeTable *QuantizedLogisticTypeTable();
inline const flatbuffers::TypeTable *QuantizedMatMulTypeTable();
inline const flatbuffers::TypeTable *QuantizedMaxPoolTypeTable();
inline const flatbuffers::TypeTable *QuantizedReluTypeTable();
inline const flatbuffers::TypeTable *QuantizedRelu6TypeTable();
inline const flatbuffers::TypeTable *QuantizedReshapeTypeTable();
inline const flatbuffers::TypeTable *QuantizedSoftmaxTypeTable();
inline const flatbuffers::TypeTable *QuantizeV2TypeTable();
inline const flatbuffers::TypeTable *RequantizationRangeTypeTable();
inline const flatbuffers::TypeTable *RequantizeTypeTable();
inline const flatbuffers::TypeTable *TfQuantizedConv2DTypeTable();
enum FusedActivation {
FusedActivation_kTfLiteActNone = 0,
FusedActivation_kTfLiteActRelu = 1,
FusedActivation_kTfLiteActRelu1 = 2,
FusedActivation_kTfLiteActRelu6 = 3,
FusedActivation_kTfLiteActTanh = 4,
FusedActivation_kTfLiteActSignBit = 5,
FusedActivation_kTfLiteActSigmoid = 6,
FusedActivation_MIN = FusedActivation_kTfLiteActNone,
FusedActivation_MAX = FusedActivation_kTfLiteActSigmoid
};
inline const FusedActivation (&EnumValuesFusedActivation())[7] {
static const FusedActivation values[] = {
FusedActivation_kTfLiteActNone,
FusedActivation_kTfLiteActRelu,
FusedActivation_kTfLiteActRelu1,
FusedActivation_kTfLiteActRelu6,
FusedActivation_kTfLiteActTanh,
FusedActivation_kTfLiteActSignBit,
FusedActivation_kTfLiteActSigmoid
};
return values;
}
inline const char * const *EnumNamesFusedActivation() {
static const char * const names[] = {
"kTfLiteActNone",
"kTfLiteActRelu",
"kTfLiteActRelu1",
"kTfLiteActRelu6",
"kTfLiteActTanh",
"kTfLiteActSignBit",
"kTfLiteActSigmoid",
nullptr
};
return names;
}
inline const char *EnumNameFusedActivation(FusedActivation e) {
if (e < FusedActivation_kTfLiteActNone || e > FusedActivation_kTfLiteActSigmoid) return "";
const size_t index = static_cast<int>(e);
return EnumNamesFusedActivation()[index];
}
enum ModeFormat {
ModeFormat_TENSORFLOW = 0,
ModeFormat_TFLITE = 1,
ModeFormat_MIN = ModeFormat_TENSORFLOW,
ModeFormat_MAX = ModeFormat_TFLITE
};
inline const ModeFormat (&EnumValuesModeFormat())[2] {
static const ModeFormat values[] = {
ModeFormat_TENSORFLOW,
ModeFormat_TFLITE
};
return values;
}
inline const char * const *EnumNamesModeFormat() {
static const char * const names[] = {
"TENSORFLOW",
"TFLITE",
nullptr
};
return names;
}
inline const char *EnumNameModeFormat(ModeFormat e) {
if (e < ModeFormat_TENSORFLOW || e > ModeFormat_TFLITE) return "";
const size_t index = static_cast<int>(e);
return EnumNamesModeFormat()[index];
}
enum QuantizeMode {
QuantizeMode_MIN_COMBINED = 0,
QuantizeMode_MIN_FIRST = 1,
QuantizeMode_SCALED = 2,
QuantizeMode_MIN = QuantizeMode_MIN_COMBINED,
QuantizeMode_MAX = QuantizeMode_SCALED
};
inline const QuantizeMode (&EnumValuesQuantizeMode())[3] {
static const QuantizeMode values[] = {
QuantizeMode_MIN_COMBINED,
QuantizeMode_MIN_FIRST,
QuantizeMode_SCALED
};
return values;
}
inline const char * const *EnumNamesQuantizeMode() {
static const char * const names[] = {
"MIN_COMBINED",
"MIN_FIRST",
"SCALED",
nullptr
};
return names;
}
inline const char *EnumNameQuantizeMode(QuantizeMode e) {
if (e < QuantizeMode_MIN_COMBINED || e > QuantizeMode_SCALED) return "";
const size_t index = static_cast<int>(e);
return EnumNamesQuantizeMode()[index];
}
enum QuantizeRoundMode {
QuantizeRoundMode_HALF_AWAY_FROM_ZERO = 0,
QuantizeRoundMode_HALF_TO_EVEN = 1,
QuantizeRoundMode_MIN = QuantizeRoundMode_HALF_AWAY_FROM_ZERO,
QuantizeRoundMode_MAX = QuantizeRoundMode_HALF_TO_EVEN
};
inline const QuantizeRoundMode (&EnumValuesQuantizeRoundMode())[2] {
static const QuantizeRoundMode values[] = {
QuantizeRoundMode_HALF_AWAY_FROM_ZERO,
QuantizeRoundMode_HALF_TO_EVEN
};
return values;
}
inline const char * const *EnumNamesQuantizeRoundMode() {
static const char * const names[] = {
"HALF_AWAY_FROM_ZERO",
"HALF_TO_EVEN",
nullptr
};
return names;
}
inline const char *EnumNameQuantizeRoundMode(QuantizeRoundMode e) {
if (e < QuantizeRoundMode_HALF_AWAY_FROM_ZERO || e > QuantizeRoundMode_HALF_TO_EVEN) return "";
const size_t index = static_cast<int>(e);
return EnumNamesQuantizeRoundMode()[index];
}
struct QuantizedParamT : public flatbuffers::NativeTable {
typedef QuantizedParam TableType;
int32_t zeroPoint;
float scale;
QuantizedParamT()
: zeroPoint(0),
scale(0.0f) {
}
};
struct QuantizedParam FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
typedef QuantizedParamT NativeTableType;
static const flatbuffers::TypeTable *MiniReflectTypeTable() {
return QuantizedParamTypeTable();
}
int32_t zeroPoint() const {
return GetField<int32_t>(4, 0);
}
float scale() const {
return GetField<float>(6, 0.0f);
}
bool Verify(flatbuffers::Verifier &verifier) const {
return VerifyTableStart(verifier) &&
VerifyField<int32_t>(verifier, 4) &&
VerifyField<float>(verifier, 6) &&
verifier.EndTable();
}
QuantizedParamT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
void UnPackTo(QuantizedParamT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
static flatbuffers::Offset<QuantizedParam> Pack(flatbuffers::FlatBufferBuilder &_fbb, const QuantizedParamT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
};
struct QuantizedParamBuilder {
flatbuffers::FlatBufferBuilder &fbb_;
flatbuffers::uoffset_t start_;
void add_zeroPoint(int32_t zeroPoint) {
fbb_.AddElement<int32_t>(4, zeroPoint, 0);
}
void add_scale(float scale) {
fbb_.AddElement<float>(6, scale, 0.0f);
}
explicit QuantizedParamBuilder(flatbuffers::FlatBufferBuilder &_fbb)
: fbb_(_fbb) {
start_ = fbb_.StartTable();
}
QuantizedParamBuilder &operator=(const QuantizedParamBuilder &);
flatbuffers::Offset<QuantizedParam> Finish() {
const auto end = fbb_.EndTable(start_);
auto o = flatbuffers::Offset<QuantizedParam>(end);
return o;
}
};
inline flatbuffers::Offset<QuantizedParam> CreateQuantizedParam(
flatbuffers::FlatBufferBuilder &_fbb,
int32_t zeroPoint = 0,
float scale = 0.0f) {
QuantizedParamBuilder builder_(_fbb);
builder_.add_scale(scale);
builder_.add_zeroPoint(zeroPoint);
return builder_.Finish();
}
flatbuffers::Offset<QuantizedParam> CreateQuantizedParam(flatbuffers::FlatBufferBuilder &_fbb, const QuantizedParamT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
struct QuantizedAddT : public flatbuffers::NativeTable {
typedef QuantizedAdd TableType;
FusedActivation activationType;
std::unique_ptr<QuantizedParamT> input1QuantizedParam;
std::unique_ptr<QuantizedParamT> input2QuantizedParam;
std::unique_ptr<QuantizedParamT> outputQuantizedParam;
QuantizedAddT()
: activationType(FusedActivation_kTfLiteActNone) {
}
};
struct QuantizedAdd FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
typedef QuantizedAddT NativeTableType;
static const flatbuffers::TypeTable *MiniReflectTypeTable() {
return QuantizedAddTypeTable();
}
FusedActivation activationType() const {
return static_cast<FusedActivation>(GetField<int8_t>(4, 0));
}
const QuantizedParam *input1QuantizedParam() const {
return GetPointer<const QuantizedParam *>(6);
}
const QuantizedParam *input2QuantizedParam() const {
return GetPointer<const QuantizedParam *>(8);
}
const QuantizedParam *outputQuantizedParam() const {
return GetPointer<const QuantizedParam *>(10);
}
bool Verify(flatbuffers::Verifier &verifier) const {
return VerifyTableStart(verifier) &&
VerifyField<int8_t>(verifier, 4) &&
VerifyOffset(verifier, 6) &&
verifier.VerifyTable(input1QuantizedParam()) &&
VerifyOffset(verifier, 8) &&
verifier.VerifyTable(input2QuantizedParam()) &&
VerifyOffset(verifier, 10) &&
verifier.VerifyTable(outputQuantizedParam()) &&
verifier.EndTable();
}
QuantizedAddT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
void UnPackTo(QuantizedAddT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
static flatbuffers::Offset<QuantizedAdd> Pack(flatbuffers::FlatBufferBuilder &_fbb, const QuantizedAddT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
};
struct QuantizedAddBuilder {
flatbuffers::FlatBufferBuilder &fbb_;
flatbuffers::uoffset_t start_;
void add_activationType(FusedActivation activationType) {
fbb_.AddElement<int8_t>(4, static_cast<int8_t>(activationType), 0);
}
void add_input1QuantizedParam(flatbuffers::Offset<QuantizedParam> input1QuantizedParam) {
fbb_.AddOffset(6, input1QuantizedParam);
}
void add_input2QuantizedParam(flatbuffers::Offset<QuantizedParam> input2QuantizedParam) {
fbb_.AddOffset(8, input2QuantizedParam);
}
void add_outputQuantizedParam(flatbuffers::Offset<QuantizedParam> outputQuantizedParam) {
fbb_.AddOffset(10, outputQuantizedParam);
}
explicit QuantizedAddBuilder(flatbuffers::FlatBufferBuilder &_fbb)
: fbb_(_fbb) {
start_ = fbb_.StartTable();
}
QuantizedAddBuilder &operator=(const QuantizedAddBuilder &);
flatbuffers::Offset<QuantizedAdd> Finish() {
const auto end = fbb_.EndTable(start_);
auto o = flatbuffers::Offset<QuantizedAdd>(end);
return o;
}
};
inline flatbuffers::Offset<QuantizedAdd> CreateQuantizedAdd(
flatbuffers::FlatBufferBuilder &_fbb,
FusedActivation activationType = FusedActivation_kTfLiteActNone,
flatbuffers::Offset<QuantizedParam> input1QuantizedParam = 0,
flatbuffers::Offset<QuantizedParam> input2QuantizedParam = 0,
flatbuffers::Offset<QuantizedParam> outputQuantizedParam = 0) {
QuantizedAddBuilder builder_(_fbb);
builder_.add_outputQuantizedParam(outputQuantizedParam);
builder_.add_input2QuantizedParam(input2QuantizedParam);
builder_.add_input1QuantizedParam(input1QuantizedParam);
builder_.add_activationType(activationType);
return builder_.Finish();
}
flatbuffers::Offset<QuantizedAdd> CreateQuantizedAdd(flatbuffers::FlatBufferBuilder &_fbb, const QuantizedAddT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
struct DequantizeT : public flatbuffers::NativeTable {
typedef Dequantize TableType;
std::unique_ptr<QuantizedParamT> inputQuantizedParam;
QuantizeMode mode;
ModeFormat modelFormat;
DataType type;
DequantizeT()
: mode(QuantizeMode_MIN_COMBINED),
modelFormat(ModeFormat_TENSORFLOW),
type(DataType_DT_INVALID) {
}
};
struct Dequantize FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
typedef DequantizeT NativeTableType;
static const flatbuffers::TypeTable *MiniReflectTypeTable() {
return DequantizeTypeTable();
}
const QuantizedParam *inputQuantizedParam() const {
return GetPointer<const QuantizedParam *>(4);
}
QuantizeMode mode() const {
return static_cast<QuantizeMode>(GetField<int8_t>(6, 0));
}
ModeFormat modelFormat() const {
return static_cast<ModeFormat>(GetField<int8_t>(8, 0));
}
DataType type() const {
return static_cast<DataType>(GetField<int32_t>(10, 0));
}
bool Verify(flatbuffers::Verifier &verifier) const {
return VerifyTableStart(verifier) &&
VerifyOffset(verifier, 4) &&
verifier.VerifyTable(inputQuantizedParam()) &&
VerifyField<int8_t>(verifier, 6) &&
VerifyField<int8_t>(verifier, 8) &&
VerifyField<int32_t>(verifier, 10) &&
verifier.EndTable();
}
DequantizeT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
void UnPackTo(DequantizeT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
static flatbuffers::Offset<Dequantize> Pack(flatbuffers::FlatBufferBuilder &_fbb, const DequantizeT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
};
struct DequantizeBuilder {
flatbuffers::FlatBufferBuilder &fbb_;
flatbuffers::uoffset_t start_;
void add_inputQuantizedParam(flatbuffers::Offset<QuantizedParam> inputQuantizedParam) {
fbb_.AddOffset(4, inputQuantizedParam);
}
void add_mode(QuantizeMode mode) {
fbb_.AddElement<int8_t>(6, static_cast<int8_t>(mode), 0);
}
void add_modelFormat(ModeFormat modelFormat) {
fbb_.AddElement<int8_t>(8, static_cast<int8_t>(modelFormat), 0);
}
void add_type(DataType type) {
fbb_.AddElement<int32_t>(10, static_cast<int32_t>(type), 0);
}
explicit DequantizeBuilder(flatbuffers::FlatBufferBuilder &_fbb)
: fbb_(_fbb) {
start_ = fbb_.StartTable();
}
DequantizeBuilder &operator=(const DequantizeBuilder &);
flatbuffers::Offset<Dequantize> Finish() {
const auto end = fbb_.EndTable(start_);
auto o = flatbuffers::Offset<Dequantize>(end);
return o;
}
};
inline flatbuffers::Offset<Dequantize> CreateDequantize(
flatbuffers::FlatBufferBuilder &_fbb,
flatbuffers::Offset<QuantizedParam> inputQuantizedParam = 0,
QuantizeMode mode = QuantizeMode_MIN_COMBINED,
ModeFormat modelFormat = ModeFormat_TENSORFLOW,
DataType type = DataType_DT_INVALID) {
DequantizeBuilder builder_(_fbb);
builder_.add_type(type);
builder_.add_inputQuantizedParam(inputQuantizedParam);
builder_.add_modelFormat(modelFormat);
builder_.add_mode(mode);
return builder_.Finish();
}
flatbuffers::Offset<Dequantize> CreateDequantize(flatbuffers::FlatBufferBuilder &_fbb, const DequantizeT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
struct QuantizedAvgPoolT : public flatbuffers::NativeTable {
typedef QuantizedAvgPool TableType;
int32_t kernelX;
int32_t kernelY;
ModeFormat modelFormat;
int32_t outputActivationMax;
int32_t outputActivationMin;
PoolPadType padType;
int32_t padX;
int32_t padY;
int32_t strideX;
int32_t strideY;
DataType type;
QuantizedAvgPoolT()
: kernelX(0),
kernelY(0),
modelFormat(ModeFormat_TENSORFLOW),
outputActivationMax(0),
outputActivationMin(0),
padType(PoolPadType_CAFFE),
padX(0),
padY(0),
strideX(0),
strideY(0),
type(DataType_DT_INVALID) {
}
};
struct QuantizedAvgPool FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
typedef QuantizedAvgPoolT NativeTableType;
static const flatbuffers::TypeTable *MiniReflectTypeTable() {
return QuantizedAvgPoolTypeTable();
}
int32_t kernelX() const {
return GetField<int32_t>(4, 0);
}
int32_t kernelY() const {
return GetField<int32_t>(6, 0);
}
ModeFormat modelFormat() const {
return static_cast<ModeFormat>(GetField<int8_t>(8, 0));
}
int32_t outputActivationMax() const {
return GetField<int32_t>(10, 0);
}
int32_t outputActivationMin() const {
return GetField<int32_t>(12, 0);
}
PoolPadType padType() const {
return static_cast<PoolPadType>(GetField<int8_t>(14, 0));
}
int32_t padX() const {
return GetField<int32_t>(16, 0);
}
int32_t padY() const {
return GetField<int32_t>(18, 0);
}
int32_t strideX() const {
return GetField<int32_t>(20, 0);
}
int32_t strideY() const {
return GetField<int32_t>(22, 0);
}
DataType type() const {
return static_cast<DataType>(GetField<int32_t>(24, 0));
}
bool Verify(flatbuffers::Verifier &verifier) const {
return VerifyTableStart(verifier) &&
VerifyField<int32_t>(verifier, 4) &&
VerifyField<int32_t>(verifier, 6) &&
VerifyField<int8_t>(verifier, 8) &&
VerifyField<int32_t>(verifier, 10) &&
VerifyField<int32_t>(verifier, 12) &&
VerifyField<int8_t>(verifier, 14) &&
VerifyField<int32_t>(verifier, 16) &&
VerifyField<int32_t>(verifier, 18) &&
VerifyField<int32_t>(verifier, 20) &&
VerifyField<int32_t>(verifier, 22) &&
VerifyField<int32_t>(verifier, 24) &&
verifier.EndTable();
}
QuantizedAvgPoolT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
void UnPackTo(QuantizedAvgPoolT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
static flatbuffers::Offset<QuantizedAvgPool> Pack(flatbuffers::FlatBufferBuilder &_fbb, const QuantizedAvgPoolT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
};
struct QuantizedAvgPoolBuilder {
flatbuffers::FlatBufferBuilder &fbb_;
flatbuffers::uoffset_t start_;
void add_kernelX(int32_t kernelX) {
fbb_.AddElement<int32_t>(4, kernelX, 0);
}
void add_kernelY(int32_t kernelY) {
fbb_.AddElement<int32_t>(6, kernelY, 0);
}
void add_modelFormat(ModeFormat modelFormat) {
fbb_.AddElement<int8_t>(8, static_cast<int8_t>(modelFormat), 0);
}
void add_outputActivationMax(int32_t outputActivationMax) {
fbb_.AddElement<int32_t>(10, outputActivationMax, 0);
}
void add_outputActivationMin(int32_t outputActivationMin) {
fbb_.AddElement<int32_t>(12, outputActivationMin, 0);
}
void add_padType(PoolPadType padType) {
fbb_.AddElement<int8_t>(14, static_cast<int8_t>(padType), 0);
}
void add_padX(int32_t padX) {
fbb_.AddElement<int32_t>(16, padX, 0);
}
void add_padY(int32_t padY) {
fbb_.AddElement<int32_t>(18, padY, 0);
}
void add_strideX(int32_t strideX) {
fbb_.AddElement<int32_t>(20, strideX, 0);
}
void add_strideY(int32_t strideY) {
fbb_.AddElement<int32_t>(22, strideY, 0);
}
void add_type(DataType type) {
fbb_.AddElement<int32_t>(24, static_cast<int32_t>(type), 0);
}
explicit QuantizedAvgPoolBuilder(flatbuffers::FlatBufferBuilder &_fbb)
: fbb_(_fbb) {
start_ = fbb_.StartTable();
}
QuantizedAvgPoolBuilder &operator=(const QuantizedAvgPoolBuilder &);
flatbuffers::Offset<QuantizedAvgPool> Finish() {
const auto end = fbb_.EndTable(start_);
auto o = flatbuffers::Offset<QuantizedAvgPool>(end);
return o;
}
};
inline flatbuffers::Offset<QuantizedAvgPool> CreateQuantizedAvgPool(
flatbuffers::FlatBufferBuilder &_fbb,
int32_t kernelX = 0,
int32_t kernelY = 0,
ModeFormat modelFormat = ModeFormat_TENSORFLOW,
int32_t outputActivationMax = 0,
int32_t outputActivationMin = 0,
PoolPadType padType = PoolPadType_CAFFE,
int32_t padX = 0,
int32_t padY = 0,
int32_t strideX = 0,
int32_t strideY = 0,
DataType type = DataType_DT_INVALID) {
QuantizedAvgPoolBuilder builder_(_fbb);
builder_.add_type(type);
builder_.add_strideY(strideY);
builder_.add_strideX(strideX);
builder_.add_padY(padY);
builder_.add_padX(padX);
builder_.add_outputActivationMin(outputActivationMin);
builder_.add_outputActivationMax(outputActivationMax);
builder_.add_kernelY(kernelY);
builder_.add_kernelX(kernelX);
builder_.add_padType(padType);
builder_.add_modelFormat(modelFormat);
return builder_.Finish();
}
flatbuffers::Offset<QuantizedAvgPool> CreateQuantizedAvgPool(flatbuffers::FlatBufferBuilder &_fbb, const QuantizedAvgPoolT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
struct QuantizedBiasAddT : public flatbuffers::NativeTable {
typedef QuantizedBiasAdd TableType;
std::vector<int32_t> bias;
DataType inputType;
int32_t max;
int32_t min;
DataType outputType;
QuantizedBiasAddT()
: inputType(DataType_DT_INVALID),
max(0),
min(0),
outputType(DataType_DT_INVALID) {
}
};
struct QuantizedBiasAdd FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
typedef QuantizedBiasAddT NativeTableType;
static const flatbuffers::TypeTable *MiniReflectTypeTable() {
return QuantizedBiasAddTypeTable();
}
const flatbuffers::Vector<int32_t> *bias() const {
return GetPointer<const flatbuffers::Vector<int32_t> *>(4);
}
DataType inputType() const {
return static_cast<DataType>(GetField<int32_t>(6, 0));
}
int32_t max() const {
return GetField<int32_t>(8, 0);
}
int32_t min() const {
return GetField<int32_t>(10, 0);
}
DataType outputType() const {
return static_cast<DataType>(GetField<int32_t>(12, 0));
}
bool Verify(flatbuffers::Verifier &verifier) const {
return VerifyTableStart(verifier) &&
VerifyOffset(verifier, 4) &&
verifier.VerifyVector(bias()) &&
VerifyField<int32_t>(verifier, 6) &&
VerifyField<int32_t>(verifier, 8) &&
VerifyField<int32_t>(verifier, 10) &&
VerifyField<int32_t>(verifier, 12) &&
verifier.EndTable();
}
QuantizedBiasAddT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
void UnPackTo(QuantizedBiasAddT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
static flatbuffers::Offset<QuantizedBiasAdd> Pack(flatbuffers::FlatBufferBuilder &_fbb, const QuantizedBiasAddT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
};
struct QuantizedBiasAddBuilder {
flatbuffers::FlatBufferBuilder &fbb_;
flatbuffers::uoffset_t start_;
void add_bias(flatbuffers::Offset<flatbuffers::Vector<int32_t>> bias) {
fbb_.AddOffset(4, bias);
}
void add_inputType(DataType inputType) {
fbb_.AddElement<int32_t>(6, static_cast<int32_t>(inputType), 0);
}
void add_max(int32_t max) {
fbb_.AddElement<int32_t>(8, max, 0);
}
void add_min(int32_t min) {
fbb_.AddElement<int32_t>(10, min, 0);
}
void add_outputType(DataType outputType) {
fbb_.AddElement<int32_t>(12, static_cast<int32_t>(outputType), 0);
}
explicit QuantizedBiasAddBuilder(flatbuffers::FlatBufferBuilder &_fbb)
: fbb_(_fbb) {
start_ = fbb_.StartTable();
}
QuantizedBiasAddBuilder &operator=(const QuantizedBiasAddBuilder &);
flatbuffers::Offset<QuantizedBiasAdd> Finish() {
const auto end = fbb_.EndTable(start_);
auto o = flatbuffers::Offset<QuantizedBiasAdd>(end);
return o;
}
};
inline flatbuffers::Offset<QuantizedBiasAdd> CreateQuantizedBiasAdd(
flatbuffers::FlatBufferBuilder &_fbb,
flatbuffers::Offset<flatbuffers::Vector<int32_t>> bias = 0,
DataType inputType = DataType_DT_INVALID,
int32_t max = 0,
int32_t min = 0,
DataType outputType = DataType_DT_INVALID) {
QuantizedBiasAddBuilder builder_(_fbb);
builder_.add_outputType(outputType);
builder_.add_min(min);
builder_.add_max(max);
builder_.add_inputType(inputType);
builder_.add_bias(bias);
return builder_.Finish();
}
flatbuffers::Offset<QuantizedBiasAdd> CreateQuantizedBiasAdd(flatbuffers::FlatBufferBuilder &_fbb, const QuantizedBiasAddT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
struct QuantizedConcatT : public flatbuffers::NativeTable {
typedef QuantizedConcat TableType;
FusedActivation activationType;
int32_t axis;
std::vector<float> inputScale;
std::vector<int32_t> inputZeroPoint;
std::unique_ptr<QuantizedParamT> outputQuantizedParam;
QuantizedConcatT()
: activationType(FusedActivation_kTfLiteActNone),
axis(0) {
}
};
struct QuantizedConcat FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
typedef QuantizedConcatT NativeTableType;
static const flatbuffers::TypeTable *MiniReflectTypeTable() {
return QuantizedConcatTypeTable();
}
FusedActivation activationType() const {
return static_cast<FusedActivation>(GetField<int8_t>(4, 0));
}
int32_t axis() const {
return GetField<int32_t>(6, 0);
}
const flatbuffers::Vector<float> *inputScale() const {
return GetPointer<const flatbuffers::Vector<float> *>(8);
}
const flatbuffers::Vector<int32_t> *inputZeroPoint() const {
return GetPointer<const flatbuffers::Vector<int32_t> *>(10);
}
const QuantizedParam *outputQuantizedParam() const {
return GetPointer<const QuantizedParam *>(12);
}
bool Verify(flatbuffers::Verifier &verifier) const {
return VerifyTableStart(verifier) &&
VerifyField<int8_t>(verifier, 4) &&
VerifyField<int32_t>(verifier, 6) &&
VerifyOffset(verifier, 8) &&
verifier.VerifyVector(inputScale()) &&
VerifyOffset(verifier, 10) &&
verifier.VerifyVector(inputZeroPoint()) &&
VerifyOffset(verifier, 12) &&
verifier.VerifyTable(outputQuantizedParam()) &&
verifier.EndTable();
}
QuantizedConcatT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
void UnPackTo(QuantizedConcatT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
static flatbuffers::Offset<QuantizedConcat> Pack(flatbuffers::FlatBufferBuilder &_fbb, const QuantizedConcatT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
};
struct QuantizedConcatBuilder {
flatbuffers::FlatBufferBuilder &fbb_;
flatbuffers::uoffset_t start_;
void add_activationType(FusedActivation activationType) {
fbb_.AddElement<int8_t>(4, static_cast<int8_t>(activationType), 0);
}
void add_axis(int32_t axis) {
fbb_.AddElement<int32_t>(6, axis, 0);
}
void add_inputScale(flatbuffers::Offset<flatbuffers::Vector<float>> inputScale) {
fbb_.AddOffset(8, inputScale);
}
void add_inputZeroPoint(flatbuffers::Offset<flatbuffers::Vector<int32_t>> inputZeroPoint) {
fbb_.AddOffset(10, inputZeroPoint);
}
void add_outputQuantizedParam(flatbuffers::Offset<QuantizedParam> outputQuantizedParam) {
fbb_.AddOffset(12, outputQuantizedParam);
}
explicit QuantizedConcatBuilder(flatbuffers::FlatBufferBuilder &_fbb)
: fbb_(_fbb) {
start_ = fbb_.StartTable();
}
QuantizedConcatBuilder &operator=(const QuantizedConcatBuilder &);
flatbuffers::Offset<QuantizedConcat> Finish() {
const auto end = fbb_.EndTable(start_);
auto o = flatbuffers::Offset<QuantizedConcat>(end);
return o;
}
};
inline flatbuffers::Offset<QuantizedConcat> CreateQuantizedConcat(
flatbuffers::FlatBufferBuilder &_fbb,
FusedActivation activationType = FusedActivation_kTfLiteActNone,
int32_t axis = 0,
flatbuffers::Offset<flatbuffers::Vector<float>> inputScale = 0,
flatbuffers::Offset<flatbuffers::Vector<int32_t>> inputZeroPoint = 0,
flatbuffers::Offset<QuantizedParam> outputQuantizedParam = 0) {
QuantizedConcatBuilder builder_(_fbb);
builder_.add_outputQuantizedParam(outputQuantizedParam);
builder_.add_inputZeroPoint(inputZeroPoint);
builder_.add_inputScale(inputScale);
builder_.add_axis(axis);
builder_.add_activationType(activationType);
return builder_.Finish();
}
flatbuffers::Offset<QuantizedConcat> CreateQuantizedConcat(flatbuffers::FlatBufferBuilder &_fbb, const QuantizedConcatT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
struct QuantizedLogisticT : public flatbuffers::NativeTable {
typedef QuantizedLogistic TableType;
std::unique_ptr<QuantizedParamT> inputQuantizedParam;
std::unique_ptr<QuantizedParamT> outputQuantizedParam;
QuantizedLogisticT() {
}
};
struct QuantizedLogistic FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
typedef QuantizedLogisticT NativeTableType;
static const flatbuffers::TypeTable *MiniReflectTypeTable() {
return QuantizedLogisticTypeTable();
}
const QuantizedParam *inputQuantizedParam() const {
return GetPointer<const QuantizedParam *>(4);
}
const QuantizedParam *outputQuantizedParam() const {
return GetPointer<const QuantizedParam *>(6);
}
bool Verify(flatbuffers::Verifier &verifier) const {
return VerifyTableStart(verifier) &&
VerifyOffset(verifier, 4) &&
verifier.VerifyTable(inputQuantizedParam()) &&
VerifyOffset(verifier, 6) &&
verifier.VerifyTable(outputQuantizedParam()) &&
verifier.EndTable();
}
QuantizedLogisticT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
void UnPackTo(QuantizedLogisticT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
static flatbuffers::Offset<QuantizedLogistic> Pack(flatbuffers::FlatBufferBuilder &_fbb, const QuantizedLogisticT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
};
struct QuantizedLogisticBuilder {
flatbuffers::FlatBufferBuilder &fbb_;
flatbuffers::uoffset_t start_;
void add_inputQuantizedParam(flatbuffers::Offset<QuantizedParam> inputQuantizedParam) {
fbb_.AddOffset(4, inputQuantizedParam);
}
void add_outputQuantizedParam(flatbuffers::Offset<QuantizedParam> outputQuantizedParam) {
fbb_.AddOffset(6, outputQuantizedParam);
}
explicit QuantizedLogisticBuilder(flatbuffers::FlatBufferBuilder &_fbb)
: fbb_(_fbb) {
start_ = fbb_.StartTable();
}
QuantizedLogisticBuilder &operator=(const QuantizedLogisticBuilder &);
flatbuffers::Offset<QuantizedLogistic> Finish() {
const auto end = fbb_.EndTable(start_);
auto o = flatbuffers::Offset<QuantizedLogistic>(end);
return o;
}
};
inline flatbuffers::Offset<QuantizedLogistic> CreateQuantizedLogistic(
flatbuffers::FlatBufferBuilder &_fbb,
flatbuffers::Offset<QuantizedParam> inputQuantizedParam = 0,
flatbuffers::Offset<QuantizedParam> outputQuantizedParam = 0) {
QuantizedLogisticBuilder builder_(_fbb);
builder_.add_outputQuantizedParam(outputQuantizedParam);
builder_.add_inputQuantizedParam(inputQuantizedParam);
return builder_.Finish();
}
flatbuffers::Offset<QuantizedLogistic> CreateQuantizedLogistic(flatbuffers::FlatBufferBuilder &_fbb, const QuantizedLogisticT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
struct QuantizedMatMulT : public flatbuffers::NativeTable {
typedef QuantizedMatMul TableType;
bool transposeA;
bool transposeB;
QuantizedMatMulT()
: transposeA(false),
transposeB(false) {
}
};
struct QuantizedMatMul FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
typedef QuantizedMatMulT NativeTableType;
static const flatbuffers::TypeTable *MiniReflectTypeTable() {
return QuantizedMatMulTypeTable();
}
bool transposeA() const {
return GetField<uint8_t>(4, 0) != 0;
}
bool transposeB() const {
return GetField<uint8_t>(6, 0) != 0;
}
bool Verify(flatbuffers::Verifier &verifier) const {
return VerifyTableStart(verifier) &&
VerifyField<uint8_t>(verifier, 4) &&
VerifyField<uint8_t>(verifier, 6) &&
verifier.EndTable();
}
QuantizedMatMulT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
void UnPackTo(QuantizedMatMulT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
static flatbuffers::Offset<QuantizedMatMul> Pack(flatbuffers::FlatBufferBuilder &_fbb, const QuantizedMatMulT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
};
struct QuantizedMatMulBuilder {
flatbuffers::FlatBufferBuilder &fbb_;
flatbuffers::uoffset_t start_;
void add_transposeA(bool transposeA) {
fbb_.AddElement<uint8_t>(4, static_cast<uint8_t>(transposeA), 0);
}
void add_transposeB(bool transposeB) {
fbb_.AddElement<uint8_t>(6, static_cast<uint8_t>(transposeB), 0);
}
explicit QuantizedMatMulBuilder(flatbuffers::FlatBufferBuilder &_fbb)
: fbb_(_fbb) {
start_ = fbb_.StartTable();
}
QuantizedMatMulBuilder &operator=(const QuantizedMatMulBuilder &);
flatbuffers::Offset<QuantizedMatMul> Finish() {
const auto end = fbb_.EndTable(start_);
auto o = flatbuffers::Offset<QuantizedMatMul>(end);
return o;
}
};
inline flatbuffers::Offset<QuantizedMatMul> CreateQuantizedMatMul(
flatbuffers::FlatBufferBuilder &_fbb,
bool transposeA = false,
bool transposeB = false) {
QuantizedMatMulBuilder builder_(_fbb);
builder_.add_transposeB(transposeB);
builder_.add_transposeA(transposeA);
return builder_.Finish();
}
flatbuffers::Offset<QuantizedMatMul> CreateQuantizedMatMul(flatbuffers::FlatBufferBuilder &_fbb, const QuantizedMatMulT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
struct QuantizedMaxPoolT : public flatbuffers::NativeTable {
typedef QuantizedMaxPool TableType;
int32_t kernelX;
int32_t kernelY;
ModeFormat modelFormat;
int32_t outputActivationMax;
int32_t outputActivationMin;
PoolPadType padType;
int32_t padX;
int32_t padY;
int32_t strideX;
int32_t strideY;
DataType type;
QuantizedMaxPoolT()
: kernelX(0),
kernelY(0),
modelFormat(ModeFormat_TENSORFLOW),
outputActivationMax(0),
outputActivationMin(0),
padType(PoolPadType_CAFFE),
padX(0),
padY(0),
strideX(0),
strideY(0),
type(DataType_DT_INVALID) {
}
};
struct QuantizedMaxPool FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
typedef QuantizedMaxPoolT NativeTableType;
static const flatbuffers::TypeTable *MiniReflectTypeTable() {
return QuantizedMaxPoolTypeTable();
}
int32_t kernelX() const {
return GetField<int32_t>(4, 0);