-
Notifications
You must be signed in to change notification settings - Fork 118
/
Copy pathschema_generated.py
6497 lines (5313 loc) · 236 KB
/
schema_generated.py
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
# namespace: tflite
import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()
class TensorType(object):
FLOAT32 = 0
FLOAT16 = 1
INT32 = 2
UINT8 = 3
INT64 = 4
STRING = 5
BOOL = 6
INT16 = 7
COMPLEX64 = 8
INT8 = 9
FLOAT64 = 10
COMPLEX128 = 11
UINT64 = 12
RESOURCE = 13
VARIANT = 14
UINT32 = 15
UINT16 = 16
INT4 = 17
class QuantizationDetails(object):
NONE = 0
CustomQuantization = 1
class DimensionType(object):
DENSE = 0
SPARSE_CSR = 1
class SparseIndexVector(object):
NONE = 0
Int32Vector = 1
Uint16Vector = 2
Uint8Vector = 3
class BuiltinOperator(object):
ADD = 0
AVERAGE_POOL_2D = 1
CONCATENATION = 2
CONV_2D = 3
DEPTHWISE_CONV_2D = 4
DEPTH_TO_SPACE = 5
DEQUANTIZE = 6
EMBEDDING_LOOKUP = 7
FLOOR = 8
FULLY_CONNECTED = 9
HASHTABLE_LOOKUP = 10
L2_NORMALIZATION = 11
L2_POOL_2D = 12
LOCAL_RESPONSE_NORMALIZATION = 13
LOGISTIC = 14
LSH_PROJECTION = 15
LSTM = 16
MAX_POOL_2D = 17
MUL = 18
RELU = 19
RELU_N1_TO_1 = 20
RELU6 = 21
RESHAPE = 22
RESIZE_BILINEAR = 23
RNN = 24
SOFTMAX = 25
SPACE_TO_DEPTH = 26
SVDF = 27
TANH = 28
CONCAT_EMBEDDINGS = 29
SKIP_GRAM = 30
CALL = 31
CUSTOM = 32
EMBEDDING_LOOKUP_SPARSE = 33
PAD = 34
UNIDIRECTIONAL_SEQUENCE_RNN = 35
GATHER = 36
BATCH_TO_SPACE_ND = 37
SPACE_TO_BATCH_ND = 38
TRANSPOSE = 39
MEAN = 40
SUB = 41
DIV = 42
SQUEEZE = 43
UNIDIRECTIONAL_SEQUENCE_LSTM = 44
STRIDED_SLICE = 45
BIDIRECTIONAL_SEQUENCE_RNN = 46
EXP = 47
TOPK_V2 = 48
SPLIT = 49
LOG_SOFTMAX = 50
DELEGATE = 51
BIDIRECTIONAL_SEQUENCE_LSTM = 52
CAST = 53
PRELU = 54
MAXIMUM = 55
ARG_MAX = 56
MINIMUM = 57
LESS = 58
NEG = 59
PADV2 = 60
GREATER = 61
GREATER_EQUAL = 62
LESS_EQUAL = 63
SELECT = 64
SLICE = 65
SIN = 66
TRANSPOSE_CONV = 67
SPARSE_TO_DENSE = 68
TILE = 69
EXPAND_DIMS = 70
EQUAL = 71
NOT_EQUAL = 72
LOG = 73
SUM = 74
SQRT = 75
RSQRT = 76
SHAPE = 77
POW = 78
ARG_MIN = 79
FAKE_QUANT = 80
REDUCE_PROD = 81
REDUCE_MAX = 82
PACK = 83
LOGICAL_OR = 84
ONE_HOT = 85
LOGICAL_AND = 86
LOGICAL_NOT = 87
UNPACK = 88
REDUCE_MIN = 89
FLOOR_DIV = 90
REDUCE_ANY = 91
SQUARE = 92
ZEROS_LIKE = 93
FILL = 94
FLOOR_MOD = 95
RANGE = 96
RESIZE_NEAREST_NEIGHBOR = 97
LEAKY_RELU = 98
SQUARED_DIFFERENCE = 99
MIRROR_PAD = 100
ABS = 101
SPLIT_V = 102
UNIQUE = 103
CEIL = 104
REVERSE_V2 = 105
ADD_N = 106
GATHER_ND = 107
COS = 108
WHERE = 109
RANK = 110
ELU = 111
REVERSE_SEQUENCE = 112
MATRIX_DIAG = 113
QUANTIZE = 114
MATRIX_SET_DIAG = 115
ROUND = 116
HARD_SWISH = 117
IF = 118
WHILE = 119
NON_MAX_SUPPRESSION_V4 = 120
NON_MAX_SUPPRESSION_V5 = 121
SCATTER_ND = 122
SELECT_V2 = 123
DENSIFY = 124
SEGMENT_SUM = 125
BATCH_MATMUL = 126
PLACEHOLDER_FOR_GREATER_OP_CODES = 127
CUMSUM = 128
CALL_ONCE = 129
BROADCAST_TO = 130
RFFT2D = 131
CONV_3D = 132
IMAG = 133
REAL = 134
COMPLEX_ABS = 135
HASHTABLE = 136
HASHTABLE_FIND = 137
HASHTABLE_IMPORT = 138
HASHTABLE_SIZE = 139
REDUCE_ALL = 140
CONV_3D_TRANSPOSE = 141
VAR_HANDLE = 142
READ_VARIABLE = 143
ASSIGN_VARIABLE = 144
BROADCAST_ARGS = 145
RANDOM_STANDARD_NORMAL = 146
BUCKETIZE = 147
RANDOM_UNIFORM = 148
MULTINOMIAL = 149
GELU = 150
DYNAMIC_UPDATE_SLICE = 151
RELU_0_TO_1 = 152
UNSORTED_SEGMENT_PROD = 153
UNSORTED_SEGMENT_MAX = 154
UNSORTED_SEGMENT_SUM = 155
ATAN2 = 156
UNSORTED_SEGMENT_MIN = 157
SIGN = 158
class BuiltinOptions(object):
NONE = 0
Conv2DOptions = 1
DepthwiseConv2DOptions = 2
ConcatEmbeddingsOptions = 3
LSHProjectionOptions = 4
Pool2DOptions = 5
SVDFOptions = 6
RNNOptions = 7
FullyConnectedOptions = 8
SoftmaxOptions = 9
ConcatenationOptions = 10
AddOptions = 11
L2NormOptions = 12
LocalResponseNormalizationOptions = 13
LSTMOptions = 14
ResizeBilinearOptions = 15
CallOptions = 16
ReshapeOptions = 17
SkipGramOptions = 18
SpaceToDepthOptions = 19
EmbeddingLookupSparseOptions = 20
MulOptions = 21
PadOptions = 22
GatherOptions = 23
BatchToSpaceNDOptions = 24
SpaceToBatchNDOptions = 25
TransposeOptions = 26
ReducerOptions = 27
SubOptions = 28
DivOptions = 29
SqueezeOptions = 30
SequenceRNNOptions = 31
StridedSliceOptions = 32
ExpOptions = 33
TopKV2Options = 34
SplitOptions = 35
LogSoftmaxOptions = 36
CastOptions = 37
DequantizeOptions = 38
MaximumMinimumOptions = 39
ArgMaxOptions = 40
LessOptions = 41
NegOptions = 42
PadV2Options = 43
GreaterOptions = 44
GreaterEqualOptions = 45
LessEqualOptions = 46
SelectOptions = 47
SliceOptions = 48
TransposeConvOptions = 49
SparseToDenseOptions = 50
TileOptions = 51
ExpandDimsOptions = 52
EqualOptions = 53
NotEqualOptions = 54
ShapeOptions = 55
PowOptions = 56
ArgMinOptions = 57
FakeQuantOptions = 58
PackOptions = 59
LogicalOrOptions = 60
OneHotOptions = 61
LogicalAndOptions = 62
LogicalNotOptions = 63
UnpackOptions = 64
FloorDivOptions = 65
SquareOptions = 66
ZerosLikeOptions = 67
FillOptions = 68
BidirectionalSequenceLSTMOptions = 69
BidirectionalSequenceRNNOptions = 70
UnidirectionalSequenceLSTMOptions = 71
FloorModOptions = 72
RangeOptions = 73
ResizeNearestNeighborOptions = 74
LeakyReluOptions = 75
SquaredDifferenceOptions = 76
MirrorPadOptions = 77
AbsOptions = 78
SplitVOptions = 79
UniqueOptions = 80
ReverseV2Options = 81
AddNOptions = 82
GatherNdOptions = 83
CosOptions = 84
WhereOptions = 85
RankOptions = 86
ReverseSequenceOptions = 87
MatrixDiagOptions = 88
QuantizeOptions = 89
MatrixSetDiagOptions = 90
HardSwishOptions = 91
IfOptions = 92
WhileOptions = 93
DepthToSpaceOptions = 94
NonMaxSuppressionV4Options = 95
NonMaxSuppressionV5Options = 96
ScatterNdOptions = 97
SelectV2Options = 98
DensifyOptions = 99
SegmentSumOptions = 100
BatchMatMulOptions = 101
CumsumOptions = 102
CallOnceOptions = 103
BroadcastToOptions = 104
Rfft2dOptions = 105
Conv3DOptions = 106
HashtableOptions = 107
HashtableFindOptions = 108
HashtableImportOptions = 109
HashtableSizeOptions = 110
VarHandleOptions = 111
ReadVariableOptions = 112
AssignVariableOptions = 113
RandomOptions = 114
BucketizeOptions = 115
GeluOptions = 116
DynamicUpdateSliceOptions = 117
UnsortedSegmentProdOptions = 118
UnsortedSegmentMaxOptions = 119
UnsortedSegmentMinOptions = 120
UnsortedSegmentSumOptions = 121
ATan2Options = 122
SignOptions = 123
class Padding(object):
SAME = 0
VALID = 1
class ActivationFunctionType(object):
NONE = 0
RELU = 1
RELU_N1_TO_1 = 2
RELU6 = 3
TANH = 4
SIGN_BIT = 5
class LSHProjectionType(object):
UNKNOWN = 0
SPARSE = 1
DENSE = 2
class FullyConnectedOptionsWeightsFormat(object):
DEFAULT = 0
SHUFFLED4x16INT8 = 1
class LSTMKernelType(object):
FULL = 0
BASIC = 1
class CombinerType(object):
SUM = 0
MEAN = 1
SQRTN = 2
class MirrorPadMode(object):
REFLECT = 0
SYMMETRIC = 1
class CustomOptionsFormat(object):
FLEXBUFFERS = 0
class CustomQuantization(object):
__slots__ = ['_tab']
@classmethod
def GetRootAs(cls, buf, offset=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = CustomQuantization()
x.Init(buf, n + offset)
return x
@classmethod
def GetRootAsCustomQuantization(cls, buf, offset=0):
"""This method is deprecated. Please switch to GetRootAs."""
return cls.GetRootAs(buf, offset)
@classmethod
def CustomQuantizationBufferHasIdentifier(cls, buf, offset, size_prefixed=False):
return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed)
# CustomQuantization
def Init(self, buf, pos):
self._tab = flatbuffers.table.Table(buf, pos)
# CustomQuantization
def Custom(self, j):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
a = self._tab.Vector(o)
return self._tab.Get(flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1))
return 0
# CustomQuantization
def CustomAsNumpy(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o)
return 0
# CustomQuantization
def CustomLength(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
return self._tab.VectorLen(o)
return 0
# CustomQuantization
def CustomIsNone(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
return o == 0
def CustomQuantizationStart(builder): builder.StartObject(1)
def CustomQuantizationAddCustom(builder, custom): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(custom), 0)
def CustomQuantizationStartCustomVector(builder, numElems): return builder.StartVector(1, numElems, 1)
def CustomQuantizationEnd(builder): return builder.EndObject()
class QuantizationParameters(object):
__slots__ = ['_tab']
@classmethod
def GetRootAs(cls, buf, offset=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = QuantizationParameters()
x.Init(buf, n + offset)
return x
@classmethod
def GetRootAsQuantizationParameters(cls, buf, offset=0):
"""This method is deprecated. Please switch to GetRootAs."""
return cls.GetRootAs(buf, offset)
@classmethod
def QuantizationParametersBufferHasIdentifier(cls, buf, offset, size_prefixed=False):
return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed)
# QuantizationParameters
def Init(self, buf, pos):
self._tab = flatbuffers.table.Table(buf, pos)
# QuantizationParameters
def Min(self, j):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
a = self._tab.Vector(o)
return self._tab.Get(flatbuffers.number_types.Float32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
return 0
# QuantizationParameters
def MinAsNumpy(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Float32Flags, o)
return 0
# QuantizationParameters
def MinLength(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
return self._tab.VectorLen(o)
return 0
# QuantizationParameters
def MinIsNone(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
return o == 0
# QuantizationParameters
def Max(self, j):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
if o != 0:
a = self._tab.Vector(o)
return self._tab.Get(flatbuffers.number_types.Float32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
return 0
# QuantizationParameters
def MaxAsNumpy(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
if o != 0:
return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Float32Flags, o)
return 0
# QuantizationParameters
def MaxLength(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
if o != 0:
return self._tab.VectorLen(o)
return 0
# QuantizationParameters
def MaxIsNone(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
return o == 0
# QuantizationParameters
def Scale(self, j):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
if o != 0:
a = self._tab.Vector(o)
return self._tab.Get(flatbuffers.number_types.Float32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
return 0
# QuantizationParameters
def ScaleAsNumpy(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
if o != 0:
return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Float32Flags, o)
return 0
# QuantizationParameters
def ScaleLength(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
if o != 0:
return self._tab.VectorLen(o)
return 0
# QuantizationParameters
def ScaleIsNone(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
return o == 0
# QuantizationParameters
def ZeroPoint(self, j):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
if o != 0:
a = self._tab.Vector(o)
return self._tab.Get(flatbuffers.number_types.Int64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8))
return 0
# QuantizationParameters
def ZeroPointAsNumpy(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
if o != 0:
return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int64Flags, o)
return 0
# QuantizationParameters
def ZeroPointLength(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
if o != 0:
return self._tab.VectorLen(o)
return 0
# QuantizationParameters
def ZeroPointIsNone(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
return o == 0
# QuantizationParameters
def DetailsType(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
return 0
# QuantizationParameters
def Details(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
if o != 0:
from flatbuffers.table import Table
obj = Table(bytearray(), 0)
self._tab.Union(obj, o)
return obj
return None
# QuantizationParameters
def QuantizedDimension(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
return 0
def QuantizationParametersStart(builder): builder.StartObject(7)
def QuantizationParametersAddMin(builder, min): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(min), 0)
def QuantizationParametersStartMinVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def QuantizationParametersAddMax(builder, max): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(max), 0)
def QuantizationParametersStartMaxVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def QuantizationParametersAddScale(builder, scale): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(scale), 0)
def QuantizationParametersStartScaleVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def QuantizationParametersAddZeroPoint(builder, zeroPoint): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(zeroPoint), 0)
def QuantizationParametersStartZeroPointVector(builder, numElems): return builder.StartVector(8, numElems, 8)
def QuantizationParametersAddDetailsType(builder, detailsType): builder.PrependUint8Slot(4, detailsType, 0)
def QuantizationParametersAddDetails(builder, details): builder.PrependUOffsetTRelativeSlot(5, flatbuffers.number_types.UOffsetTFlags.py_type(details), 0)
def QuantizationParametersAddQuantizedDimension(builder, quantizedDimension): builder.PrependInt32Slot(6, quantizedDimension, 0)
def QuantizationParametersEnd(builder): return builder.EndObject()
class Int32Vector(object):
__slots__ = ['_tab']
@classmethod
def GetRootAs(cls, buf, offset=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = Int32Vector()
x.Init(buf, n + offset)
return x
@classmethod
def GetRootAsInt32Vector(cls, buf, offset=0):
"""This method is deprecated. Please switch to GetRootAs."""
return cls.GetRootAs(buf, offset)
@classmethod
def Int32VectorBufferHasIdentifier(cls, buf, offset, size_prefixed=False):
return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed)
# Int32Vector
def Init(self, buf, pos):
self._tab = flatbuffers.table.Table(buf, pos)
# Int32Vector
def Values(self, j):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
a = self._tab.Vector(o)
return self._tab.Get(flatbuffers.number_types.Int32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
return 0
# Int32Vector
def ValuesAsNumpy(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int32Flags, o)
return 0
# Int32Vector
def ValuesLength(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
return self._tab.VectorLen(o)
return 0
# Int32Vector
def ValuesIsNone(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
return o == 0
def Int32VectorStart(builder): builder.StartObject(1)
def Int32VectorAddValues(builder, values): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(values), 0)
def Int32VectorStartValuesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def Int32VectorEnd(builder): return builder.EndObject()
class Uint16Vector(object):
__slots__ = ['_tab']
@classmethod
def GetRootAs(cls, buf, offset=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = Uint16Vector()
x.Init(buf, n + offset)
return x
@classmethod
def GetRootAsUint16Vector(cls, buf, offset=0):
"""This method is deprecated. Please switch to GetRootAs."""
return cls.GetRootAs(buf, offset)
@classmethod
def Uint16VectorBufferHasIdentifier(cls, buf, offset, size_prefixed=False):
return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed)
# Uint16Vector
def Init(self, buf, pos):
self._tab = flatbuffers.table.Table(buf, pos)
# Uint16Vector
def Values(self, j):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
a = self._tab.Vector(o)
return self._tab.Get(flatbuffers.number_types.Uint16Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 2))
return 0
# Uint16Vector
def ValuesAsNumpy(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint16Flags, o)
return 0
# Uint16Vector
def ValuesLength(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
return self._tab.VectorLen(o)
return 0
# Uint16Vector
def ValuesIsNone(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
return o == 0
def Uint16VectorStart(builder): builder.StartObject(1)
def Uint16VectorAddValues(builder, values): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(values), 0)
def Uint16VectorStartValuesVector(builder, numElems): return builder.StartVector(2, numElems, 2)
def Uint16VectorEnd(builder): return builder.EndObject()
class Uint8Vector(object):
__slots__ = ['_tab']
@classmethod
def GetRootAs(cls, buf, offset=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = Uint8Vector()
x.Init(buf, n + offset)
return x
@classmethod
def GetRootAsUint8Vector(cls, buf, offset=0):
"""This method is deprecated. Please switch to GetRootAs."""
return cls.GetRootAs(buf, offset)
@classmethod
def Uint8VectorBufferHasIdentifier(cls, buf, offset, size_prefixed=False):
return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed)
# Uint8Vector
def Init(self, buf, pos):
self._tab = flatbuffers.table.Table(buf, pos)
# Uint8Vector
def Values(self, j):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
a = self._tab.Vector(o)
return self._tab.Get(flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1))
return 0
# Uint8Vector
def ValuesAsNumpy(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o)
return 0
# Uint8Vector
def ValuesLength(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
return self._tab.VectorLen(o)
return 0
# Uint8Vector
def ValuesIsNone(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
return o == 0
def Uint8VectorStart(builder): builder.StartObject(1)
def Uint8VectorAddValues(builder, values): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(values), 0)
def Uint8VectorStartValuesVector(builder, numElems): return builder.StartVector(1, numElems, 1)
def Uint8VectorEnd(builder): return builder.EndObject()
class DimensionMetadata(object):
__slots__ = ['_tab']
@classmethod
def GetRootAs(cls, buf, offset=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = DimensionMetadata()
x.Init(buf, n + offset)
return x
@classmethod
def GetRootAsDimensionMetadata(cls, buf, offset=0):
"""This method is deprecated. Please switch to GetRootAs."""
return cls.GetRootAs(buf, offset)
@classmethod
def DimensionMetadataBufferHasIdentifier(cls, buf, offset, size_prefixed=False):
return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed)
# DimensionMetadata
def Init(self, buf, pos):
self._tab = flatbuffers.table.Table(buf, pos)
# DimensionMetadata
def Format(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
return 0
# DimensionMetadata
def DenseSize(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
return 0
# DimensionMetadata
def ArraySegmentsType(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
return 0
# DimensionMetadata
def ArraySegments(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
if o != 0:
from flatbuffers.table import Table
obj = Table(bytearray(), 0)
self._tab.Union(obj, o)
return obj
return None
# DimensionMetadata
def ArrayIndicesType(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
return 0
# DimensionMetadata
def ArrayIndices(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
if o != 0:
from flatbuffers.table import Table
obj = Table(bytearray(), 0)
self._tab.Union(obj, o)
return obj
return None
def DimensionMetadataStart(builder): builder.StartObject(6)
def DimensionMetadataAddFormat(builder, format): builder.PrependInt8Slot(0, format, 0)
def DimensionMetadataAddDenseSize(builder, denseSize): builder.PrependInt32Slot(1, denseSize, 0)
def DimensionMetadataAddArraySegmentsType(builder, arraySegmentsType): builder.PrependUint8Slot(2, arraySegmentsType, 0)
def DimensionMetadataAddArraySegments(builder, arraySegments): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(arraySegments), 0)
def DimensionMetadataAddArrayIndicesType(builder, arrayIndicesType): builder.PrependUint8Slot(4, arrayIndicesType, 0)
def DimensionMetadataAddArrayIndices(builder, arrayIndices): builder.PrependUOffsetTRelativeSlot(5, flatbuffers.number_types.UOffsetTFlags.py_type(arrayIndices), 0)
def DimensionMetadataEnd(builder): return builder.EndObject()
class SparsityParameters(object):
__slots__ = ['_tab']
@classmethod
def GetRootAs(cls, buf, offset=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = SparsityParameters()
x.Init(buf, n + offset)
return x
@classmethod
def GetRootAsSparsityParameters(cls, buf, offset=0):
"""This method is deprecated. Please switch to GetRootAs."""
return cls.GetRootAs(buf, offset)
@classmethod
def SparsityParametersBufferHasIdentifier(cls, buf, offset, size_prefixed=False):
return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed)
# SparsityParameters
def Init(self, buf, pos):
self._tab = flatbuffers.table.Table(buf, pos)
# SparsityParameters
def TraversalOrder(self, j):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
a = self._tab.Vector(o)
return self._tab.Get(flatbuffers.number_types.Int32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
return 0
# SparsityParameters
def TraversalOrderAsNumpy(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int32Flags, o)
return 0
# SparsityParameters
def TraversalOrderLength(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
return self._tab.VectorLen(o)
return 0
# SparsityParameters
def TraversalOrderIsNone(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
return o == 0
# SparsityParameters
def BlockMap(self, j):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
if o != 0:
a = self._tab.Vector(o)
return self._tab.Get(flatbuffers.number_types.Int32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
return 0
# SparsityParameters
def BlockMapAsNumpy(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
if o != 0:
return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int32Flags, o)
return 0
# SparsityParameters
def BlockMapLength(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
if o != 0:
return self._tab.VectorLen(o)
return 0
# SparsityParameters
def BlockMapIsNone(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
return o == 0
# SparsityParameters
def DimMetadata(self, j):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
if o != 0:
x = self._tab.Vector(o)
x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
x = self._tab.Indirect(x)
obj = DimensionMetadata()
obj.Init(self._tab.Bytes, x)
return obj
return None
# SparsityParameters
def DimMetadataLength(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
if o != 0:
return self._tab.VectorLen(o)
return 0
# SparsityParameters
def DimMetadataIsNone(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
return o == 0
def SparsityParametersStart(builder): builder.StartObject(3)
def SparsityParametersAddTraversalOrder(builder, traversalOrder): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(traversalOrder), 0)
def SparsityParametersStartTraversalOrderVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def SparsityParametersAddBlockMap(builder, blockMap): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(blockMap), 0)
def SparsityParametersStartBlockMapVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def SparsityParametersAddDimMetadata(builder, dimMetadata): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(dimMetadata), 0)
def SparsityParametersStartDimMetadataVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def SparsityParametersEnd(builder): return builder.EndObject()
class VariantSubType(object):
__slots__ = ['_tab']
@classmethod
def GetRootAs(cls, buf, offset=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = VariantSubType()
x.Init(buf, n + offset)
return x
@classmethod
def GetRootAsVariantSubType(cls, buf, offset=0):
"""This method is deprecated. Please switch to GetRootAs."""
return cls.GetRootAs(buf, offset)
@classmethod
def VariantSubTypeBufferHasIdentifier(cls, buf, offset, size_prefixed=False):
return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed)
# VariantSubType
def Init(self, buf, pos):
self._tab = flatbuffers.table.Table(buf, pos)
# VariantSubType
def Shape(self, j):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
a = self._tab.Vector(o)
return self._tab.Get(flatbuffers.number_types.Int32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
return 0
# VariantSubType
def ShapeAsNumpy(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int32Flags, o)
return 0
# VariantSubType
def ShapeLength(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0: