forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mobile_bytecode_generated.h
2599 lines (2411 loc) · 96.3 KB
/
mobile_bytecode_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_MOBILEBYTECODE_TORCH_JIT_MOBILE_SERIALIZATION_H_
#define FLATBUFFERS_GENERATED_MOBILEBYTECODE_TORCH_JIT_MOBILE_SERIALIZATION_H_
#include "flatbuffers/flatbuffers.h"
// Ensure the included flatbuffers.h is the same version as when this file was
// generated, otherwise it may not be compatible.
static_assert(FLATBUFFERS_VERSION_MAJOR == 23 &&
FLATBUFFERS_VERSION_MINOR == 3 &&
FLATBUFFERS_VERSION_REVISION == 3,
"Non-compatible flatbuffers version included");
namespace torch {
namespace jit {
namespace mobile {
namespace serialization {
struct Int;
struct Bool;
struct Double;
struct PerTensorAffineSchema;
struct QuantizedSchema;
struct QuantizedSchemaBuilder;
struct TensorMetadata;
struct TensorMetadataBuilder;
struct String;
struct StringBuilder;
struct Device;
struct DeviceBuilder;
struct List;
struct ListBuilder;
struct IntList;
struct IntListBuilder;
struct DoubleList;
struct DoubleListBuilder;
struct BoolList;
struct BoolListBuilder;
struct Tuple;
struct TupleBuilder;
struct Dict;
struct DictBuilder;
struct ObjectType;
struct ObjectTypeBuilder;
struct Object;
struct ObjectBuilder;
struct ComplexDouble;
struct EnumValue;
struct EnumValueBuilder;
struct Instruction;
struct Operator;
struct OperatorBuilder;
struct Arg;
struct ArgBuilder;
struct Schema;
struct SchemaBuilder;
struct DebugInfo;
struct DebugInfoBuilder;
struct Function;
struct FunctionBuilder;
struct StorageData;
struct StorageDataBuilder;
struct IValue;
struct IValueBuilder;
struct ExtraFile;
struct ExtraFileBuilder;
struct Module;
struct ModuleBuilder;
enum class TypeType : uint8_t {
UNSET = 0,
CLASS_WITH_FIELD = 1,
CUSTOM_CLASS = 2,
CLASS_WITH_SETSTATE = 3,
NON_OBJ = 4,
MIN = UNSET,
MAX = NON_OBJ
};
inline const TypeType (&EnumValuesTypeType())[5] {
static const TypeType values[] = {
TypeType::UNSET,
TypeType::CLASS_WITH_FIELD,
TypeType::CUSTOM_CLASS,
TypeType::CLASS_WITH_SETSTATE,
TypeType::NON_OBJ
};
return values;
}
inline const char * const *EnumNamesTypeType() {
static const char * const names[6] = {
"UNSET",
"CLASS_WITH_FIELD",
"CUSTOM_CLASS",
"CLASS_WITH_SETSTATE",
"NON_OBJ",
nullptr
};
return names;
}
inline const char *EnumNameTypeType(TypeType e) {
if (::flatbuffers::IsOutRange(e, TypeType::UNSET, TypeType::NON_OBJ)) return "";
const size_t index = static_cast<size_t>(e);
return EnumNamesTypeType()[index];
}
enum class IValueUnion : uint8_t {
NONE = 0,
Int = 1,
Bool = 2,
Double = 3,
ComplexDouble = 4,
TensorMetadata = 5,
String = 6,
List = 7,
Tuple = 8,
Dict = 9,
Object = 10,
IntList = 11,
DoubleList = 12,
BoolList = 13,
Device = 14,
EnumValue = 15,
Function = 16,
MIN = NONE,
MAX = Function
};
inline const IValueUnion (&EnumValuesIValueUnion())[17] {
static const IValueUnion values[] = {
IValueUnion::NONE,
IValueUnion::Int,
IValueUnion::Bool,
IValueUnion::Double,
IValueUnion::ComplexDouble,
IValueUnion::TensorMetadata,
IValueUnion::String,
IValueUnion::List,
IValueUnion::Tuple,
IValueUnion::Dict,
IValueUnion::Object,
IValueUnion::IntList,
IValueUnion::DoubleList,
IValueUnion::BoolList,
IValueUnion::Device,
IValueUnion::EnumValue,
IValueUnion::Function
};
return values;
}
inline const char * const *EnumNamesIValueUnion() {
static const char * const names[18] = {
"NONE",
"Int",
"Bool",
"Double",
"ComplexDouble",
"TensorMetadata",
"String",
"List",
"Tuple",
"Dict",
"Object",
"IntList",
"DoubleList",
"BoolList",
"Device",
"EnumValue",
"Function",
nullptr
};
return names;
}
inline const char *EnumNameIValueUnion(IValueUnion e) {
if (::flatbuffers::IsOutRange(e, IValueUnion::NONE, IValueUnion::Function)) return "";
const size_t index = static_cast<size_t>(e);
return EnumNamesIValueUnion()[index];
}
template<typename T> struct IValueUnionTraits {
static const IValueUnion enum_value = IValueUnion::NONE;
};
template<> struct IValueUnionTraits<torch::jit::mobile::serialization::Int> {
static const IValueUnion enum_value = IValueUnion::Int;
};
template<> struct IValueUnionTraits<torch::jit::mobile::serialization::Bool> {
static const IValueUnion enum_value = IValueUnion::Bool;
};
template<> struct IValueUnionTraits<torch::jit::mobile::serialization::Double> {
static const IValueUnion enum_value = IValueUnion::Double;
};
template<> struct IValueUnionTraits<torch::jit::mobile::serialization::ComplexDouble> {
static const IValueUnion enum_value = IValueUnion::ComplexDouble;
};
template<> struct IValueUnionTraits<torch::jit::mobile::serialization::TensorMetadata> {
static const IValueUnion enum_value = IValueUnion::TensorMetadata;
};
template<> struct IValueUnionTraits<torch::jit::mobile::serialization::String> {
static const IValueUnion enum_value = IValueUnion::String;
};
template<> struct IValueUnionTraits<torch::jit::mobile::serialization::List> {
static const IValueUnion enum_value = IValueUnion::List;
};
template<> struct IValueUnionTraits<torch::jit::mobile::serialization::Tuple> {
static const IValueUnion enum_value = IValueUnion::Tuple;
};
template<> struct IValueUnionTraits<torch::jit::mobile::serialization::Dict> {
static const IValueUnion enum_value = IValueUnion::Dict;
};
template<> struct IValueUnionTraits<torch::jit::mobile::serialization::Object> {
static const IValueUnion enum_value = IValueUnion::Object;
};
template<> struct IValueUnionTraits<torch::jit::mobile::serialization::IntList> {
static const IValueUnion enum_value = IValueUnion::IntList;
};
template<> struct IValueUnionTraits<torch::jit::mobile::serialization::DoubleList> {
static const IValueUnion enum_value = IValueUnion::DoubleList;
};
template<> struct IValueUnionTraits<torch::jit::mobile::serialization::BoolList> {
static const IValueUnion enum_value = IValueUnion::BoolList;
};
template<> struct IValueUnionTraits<torch::jit::mobile::serialization::Device> {
static const IValueUnion enum_value = IValueUnion::Device;
};
template<> struct IValueUnionTraits<torch::jit::mobile::serialization::EnumValue> {
static const IValueUnion enum_value = IValueUnion::EnumValue;
};
template<> struct IValueUnionTraits<torch::jit::mobile::serialization::Function> {
static const IValueUnion enum_value = IValueUnion::Function;
};
bool VerifyIValueUnion(::flatbuffers::Verifier &verifier, const void *obj, IValueUnion type);
bool VerifyIValueUnionVector(::flatbuffers::Verifier &verifier, const ::flatbuffers::Vector<::flatbuffers::Offset<void>> *values, const ::flatbuffers::Vector<IValueUnion> *types);
FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) Int FLATBUFFERS_FINAL_CLASS {
private:
int64_t int_val_;
public:
Int()
: int_val_(0) {
}
Int(int64_t _int_val)
: int_val_(::flatbuffers::EndianScalar(_int_val)) {
}
int64_t int_val() const {
return ::flatbuffers::EndianScalar(int_val_);
}
void mutate_int_val(int64_t _int_val) {
::flatbuffers::WriteScalar(&int_val_, _int_val);
}
};
FLATBUFFERS_STRUCT_END(Int, 8);
FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(1) Bool FLATBUFFERS_FINAL_CLASS {
private:
uint8_t bool_val_;
public:
Bool()
: bool_val_(0) {
}
Bool(bool _bool_val)
: bool_val_(::flatbuffers::EndianScalar(static_cast<uint8_t>(_bool_val))) {
}
bool bool_val() const {
return ::flatbuffers::EndianScalar(bool_val_) != 0;
}
void mutate_bool_val(bool _bool_val) {
::flatbuffers::WriteScalar(&bool_val_, static_cast<uint8_t>(_bool_val));
}
};
FLATBUFFERS_STRUCT_END(Bool, 1);
FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) Double FLATBUFFERS_FINAL_CLASS {
private:
double double_val_;
public:
Double()
: double_val_(0) {
}
Double(double _double_val)
: double_val_(::flatbuffers::EndianScalar(_double_val)) {
}
double double_val() const {
return ::flatbuffers::EndianScalar(double_val_);
}
void mutate_double_val(double _double_val) {
::flatbuffers::WriteScalar(&double_val_, _double_val);
}
};
FLATBUFFERS_STRUCT_END(Double, 8);
FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) PerTensorAffineSchema FLATBUFFERS_FINAL_CLASS {
private:
double q_scale_;
int32_t q_zero_point_;
int32_t padding0__;
public:
PerTensorAffineSchema()
: q_scale_(0),
q_zero_point_(0),
padding0__(0) {
(void)padding0__;
}
PerTensorAffineSchema(double _q_scale, int32_t _q_zero_point)
: q_scale_(::flatbuffers::EndianScalar(_q_scale)),
q_zero_point_(::flatbuffers::EndianScalar(_q_zero_point)),
padding0__(0) {
(void)padding0__;
}
double q_scale() const {
return ::flatbuffers::EndianScalar(q_scale_);
}
void mutate_q_scale(double _q_scale) {
::flatbuffers::WriteScalar(&q_scale_, _q_scale);
}
int32_t q_zero_point() const {
return ::flatbuffers::EndianScalar(q_zero_point_);
}
void mutate_q_zero_point(int32_t _q_zero_point) {
::flatbuffers::WriteScalar(&q_zero_point_, _q_zero_point);
}
};
FLATBUFFERS_STRUCT_END(PerTensorAffineSchema, 16);
FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) ComplexDouble FLATBUFFERS_FINAL_CLASS {
private:
double real_;
double imag_;
public:
ComplexDouble()
: real_(0),
imag_(0) {
}
ComplexDouble(double _real, double _imag)
: real_(::flatbuffers::EndianScalar(_real)),
imag_(::flatbuffers::EndianScalar(_imag)) {
}
double real() const {
return ::flatbuffers::EndianScalar(real_);
}
void mutate_real(double _real) {
::flatbuffers::WriteScalar(&real_, _real);
}
double imag() const {
return ::flatbuffers::EndianScalar(imag_);
}
void mutate_imag(double _imag) {
::flatbuffers::WriteScalar(&imag_, _imag);
}
};
FLATBUFFERS_STRUCT_END(ComplexDouble, 16);
FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) Instruction FLATBUFFERS_FINAL_CLASS {
private:
int8_t op_;
int8_t padding0__;
uint16_t n_;
int32_t x_;
public:
Instruction()
: op_(0),
padding0__(0),
n_(0),
x_(0) {
(void)padding0__;
}
Instruction(int8_t _op, uint16_t _n, int32_t _x)
: op_(::flatbuffers::EndianScalar(_op)),
padding0__(0),
n_(::flatbuffers::EndianScalar(_n)),
x_(::flatbuffers::EndianScalar(_x)) {
(void)padding0__;
}
int8_t op() const {
return ::flatbuffers::EndianScalar(op_);
}
void mutate_op(int8_t _op) {
::flatbuffers::WriteScalar(&op_, _op);
}
uint16_t n() const {
return ::flatbuffers::EndianScalar(n_);
}
void mutate_n(uint16_t _n) {
::flatbuffers::WriteScalar(&n_, _n);
}
int32_t x() const {
return ::flatbuffers::EndianScalar(x_);
}
void mutate_x(int32_t _x) {
::flatbuffers::WriteScalar(&x_, _x);
}
};
FLATBUFFERS_STRUCT_END(Instruction, 8);
struct QuantizedSchema FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
typedef QuantizedSchemaBuilder Builder;
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
VT_QSCHEME = 4,
VT_SCALE = 6,
VT_ZERO_POINT = 8,
VT_SCALES = 10,
VT_ZERO_POINTS = 12,
VT_AXIS = 14
};
int8_t qscheme() const {
return GetField<int8_t>(VT_QSCHEME, 0);
}
bool mutate_qscheme(int8_t _qscheme = 0) {
return SetField<int8_t>(VT_QSCHEME, _qscheme, 0);
}
double scale() const {
return GetField<double>(VT_SCALE, 0.0);
}
bool mutate_scale(double _scale = 0.0) {
return SetField<double>(VT_SCALE, _scale, 0.0);
}
int32_t zero_point() const {
return GetField<int32_t>(VT_ZERO_POINT, 0);
}
bool mutate_zero_point(int32_t _zero_point = 0) {
return SetField<int32_t>(VT_ZERO_POINT, _zero_point, 0);
}
const torch::jit::mobile::serialization::TensorMetadata *scales() const {
return GetPointer<const torch::jit::mobile::serialization::TensorMetadata *>(VT_SCALES);
}
torch::jit::mobile::serialization::TensorMetadata *mutable_scales() {
return GetPointer<torch::jit::mobile::serialization::TensorMetadata *>(VT_SCALES);
}
const torch::jit::mobile::serialization::TensorMetadata *zero_points() const {
return GetPointer<const torch::jit::mobile::serialization::TensorMetadata *>(VT_ZERO_POINTS);
}
torch::jit::mobile::serialization::TensorMetadata *mutable_zero_points() {
return GetPointer<torch::jit::mobile::serialization::TensorMetadata *>(VT_ZERO_POINTS);
}
int32_t axis() const {
return GetField<int32_t>(VT_AXIS, 0);
}
bool mutate_axis(int32_t _axis = 0) {
return SetField<int32_t>(VT_AXIS, _axis, 0);
}
bool Verify(::flatbuffers::Verifier &verifier) const {
return VerifyTableStart(verifier) &&
VerifyField<int8_t>(verifier, VT_QSCHEME, 1) &&
VerifyField<double>(verifier, VT_SCALE, 8) &&
VerifyField<int32_t>(verifier, VT_ZERO_POINT, 4) &&
VerifyOffset(verifier, VT_SCALES) &&
verifier.VerifyTable(scales()) &&
VerifyOffset(verifier, VT_ZERO_POINTS) &&
verifier.VerifyTable(zero_points()) &&
VerifyField<int32_t>(verifier, VT_AXIS, 4) &&
verifier.EndTable();
}
};
struct QuantizedSchemaBuilder {
typedef QuantizedSchema Table;
::flatbuffers::FlatBufferBuilder &fbb_;
::flatbuffers::uoffset_t start_;
void add_qscheme(int8_t qscheme) {
fbb_.AddElement<int8_t>(QuantizedSchema::VT_QSCHEME, qscheme, 0);
}
void add_scale(double scale) {
fbb_.AddElement<double>(QuantizedSchema::VT_SCALE, scale, 0.0);
}
void add_zero_point(int32_t zero_point) {
fbb_.AddElement<int32_t>(QuantizedSchema::VT_ZERO_POINT, zero_point, 0);
}
void add_scales(::flatbuffers::Offset<torch::jit::mobile::serialization::TensorMetadata> scales) {
fbb_.AddOffset(QuantizedSchema::VT_SCALES, scales);
}
void add_zero_points(::flatbuffers::Offset<torch::jit::mobile::serialization::TensorMetadata> zero_points) {
fbb_.AddOffset(QuantizedSchema::VT_ZERO_POINTS, zero_points);
}
void add_axis(int32_t axis) {
fbb_.AddElement<int32_t>(QuantizedSchema::VT_AXIS, axis, 0);
}
explicit QuantizedSchemaBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
: fbb_(_fbb) {
start_ = fbb_.StartTable();
}
::flatbuffers::Offset<QuantizedSchema> Finish() {
const auto end = fbb_.EndTable(start_);
auto o = ::flatbuffers::Offset<QuantizedSchema>(end);
return o;
}
};
inline ::flatbuffers::Offset<QuantizedSchema> CreateQuantizedSchema(
::flatbuffers::FlatBufferBuilder &_fbb,
int8_t qscheme = 0,
double scale = 0.0,
int32_t zero_point = 0,
::flatbuffers::Offset<torch::jit::mobile::serialization::TensorMetadata> scales = 0,
::flatbuffers::Offset<torch::jit::mobile::serialization::TensorMetadata> zero_points = 0,
int32_t axis = 0) {
QuantizedSchemaBuilder builder_(_fbb);
builder_.add_scale(scale);
builder_.add_axis(axis);
builder_.add_zero_points(zero_points);
builder_.add_scales(scales);
builder_.add_zero_point(zero_point);
builder_.add_qscheme(qscheme);
return builder_.Finish();
}
struct TensorMetadata FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
typedef TensorMetadataBuilder Builder;
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
VT_STORAGE_LOCATION_INDEX = 4,
VT_SCALAR_TYPE = 6,
VT_STORAGE_OFFSET = 8,
VT_SIZES = 10,
VT_STRIDES = 12,
VT_REQUIRES_GRAD = 14,
VT_QUANTIZED_SCHEMA = 16
};
uint32_t storage_location_index() const {
return GetField<uint32_t>(VT_STORAGE_LOCATION_INDEX, 0);
}
bool mutate_storage_location_index(uint32_t _storage_location_index = 0) {
return SetField<uint32_t>(VT_STORAGE_LOCATION_INDEX, _storage_location_index, 0);
}
int8_t scalar_type() const {
return GetField<int8_t>(VT_SCALAR_TYPE, 0);
}
bool mutate_scalar_type(int8_t _scalar_type = 0) {
return SetField<int8_t>(VT_SCALAR_TYPE, _scalar_type, 0);
}
int32_t storage_offset() const {
return GetField<int32_t>(VT_STORAGE_OFFSET, 0);
}
bool mutate_storage_offset(int32_t _storage_offset = 0) {
return SetField<int32_t>(VT_STORAGE_OFFSET, _storage_offset, 0);
}
const ::flatbuffers::Vector<int32_t> *sizes() const {
return GetPointer<const ::flatbuffers::Vector<int32_t> *>(VT_SIZES);
}
::flatbuffers::Vector<int32_t> *mutable_sizes() {
return GetPointer<::flatbuffers::Vector<int32_t> *>(VT_SIZES);
}
const ::flatbuffers::Vector<int32_t> *strides() const {
return GetPointer<const ::flatbuffers::Vector<int32_t> *>(VT_STRIDES);
}
::flatbuffers::Vector<int32_t> *mutable_strides() {
return GetPointer<::flatbuffers::Vector<int32_t> *>(VT_STRIDES);
}
bool requires_grad() const {
return GetField<uint8_t>(VT_REQUIRES_GRAD, 0) != 0;
}
bool mutate_requires_grad(bool _requires_grad = 0) {
return SetField<uint8_t>(VT_REQUIRES_GRAD, static_cast<uint8_t>(_requires_grad), 0);
}
const torch::jit::mobile::serialization::QuantizedSchema *quantized_schema() const {
return GetPointer<const torch::jit::mobile::serialization::QuantizedSchema *>(VT_QUANTIZED_SCHEMA);
}
torch::jit::mobile::serialization::QuantizedSchema *mutable_quantized_schema() {
return GetPointer<torch::jit::mobile::serialization::QuantizedSchema *>(VT_QUANTIZED_SCHEMA);
}
bool Verify(::flatbuffers::Verifier &verifier) const {
return VerifyTableStart(verifier) &&
VerifyField<uint32_t>(verifier, VT_STORAGE_LOCATION_INDEX, 4) &&
VerifyField<int8_t>(verifier, VT_SCALAR_TYPE, 1) &&
VerifyField<int32_t>(verifier, VT_STORAGE_OFFSET, 4) &&
VerifyOffset(verifier, VT_SIZES) &&
verifier.VerifyVector(sizes()) &&
VerifyOffset(verifier, VT_STRIDES) &&
verifier.VerifyVector(strides()) &&
VerifyField<uint8_t>(verifier, VT_REQUIRES_GRAD, 1) &&
VerifyOffset(verifier, VT_QUANTIZED_SCHEMA) &&
verifier.VerifyTable(quantized_schema()) &&
verifier.EndTable();
}
};
struct TensorMetadataBuilder {
typedef TensorMetadata Table;
::flatbuffers::FlatBufferBuilder &fbb_;
::flatbuffers::uoffset_t start_;
void add_storage_location_index(uint32_t storage_location_index) {
fbb_.AddElement<uint32_t>(TensorMetadata::VT_STORAGE_LOCATION_INDEX, storage_location_index, 0);
}
void add_scalar_type(int8_t scalar_type) {
fbb_.AddElement<int8_t>(TensorMetadata::VT_SCALAR_TYPE, scalar_type, 0);
}
void add_storage_offset(int32_t storage_offset) {
fbb_.AddElement<int32_t>(TensorMetadata::VT_STORAGE_OFFSET, storage_offset, 0);
}
void add_sizes(::flatbuffers::Offset<::flatbuffers::Vector<int32_t>> sizes) {
fbb_.AddOffset(TensorMetadata::VT_SIZES, sizes);
}
void add_strides(::flatbuffers::Offset<::flatbuffers::Vector<int32_t>> strides) {
fbb_.AddOffset(TensorMetadata::VT_STRIDES, strides);
}
void add_requires_grad(bool requires_grad) {
fbb_.AddElement<uint8_t>(TensorMetadata::VT_REQUIRES_GRAD, static_cast<uint8_t>(requires_grad), 0);
}
void add_quantized_schema(::flatbuffers::Offset<torch::jit::mobile::serialization::QuantizedSchema> quantized_schema) {
fbb_.AddOffset(TensorMetadata::VT_QUANTIZED_SCHEMA, quantized_schema);
}
explicit TensorMetadataBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
: fbb_(_fbb) {
start_ = fbb_.StartTable();
}
::flatbuffers::Offset<TensorMetadata> Finish() {
const auto end = fbb_.EndTable(start_);
auto o = ::flatbuffers::Offset<TensorMetadata>(end);
return o;
}
};
inline ::flatbuffers::Offset<TensorMetadata> CreateTensorMetadata(
::flatbuffers::FlatBufferBuilder &_fbb,
uint32_t storage_location_index = 0,
int8_t scalar_type = 0,
int32_t storage_offset = 0,
::flatbuffers::Offset<::flatbuffers::Vector<int32_t>> sizes = 0,
::flatbuffers::Offset<::flatbuffers::Vector<int32_t>> strides = 0,
bool requires_grad = false,
::flatbuffers::Offset<torch::jit::mobile::serialization::QuantizedSchema> quantized_schema = 0) {
TensorMetadataBuilder builder_(_fbb);
builder_.add_quantized_schema(quantized_schema);
builder_.add_strides(strides);
builder_.add_sizes(sizes);
builder_.add_storage_offset(storage_offset);
builder_.add_storage_location_index(storage_location_index);
builder_.add_requires_grad(requires_grad);
builder_.add_scalar_type(scalar_type);
return builder_.Finish();
}
inline ::flatbuffers::Offset<TensorMetadata> CreateTensorMetadataDirect(
::flatbuffers::FlatBufferBuilder &_fbb,
uint32_t storage_location_index = 0,
int8_t scalar_type = 0,
int32_t storage_offset = 0,
const std::vector<int32_t> *sizes = nullptr,
const std::vector<int32_t> *strides = nullptr,
bool requires_grad = false,
::flatbuffers::Offset<torch::jit::mobile::serialization::QuantizedSchema> quantized_schema = 0) {
auto sizes__ = sizes ? _fbb.CreateVector<int32_t>(*sizes) : 0;
auto strides__ = strides ? _fbb.CreateVector<int32_t>(*strides) : 0;
return torch::jit::mobile::serialization::CreateTensorMetadata(
_fbb,
storage_location_index,
scalar_type,
storage_offset,
sizes__,
strides__,
requires_grad,
quantized_schema);
}
struct String FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
typedef StringBuilder Builder;
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
VT_DATA = 4
};
const ::flatbuffers::String *data() const {
return GetPointer<const ::flatbuffers::String *>(VT_DATA);
}
::flatbuffers::String *mutable_data() {
return GetPointer<::flatbuffers::String *>(VT_DATA);
}
bool Verify(::flatbuffers::Verifier &verifier) const {
return VerifyTableStart(verifier) &&
VerifyOffset(verifier, VT_DATA) &&
verifier.VerifyString(data()) &&
verifier.EndTable();
}
};
struct StringBuilder {
typedef String Table;
::flatbuffers::FlatBufferBuilder &fbb_;
::flatbuffers::uoffset_t start_;
void add_data(::flatbuffers::Offset<::flatbuffers::String> data) {
fbb_.AddOffset(String::VT_DATA, data);
}
explicit StringBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
: fbb_(_fbb) {
start_ = fbb_.StartTable();
}
::flatbuffers::Offset<String> Finish() {
const auto end = fbb_.EndTable(start_);
auto o = ::flatbuffers::Offset<String>(end);
return o;
}
};
inline ::flatbuffers::Offset<String> CreateString(
::flatbuffers::FlatBufferBuilder &_fbb,
::flatbuffers::Offset<::flatbuffers::String> data = 0) {
StringBuilder builder_(_fbb);
builder_.add_data(data);
return builder_.Finish();
}
inline ::flatbuffers::Offset<String> CreateStringDirect(
::flatbuffers::FlatBufferBuilder &_fbb,
const char *data = nullptr) {
auto data__ = data ? _fbb.CreateString(data) : 0;
return torch::jit::mobile::serialization::CreateString(
_fbb,
data__);
}
struct Device FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
typedef DeviceBuilder Builder;
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
VT_STR = 4
};
const ::flatbuffers::String *str() const {
return GetPointer<const ::flatbuffers::String *>(VT_STR);
}
::flatbuffers::String *mutable_str() {
return GetPointer<::flatbuffers::String *>(VT_STR);
}
bool Verify(::flatbuffers::Verifier &verifier) const {
return VerifyTableStart(verifier) &&
VerifyOffset(verifier, VT_STR) &&
verifier.VerifyString(str()) &&
verifier.EndTable();
}
};
struct DeviceBuilder {
typedef Device Table;
::flatbuffers::FlatBufferBuilder &fbb_;
::flatbuffers::uoffset_t start_;
void add_str(::flatbuffers::Offset<::flatbuffers::String> str) {
fbb_.AddOffset(Device::VT_STR, str);
}
explicit DeviceBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
: fbb_(_fbb) {
start_ = fbb_.StartTable();
}
::flatbuffers::Offset<Device> Finish() {
const auto end = fbb_.EndTable(start_);
auto o = ::flatbuffers::Offset<Device>(end);
return o;
}
};
inline ::flatbuffers::Offset<Device> CreateDevice(
::flatbuffers::FlatBufferBuilder &_fbb,
::flatbuffers::Offset<::flatbuffers::String> str = 0) {
DeviceBuilder builder_(_fbb);
builder_.add_str(str);
return builder_.Finish();
}
inline ::flatbuffers::Offset<Device> CreateDeviceDirect(
::flatbuffers::FlatBufferBuilder &_fbb,
const char *str = nullptr) {
auto str__ = str ? _fbb.CreateString(str) : 0;
return torch::jit::mobile::serialization::CreateDevice(
_fbb,
str__);
}
struct List FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
typedef ListBuilder Builder;
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
VT_ITEMS = 4,
VT_ANNOTATION_STR = 6
};
const ::flatbuffers::Vector<uint32_t> *items() const {
return GetPointer<const ::flatbuffers::Vector<uint32_t> *>(VT_ITEMS);
}
::flatbuffers::Vector<uint32_t> *mutable_items() {
return GetPointer<::flatbuffers::Vector<uint32_t> *>(VT_ITEMS);
}
const ::flatbuffers::String *annotation_str() const {
return GetPointer<const ::flatbuffers::String *>(VT_ANNOTATION_STR);
}
::flatbuffers::String *mutable_annotation_str() {
return GetPointer<::flatbuffers::String *>(VT_ANNOTATION_STR);
}
bool Verify(::flatbuffers::Verifier &verifier) const {
return VerifyTableStart(verifier) &&
VerifyOffset(verifier, VT_ITEMS) &&
verifier.VerifyVector(items()) &&
VerifyOffset(verifier, VT_ANNOTATION_STR) &&
verifier.VerifyString(annotation_str()) &&
verifier.EndTable();
}
};
struct ListBuilder {
typedef List Table;
::flatbuffers::FlatBufferBuilder &fbb_;
::flatbuffers::uoffset_t start_;
void add_items(::flatbuffers::Offset<::flatbuffers::Vector<uint32_t>> items) {
fbb_.AddOffset(List::VT_ITEMS, items);
}
void add_annotation_str(::flatbuffers::Offset<::flatbuffers::String> annotation_str) {
fbb_.AddOffset(List::VT_ANNOTATION_STR, annotation_str);
}
explicit ListBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
: fbb_(_fbb) {
start_ = fbb_.StartTable();
}
::flatbuffers::Offset<List> Finish() {
const auto end = fbb_.EndTable(start_);
auto o = ::flatbuffers::Offset<List>(end);
return o;
}
};
inline ::flatbuffers::Offset<List> CreateList(
::flatbuffers::FlatBufferBuilder &_fbb,
::flatbuffers::Offset<::flatbuffers::Vector<uint32_t>> items = 0,
::flatbuffers::Offset<::flatbuffers::String> annotation_str = 0) {
ListBuilder builder_(_fbb);
builder_.add_annotation_str(annotation_str);
builder_.add_items(items);
return builder_.Finish();
}
inline ::flatbuffers::Offset<List> CreateListDirect(
::flatbuffers::FlatBufferBuilder &_fbb,
const std::vector<uint32_t> *items = nullptr,
const char *annotation_str = nullptr) {
auto items__ = items ? _fbb.CreateVector<uint32_t>(*items) : 0;
auto annotation_str__ = annotation_str ? _fbb.CreateString(annotation_str) : 0;
return torch::jit::mobile::serialization::CreateList(
_fbb,
items__,
annotation_str__);
}
struct IntList FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
typedef IntListBuilder Builder;
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
VT_ITEMS = 4
};
const ::flatbuffers::Vector<int64_t> *items() const {
return GetPointer<const ::flatbuffers::Vector<int64_t> *>(VT_ITEMS);
}
::flatbuffers::Vector<int64_t> *mutable_items() {
return GetPointer<::flatbuffers::Vector<int64_t> *>(VT_ITEMS);
}
bool Verify(::flatbuffers::Verifier &verifier) const {
return VerifyTableStart(verifier) &&
VerifyOffset(verifier, VT_ITEMS) &&
verifier.VerifyVector(items()) &&
verifier.EndTable();
}
};
struct IntListBuilder {
typedef IntList Table;
::flatbuffers::FlatBufferBuilder &fbb_;
::flatbuffers::uoffset_t start_;
void add_items(::flatbuffers::Offset<::flatbuffers::Vector<int64_t>> items) {
fbb_.AddOffset(IntList::VT_ITEMS, items);
}
explicit IntListBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
: fbb_(_fbb) {
start_ = fbb_.StartTable();
}
::flatbuffers::Offset<IntList> Finish() {
const auto end = fbb_.EndTable(start_);
auto o = ::flatbuffers::Offset<IntList>(end);
return o;
}
};
inline ::flatbuffers::Offset<IntList> CreateIntList(
::flatbuffers::FlatBufferBuilder &_fbb,
::flatbuffers::Offset<::flatbuffers::Vector<int64_t>> items = 0) {
IntListBuilder builder_(_fbb);
builder_.add_items(items);
return builder_.Finish();
}
inline ::flatbuffers::Offset<IntList> CreateIntListDirect(
::flatbuffers::FlatBufferBuilder &_fbb,
const std::vector<int64_t> *items = nullptr) {
auto items__ = items ? _fbb.CreateVector<int64_t>(*items) : 0;
return torch::jit::mobile::serialization::CreateIntList(
_fbb,
items__);
}
struct DoubleList FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
typedef DoubleListBuilder Builder;
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
VT_ITEMS = 4
};
const ::flatbuffers::Vector<double> *items() const {
return GetPointer<const ::flatbuffers::Vector<double> *>(VT_ITEMS);
}
::flatbuffers::Vector<double> *mutable_items() {
return GetPointer<::flatbuffers::Vector<double> *>(VT_ITEMS);
}
bool Verify(::flatbuffers::Verifier &verifier) const {
return VerifyTableStart(verifier) &&
VerifyOffset(verifier, VT_ITEMS) &&
verifier.VerifyVector(items()) &&
verifier.EndTable();
}
};
struct DoubleListBuilder {
typedef DoubleList Table;
::flatbuffers::FlatBufferBuilder &fbb_;
::flatbuffers::uoffset_t start_;
void add_items(::flatbuffers::Offset<::flatbuffers::Vector<double>> items) {
fbb_.AddOffset(DoubleList::VT_ITEMS, items);
}
explicit DoubleListBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
: fbb_(_fbb) {
start_ = fbb_.StartTable();
}
::flatbuffers::Offset<DoubleList> Finish() {
const auto end = fbb_.EndTable(start_);
auto o = ::flatbuffers::Offset<DoubleList>(end);
return o;
}
};
inline ::flatbuffers::Offset<DoubleList> CreateDoubleList(
::flatbuffers::FlatBufferBuilder &_fbb,
::flatbuffers::Offset<::flatbuffers::Vector<double>> items = 0) {
DoubleListBuilder builder_(_fbb);
builder_.add_items(items);
return builder_.Finish();
}
inline ::flatbuffers::Offset<DoubleList> CreateDoubleListDirect(
::flatbuffers::FlatBufferBuilder &_fbb,
const std::vector<double> *items = nullptr) {
auto items__ = items ? _fbb.CreateVector<double>(*items) : 0;
return torch::jit::mobile::serialization::CreateDoubleList(
_fbb,
items__);
}
struct BoolList FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
typedef BoolListBuilder Builder;
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
VT_ITEMS = 4
};
const ::flatbuffers::Vector<uint8_t> *items() const {