forked from askorama/onnx-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
onnx.proto3.pb.go
1469 lines (1313 loc) · 53 KB
/
onnx.proto3.pb.go
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
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: onnx.proto3
package ir
import (
fmt "fmt"
math "math"
proto "github.com/golang/protobuf/proto"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
// Versioning
//
// ONNX versioning is specified in docs/IR.md and elaborated on in docs/Versioning.md
//
// To be compatible with both proto2 and proto3, we will use a version number
// that is not defined by the default value but an explicit enum number.
type Version int32
const (
// proto3 requires the first enum value to be zero.
// We add this just to appease the compiler.
Version__START_VERSION Version = 0
// The version field is always serialized and we will use it to store the
// version that the graph is generated from. This helps us set up version
// control.
// For the IR, we are using simple numbers starting with with 0x00000001,
// which was the version we published on Oct 10, 2017.
Version_IR_VERSION_2017_10_10 Version = 1
// IR_VERSION 2 published on Oct 30, 2017
// - Added type discriminator to AttributeProto to support proto3 users
Version_IR_VERSION_2017_10_30 Version = 2
// IR VERSION 3 published on Nov 3, 2017
// - For operator versioning:
// - Added new message OperatorSetIdProto
// - Added opset_import in ModelProto
// - For vendor extensions, added domain in NodeProto
Version_IR_VERSION Version = 3
)
var Version_name = map[int32]string{
0: "_START_VERSION",
1: "IR_VERSION_2017_10_10",
2: "IR_VERSION_2017_10_30",
3: "IR_VERSION",
}
var Version_value = map[string]int32{
"_START_VERSION": 0,
"IR_VERSION_2017_10_10": 1,
"IR_VERSION_2017_10_30": 2,
"IR_VERSION": 3,
}
func (x Version) String() string {
return proto.EnumName(Version_name, int32(x))
}
func (Version) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_d0206993eefcdc9e, []int{0}
}
// Note: this enum is structurally identical to the OpSchema::AttrType
// enum defined in schema.h. If you rev one, you likely need to rev the other.
type AttributeProto_AttributeType int32
const (
AttributeProto_UNDEFINED AttributeProto_AttributeType = 0
AttributeProto_FLOAT AttributeProto_AttributeType = 1
AttributeProto_INT AttributeProto_AttributeType = 2
AttributeProto_STRING AttributeProto_AttributeType = 3
AttributeProto_TENSOR AttributeProto_AttributeType = 4
AttributeProto_GRAPH AttributeProto_AttributeType = 5
AttributeProto_FLOATS AttributeProto_AttributeType = 6
AttributeProto_INTS AttributeProto_AttributeType = 7
AttributeProto_STRINGS AttributeProto_AttributeType = 8
AttributeProto_TENSORS AttributeProto_AttributeType = 9
AttributeProto_GRAPHS AttributeProto_AttributeType = 10
)
var AttributeProto_AttributeType_name = map[int32]string{
0: "UNDEFINED",
1: "FLOAT",
2: "INT",
3: "STRING",
4: "TENSOR",
5: "GRAPH",
6: "FLOATS",
7: "INTS",
8: "STRINGS",
9: "TENSORS",
10: "GRAPHS",
}
var AttributeProto_AttributeType_value = map[string]int32{
"UNDEFINED": 0,
"FLOAT": 1,
"INT": 2,
"STRING": 3,
"TENSOR": 4,
"GRAPH": 5,
"FLOATS": 6,
"INTS": 7,
"STRINGS": 8,
"TENSORS": 9,
"GRAPHS": 10,
}
func (x AttributeProto_AttributeType) String() string {
return proto.EnumName(AttributeProto_AttributeType_name, int32(x))
}
func (AttributeProto_AttributeType) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_d0206993eefcdc9e, []int{0, 0}
}
type TensorProto_DataType int32
const (
TensorProto_UNDEFINED TensorProto_DataType = 0
// Basic types.
TensorProto_FLOAT TensorProto_DataType = 1
TensorProto_UINT8 TensorProto_DataType = 2
TensorProto_INT8 TensorProto_DataType = 3
TensorProto_UINT16 TensorProto_DataType = 4
TensorProto_INT16 TensorProto_DataType = 5
TensorProto_INT32 TensorProto_DataType = 6
TensorProto_INT64 TensorProto_DataType = 7
TensorProto_STRING TensorProto_DataType = 8
TensorProto_BOOL TensorProto_DataType = 9
// IEEE754 half-precision floating-point format (16 bits wide).
// This format has 1 sign bit, 5 exponent bits, and 10 mantissa bits.
TensorProto_FLOAT16 TensorProto_DataType = 10
TensorProto_DOUBLE TensorProto_DataType = 11
TensorProto_UINT32 TensorProto_DataType = 12
TensorProto_UINT64 TensorProto_DataType = 13
TensorProto_COMPLEX64 TensorProto_DataType = 14
TensorProto_COMPLEX128 TensorProto_DataType = 15
// Non-IEEE floating-point format based on IEEE754 single-precision
// floating-point number truncated to 16 bits.
// This format has 1 sign bit, 8 exponent bits, and 7 mantissa bits.
TensorProto_BFLOAT16 TensorProto_DataType = 16
)
var TensorProto_DataType_name = map[int32]string{
0: "UNDEFINED",
1: "FLOAT",
2: "UINT8",
3: "INT8",
4: "UINT16",
5: "INT16",
6: "INT32",
7: "INT64",
8: "STRING",
9: "BOOL",
10: "FLOAT16",
11: "DOUBLE",
12: "UINT32",
13: "UINT64",
14: "COMPLEX64",
15: "COMPLEX128",
16: "BFLOAT16",
}
var TensorProto_DataType_value = map[string]int32{
"UNDEFINED": 0,
"FLOAT": 1,
"UINT8": 2,
"INT8": 3,
"UINT16": 4,
"INT16": 5,
"INT32": 6,
"INT64": 7,
"STRING": 8,
"BOOL": 9,
"FLOAT16": 10,
"DOUBLE": 11,
"UINT32": 12,
"UINT64": 13,
"COMPLEX64": 14,
"COMPLEX128": 15,
"BFLOAT16": 16,
}
func (x TensorProto_DataType) String() string {
return proto.EnumName(TensorProto_DataType_name, int32(x))
}
func (TensorProto_DataType) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_d0206993eefcdc9e, []int{6, 0}
}
// Attributes
//
// A named attribute containing either singular float, integer, string, graph,
// and tensor values, or repeated float, integer, string, graph, and tensor values.
// An AttributeProto MUST contain the name field, and *only one* of the
// following content fields, effectively enforcing a C/C++ union equivalent.
type AttributeProto struct {
// The name field MUST be present for this version of the IR.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// if ref_attr_name is not empty, ref_attr_name is the attribute name in parent function.
// In this case, this AttributeProto does not contain data, and it's a reference of attribute
// in parent scope.
// NOTE: This should ONLY be used in function (sub-graph). It's invalid to be used in main graph.
RefAttrName string `protobuf:"bytes,21,opt,name=ref_attr_name,json=refAttrName,proto3" json:"ref_attr_name,omitempty"`
// A human-readable documentation for this attribute. Markdown is allowed.
DocString string `protobuf:"bytes,13,opt,name=doc_string,json=docString,proto3" json:"doc_string,omitempty"`
// The type field MUST be present for this version of the IR.
// For 0.0.1 versions of the IR, this field was not defined, and
// implementations needed to use has_field hueristics to determine
// which value field was in use. For IR_VERSION 0.0.2 or later, this
// field MUST be set and match the f|i|s|t|... field in use. This
// change was made to accomodate proto3 implementations.
Type AttributeProto_AttributeType `protobuf:"varint,20,opt,name=type,proto3,enum=onnx.AttributeProto_AttributeType" json:"type,omitempty"`
// Exactly ONE of the following fields must be present for this version of the IR
F float32 `protobuf:"fixed32,2,opt,name=f,proto3" json:"f,omitempty"`
I int64 `protobuf:"varint,3,opt,name=i,proto3" json:"i,omitempty"`
S []byte `protobuf:"bytes,4,opt,name=s,proto3" json:"s,omitempty"`
T *TensorProto `protobuf:"bytes,5,opt,name=t,proto3" json:"t,omitempty"`
G *GraphProto `protobuf:"bytes,6,opt,name=g,proto3" json:"g,omitempty"`
Floats []float32 `protobuf:"fixed32,7,rep,packed,name=floats,proto3" json:"floats,omitempty"`
Ints []int64 `protobuf:"varint,8,rep,packed,name=ints,proto3" json:"ints,omitempty"`
Strings [][]byte `protobuf:"bytes,9,rep,name=strings,proto3" json:"strings,omitempty"`
Tensors []*TensorProto `protobuf:"bytes,10,rep,name=tensors,proto3" json:"tensors,omitempty"`
Graphs []*GraphProto `protobuf:"bytes,11,rep,name=graphs,proto3" json:"graphs,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *AttributeProto) Reset() { *m = AttributeProto{} }
func (m *AttributeProto) String() string { return proto.CompactTextString(m) }
func (*AttributeProto) ProtoMessage() {}
func (*AttributeProto) Descriptor() ([]byte, []int) {
return fileDescriptor_d0206993eefcdc9e, []int{0}
}
func (m *AttributeProto) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_AttributeProto.Unmarshal(m, b)
}
func (m *AttributeProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_AttributeProto.Marshal(b, m, deterministic)
}
func (m *AttributeProto) XXX_Merge(src proto.Message) {
xxx_messageInfo_AttributeProto.Merge(m, src)
}
func (m *AttributeProto) XXX_Size() int {
return xxx_messageInfo_AttributeProto.Size(m)
}
func (m *AttributeProto) XXX_DiscardUnknown() {
xxx_messageInfo_AttributeProto.DiscardUnknown(m)
}
var xxx_messageInfo_AttributeProto proto.InternalMessageInfo
func (m *AttributeProto) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *AttributeProto) GetRefAttrName() string {
if m != nil {
return m.RefAttrName
}
return ""
}
func (m *AttributeProto) GetDocString() string {
if m != nil {
return m.DocString
}
return ""
}
func (m *AttributeProto) GetType() AttributeProto_AttributeType {
if m != nil {
return m.Type
}
return AttributeProto_UNDEFINED
}
func (m *AttributeProto) GetF() float32 {
if m != nil {
return m.F
}
return 0
}
func (m *AttributeProto) GetI() int64 {
if m != nil {
return m.I
}
return 0
}
func (m *AttributeProto) GetS() []byte {
if m != nil {
return m.S
}
return nil
}
func (m *AttributeProto) GetT() *TensorProto {
if m != nil {
return m.T
}
return nil
}
func (m *AttributeProto) GetG() *GraphProto {
if m != nil {
return m.G
}
return nil
}
func (m *AttributeProto) GetFloats() []float32 {
if m != nil {
return m.Floats
}
return nil
}
func (m *AttributeProto) GetInts() []int64 {
if m != nil {
return m.Ints
}
return nil
}
func (m *AttributeProto) GetStrings() [][]byte {
if m != nil {
return m.Strings
}
return nil
}
func (m *AttributeProto) GetTensors() []*TensorProto {
if m != nil {
return m.Tensors
}
return nil
}
func (m *AttributeProto) GetGraphs() []*GraphProto {
if m != nil {
return m.Graphs
}
return nil
}
// Defines information on value, including the name, the type, and
// the shape of the value.
type ValueInfoProto struct {
// This field MUST be present in this version of the IR.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// This field MUST be present in this version of the IR.
Type *TypeProto `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
// A human-readable documentation for this value. Markdown is allowed.
DocString string `protobuf:"bytes,3,opt,name=doc_string,json=docString,proto3" json:"doc_string,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ValueInfoProto) Reset() { *m = ValueInfoProto{} }
func (m *ValueInfoProto) String() string { return proto.CompactTextString(m) }
func (*ValueInfoProto) ProtoMessage() {}
func (*ValueInfoProto) Descriptor() ([]byte, []int) {
return fileDescriptor_d0206993eefcdc9e, []int{1}
}
func (m *ValueInfoProto) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ValueInfoProto.Unmarshal(m, b)
}
func (m *ValueInfoProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ValueInfoProto.Marshal(b, m, deterministic)
}
func (m *ValueInfoProto) XXX_Merge(src proto.Message) {
xxx_messageInfo_ValueInfoProto.Merge(m, src)
}
func (m *ValueInfoProto) XXX_Size() int {
return xxx_messageInfo_ValueInfoProto.Size(m)
}
func (m *ValueInfoProto) XXX_DiscardUnknown() {
xxx_messageInfo_ValueInfoProto.DiscardUnknown(m)
}
var xxx_messageInfo_ValueInfoProto proto.InternalMessageInfo
func (m *ValueInfoProto) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *ValueInfoProto) GetType() *TypeProto {
if m != nil {
return m.Type
}
return nil
}
func (m *ValueInfoProto) GetDocString() string {
if m != nil {
return m.DocString
}
return ""
}
// Nodes
//
// Computation graphs are made up of a DAG of nodes, which represent what is
// commonly called a "layer" or "pipeline stage" in machine learning frameworks.
//
// For example, it can be a node of type "Conv" that takes in an image, a filter
// tensor and a bias tensor, and produces the convolved output.
type NodeProto struct {
Input []string `protobuf:"bytes,1,rep,name=input,proto3" json:"input,omitempty"`
Output []string `protobuf:"bytes,2,rep,name=output,proto3" json:"output,omitempty"`
// An optional identifier for this node in a graph.
// This field MAY be absent in ths version of the IR.
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
// The symbolic identifier of the Operator to execute.
OpType string `protobuf:"bytes,4,opt,name=op_type,json=opType,proto3" json:"op_type,omitempty"`
// The domain of the OperatorSet that specifies the operator named by op_type.
Domain string `protobuf:"bytes,7,opt,name=domain,proto3" json:"domain,omitempty"`
// Additional named attributes.
Attribute []*AttributeProto `protobuf:"bytes,5,rep,name=attribute,proto3" json:"attribute,omitempty"`
// A human-readable documentation for this node. Markdown is allowed.
DocString string `protobuf:"bytes,6,opt,name=doc_string,json=docString,proto3" json:"doc_string,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *NodeProto) Reset() { *m = NodeProto{} }
func (m *NodeProto) String() string { return proto.CompactTextString(m) }
func (*NodeProto) ProtoMessage() {}
func (*NodeProto) Descriptor() ([]byte, []int) {
return fileDescriptor_d0206993eefcdc9e, []int{2}
}
func (m *NodeProto) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_NodeProto.Unmarshal(m, b)
}
func (m *NodeProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_NodeProto.Marshal(b, m, deterministic)
}
func (m *NodeProto) XXX_Merge(src proto.Message) {
xxx_messageInfo_NodeProto.Merge(m, src)
}
func (m *NodeProto) XXX_Size() int {
return xxx_messageInfo_NodeProto.Size(m)
}
func (m *NodeProto) XXX_DiscardUnknown() {
xxx_messageInfo_NodeProto.DiscardUnknown(m)
}
var xxx_messageInfo_NodeProto proto.InternalMessageInfo
func (m *NodeProto) GetInput() []string {
if m != nil {
return m.Input
}
return nil
}
func (m *NodeProto) GetOutput() []string {
if m != nil {
return m.Output
}
return nil
}
func (m *NodeProto) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *NodeProto) GetOpType() string {
if m != nil {
return m.OpType
}
return ""
}
func (m *NodeProto) GetDomain() string {
if m != nil {
return m.Domain
}
return ""
}
func (m *NodeProto) GetAttribute() []*AttributeProto {
if m != nil {
return m.Attribute
}
return nil
}
func (m *NodeProto) GetDocString() string {
if m != nil {
return m.DocString
}
return ""
}
// Models
//
// ModelProto is a top-level file/container format for bundling a ML model and
// associating its computation graph with metadata.
//
// The semantics of the model are described by the associated GraphProto.
type ModelProto struct {
// The version of the IR this model targets. See Version enum above.
// This field MUST be present.
IrVersion int64 `protobuf:"varint,1,opt,name=ir_version,json=irVersion,proto3" json:"ir_version,omitempty"`
// The OperatorSets this model relies on.
// All ModelProtos MUST have at least one entry that
// specifies which version of the ONNX OperatorSet is
// being imported.
//
// All nodes in the ModelProto's graph will bind against the operator
// with the same-domain/same-op_type operator with the HIGHEST version
// in the referenced operator sets.
OpsetImport []*OperatorSetIdProto `protobuf:"bytes,8,rep,name=opset_import,json=opsetImport,proto3" json:"opset_import,omitempty"`
// The name of the framework or tool used to generate this model.
// This field SHOULD be present to indicate which implementation/tool/framework
// emitted the model.
ProducerName string `protobuf:"bytes,2,opt,name=producer_name,json=producerName,proto3" json:"producer_name,omitempty"`
// The version of the framework or tool used to generate this model.
// This field SHOULD be present to indicate which implementation/tool/framework
// emitted the model.
ProducerVersion string `protobuf:"bytes,3,opt,name=producer_version,json=producerVersion,proto3" json:"producer_version,omitempty"`
// Domain name of the model.
// We use reverse domain names as name space indicators. For example:
// `com.facebook.fair` or `com.microsoft.cognitiveservices`
//
// Together with `model_version` and GraphProto.name, this forms the unique identity of
// the graph.
Domain string `protobuf:"bytes,4,opt,name=domain,proto3" json:"domain,omitempty"`
// The version of the graph encoded. See Version enum below.
ModelVersion int64 `protobuf:"varint,5,opt,name=model_version,json=modelVersion,proto3" json:"model_version,omitempty"`
// A human-readable documentation for this model. Markdown is allowed.
DocString string `protobuf:"bytes,6,opt,name=doc_string,json=docString,proto3" json:"doc_string,omitempty"`
// The parameterized graph that is evaluated to execute the model.
Graph *GraphProto `protobuf:"bytes,7,opt,name=graph,proto3" json:"graph,omitempty"`
// Named metadata values; keys should be distinct.
MetadataProps []*StringStringEntryProto `protobuf:"bytes,14,rep,name=metadata_props,json=metadataProps,proto3" json:"metadata_props,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ModelProto) Reset() { *m = ModelProto{} }
func (m *ModelProto) String() string { return proto.CompactTextString(m) }
func (*ModelProto) ProtoMessage() {}
func (*ModelProto) Descriptor() ([]byte, []int) {
return fileDescriptor_d0206993eefcdc9e, []int{3}
}
func (m *ModelProto) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ModelProto.Unmarshal(m, b)
}
func (m *ModelProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ModelProto.Marshal(b, m, deterministic)
}
func (m *ModelProto) XXX_Merge(src proto.Message) {
xxx_messageInfo_ModelProto.Merge(m, src)
}
func (m *ModelProto) XXX_Size() int {
return xxx_messageInfo_ModelProto.Size(m)
}
func (m *ModelProto) XXX_DiscardUnknown() {
xxx_messageInfo_ModelProto.DiscardUnknown(m)
}
var xxx_messageInfo_ModelProto proto.InternalMessageInfo
func (m *ModelProto) GetIrVersion() int64 {
if m != nil {
return m.IrVersion
}
return 0
}
func (m *ModelProto) GetOpsetImport() []*OperatorSetIdProto {
if m != nil {
return m.OpsetImport
}
return nil
}
func (m *ModelProto) GetProducerName() string {
if m != nil {
return m.ProducerName
}
return ""
}
func (m *ModelProto) GetProducerVersion() string {
if m != nil {
return m.ProducerVersion
}
return ""
}
func (m *ModelProto) GetDomain() string {
if m != nil {
return m.Domain
}
return ""
}
func (m *ModelProto) GetModelVersion() int64 {
if m != nil {
return m.ModelVersion
}
return 0
}
func (m *ModelProto) GetDocString() string {
if m != nil {
return m.DocString
}
return ""
}
func (m *ModelProto) GetGraph() *GraphProto {
if m != nil {
return m.Graph
}
return nil
}
func (m *ModelProto) GetMetadataProps() []*StringStringEntryProto {
if m != nil {
return m.MetadataProps
}
return nil
}
// StringStringEntryProto follows the pattern for cross-proto-version maps.
// See https://developers.google.com/protocol-buffers/docs/proto3#maps
type StringStringEntryProto struct {
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *StringStringEntryProto) Reset() { *m = StringStringEntryProto{} }
func (m *StringStringEntryProto) String() string { return proto.CompactTextString(m) }
func (*StringStringEntryProto) ProtoMessage() {}
func (*StringStringEntryProto) Descriptor() ([]byte, []int) {
return fileDescriptor_d0206993eefcdc9e, []int{4}
}
func (m *StringStringEntryProto) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_StringStringEntryProto.Unmarshal(m, b)
}
func (m *StringStringEntryProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_StringStringEntryProto.Marshal(b, m, deterministic)
}
func (m *StringStringEntryProto) XXX_Merge(src proto.Message) {
xxx_messageInfo_StringStringEntryProto.Merge(m, src)
}
func (m *StringStringEntryProto) XXX_Size() int {
return xxx_messageInfo_StringStringEntryProto.Size(m)
}
func (m *StringStringEntryProto) XXX_DiscardUnknown() {
xxx_messageInfo_StringStringEntryProto.DiscardUnknown(m)
}
var xxx_messageInfo_StringStringEntryProto proto.InternalMessageInfo
func (m *StringStringEntryProto) GetKey() string {
if m != nil {
return m.Key
}
return ""
}
func (m *StringStringEntryProto) GetValue() string {
if m != nil {
return m.Value
}
return ""
}
// Graphs
//
// A graph defines the computational logic of a model and is comprised of a parameterized
// list of nodes that form a directed acyclic graph based on their inputs and outputs.
// This is the equivalent of the "network" or "graph" in many deep learning
// frameworks.
type GraphProto struct {
// The nodes in the graph, sorted topologically.
Node []*NodeProto `protobuf:"bytes,1,rep,name=node,proto3" json:"node,omitempty"`
// The name of the graph.
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
// A list of named tensor values, used to specify constant inputs of the graph.
// Each TensorProto entry must have a distinct name (within the list) that
// also appears in the input list.
Initializer []*TensorProto `protobuf:"bytes,5,rep,name=initializer,proto3" json:"initializer,omitempty"`
// A human-readable documentation for this graph. Markdown is allowed.
DocString string `protobuf:"bytes,10,opt,name=doc_string,json=docString,proto3" json:"doc_string,omitempty"`
// The inputs and outputs of the graph.
Input []*ValueInfoProto `protobuf:"bytes,11,rep,name=input,proto3" json:"input,omitempty"`
Output []*ValueInfoProto `protobuf:"bytes,12,rep,name=output,proto3" json:"output,omitempty"`
// Information for the values in the graph. The ValueInfoProto.name's
// must be distinct. It is optional for a value to appear in value_info list.
ValueInfo []*ValueInfoProto `protobuf:"bytes,13,rep,name=value_info,json=valueInfo,proto3" json:"value_info,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GraphProto) Reset() { *m = GraphProto{} }
func (m *GraphProto) String() string { return proto.CompactTextString(m) }
func (*GraphProto) ProtoMessage() {}
func (*GraphProto) Descriptor() ([]byte, []int) {
return fileDescriptor_d0206993eefcdc9e, []int{5}
}
func (m *GraphProto) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GraphProto.Unmarshal(m, b)
}
func (m *GraphProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GraphProto.Marshal(b, m, deterministic)
}
func (m *GraphProto) XXX_Merge(src proto.Message) {
xxx_messageInfo_GraphProto.Merge(m, src)
}
func (m *GraphProto) XXX_Size() int {
return xxx_messageInfo_GraphProto.Size(m)
}
func (m *GraphProto) XXX_DiscardUnknown() {
xxx_messageInfo_GraphProto.DiscardUnknown(m)
}
var xxx_messageInfo_GraphProto proto.InternalMessageInfo
func (m *GraphProto) GetNode() []*NodeProto {
if m != nil {
return m.Node
}
return nil
}
func (m *GraphProto) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *GraphProto) GetInitializer() []*TensorProto {
if m != nil {
return m.Initializer
}
return nil
}
func (m *GraphProto) GetDocString() string {
if m != nil {
return m.DocString
}
return ""
}
func (m *GraphProto) GetInput() []*ValueInfoProto {
if m != nil {
return m.Input
}
return nil
}
func (m *GraphProto) GetOutput() []*ValueInfoProto {
if m != nil {
return m.Output
}
return nil
}
func (m *GraphProto) GetValueInfo() []*ValueInfoProto {
if m != nil {
return m.ValueInfo
}
return nil
}
// Tensors
//
// A serialized tensor value.
type TensorProto struct {
// The shape of the tensor.
Dims []int64 `protobuf:"varint,1,rep,packed,name=dims,proto3" json:"dims,omitempty"`
// The data type of the tensor.
// This field MUST have a valid TensorProto.DataType value
DataType int32 `protobuf:"varint,2,opt,name=data_type,json=dataType,proto3" json:"data_type,omitempty"`
Segment *TensorProto_Segment `protobuf:"bytes,3,opt,name=segment,proto3" json:"segment,omitempty"`
// For float and complex64 values
// Complex64 tensors are encoded as a single array of floats,
// with the real components appearing in odd numbered positions,
// and the corresponding imaginary component apparing in the
// subsequent even numbered position. (e.g., [1.0 + 2.0i, 3.0 + 4.0i]
// is encoded as [1.0, 2.0 ,3.0 ,4.0]
// When this field is present, the data_type field MUST be FLOAT or COMPLEX64.
FloatData []float32 `protobuf:"fixed32,4,rep,packed,name=float_data,json=floatData,proto3" json:"float_data,omitempty"`
// For int32, uint8, int8, uint16, int16, bool, and float16 values
// float16 values must be bit-wise converted to an uint16_t prior
// to writing to the buffer.
// When this field is present, the data_type field MUST be
// INT32, INT16, INT8, UINT16, UINT8, BOOL, or FLOAT16
Int32Data []int32 `protobuf:"varint,5,rep,packed,name=int32_data,json=int32Data,proto3" json:"int32_data,omitempty"`
// For strings.
// Each element of string_data is a UTF-8 encoded Unicode
// string. No trailing null, no leading BOM. The protobuf "string"
// scalar type is not used to match ML community conventions.
// When this field is present, the data_type field MUST be STRING
StringData [][]byte `protobuf:"bytes,6,rep,name=string_data,json=stringData,proto3" json:"string_data,omitempty"`
// For int64.
// When this field is present, the data_type field MUST be INT64
Int64Data []int64 `protobuf:"varint,7,rep,packed,name=int64_data,json=int64Data,proto3" json:"int64_data,omitempty"`
// Optionally, a name for the tensor.
Name string `protobuf:"bytes,8,opt,name=name,proto3" json:"name,omitempty"`
// A human-readable documentation for this tensor. Markdown is allowed.
DocString string `protobuf:"bytes,12,opt,name=doc_string,json=docString,proto3" json:"doc_string,omitempty"`
// Serializations can either use one of the fields above, or use this
// raw bytes field. The only exception is the string case, where one is
// required to store the content in the repeated bytes string_data field.
//
// When this raw_data field is used to store tensor value, elements MUST
// be stored in as fixed-width, little-endian order.
// Floating-point data types MUST be stored in IEEE 754 format.
// Complex64 elements must be written as two consecutive FLOAT values, real component first.
// Complex128 elements must be written as two consecutive DOUBLE values, real component first.
// Boolean type MUST be written one byte per tensor element (00000001 for true, 00000000 for false).
//
// Note: the advantage of specific field rather than the raw_data field is
// that in some cases (e.g. int data), protobuf does a better packing via
// variable length storage, and may lead to smaller binary footprint.
// When this field is present, the data_type field MUST NOT be STRING or UNDEFINED
RawData []byte `protobuf:"bytes,9,opt,name=raw_data,json=rawData,proto3" json:"raw_data,omitempty"`
// For double
// Complex128 tensors are encoded as a single array of doubles,
// with the real components appearing in odd numbered positions,
// and the corresponding imaginary component apparing in the
// subsequent even numbered position. (e.g., [1.0 + 2.0i, 3.0 + 4.0i]
// is encoded as [1.0, 2.0 ,3.0 ,4.0]
// When this field is present, the data_type field MUST be DOUBLE or COMPLEX128
DoubleData []float64 `protobuf:"fixed64,10,rep,packed,name=double_data,json=doubleData,proto3" json:"double_data,omitempty"`
// For uint64 and uint32 values
// When this field is present, the data_type field MUST be
// UINT32 or UINT64
Uint64Data []uint64 `protobuf:"varint,11,rep,packed,name=uint64_data,json=uint64Data,proto3" json:"uint64_data,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *TensorProto) Reset() { *m = TensorProto{} }
func (m *TensorProto) String() string { return proto.CompactTextString(m) }
func (*TensorProto) ProtoMessage() {}
func (*TensorProto) Descriptor() ([]byte, []int) {
return fileDescriptor_d0206993eefcdc9e, []int{6}
}
func (m *TensorProto) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TensorProto.Unmarshal(m, b)
}
func (m *TensorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TensorProto.Marshal(b, m, deterministic)
}
func (m *TensorProto) XXX_Merge(src proto.Message) {
xxx_messageInfo_TensorProto.Merge(m, src)
}
func (m *TensorProto) XXX_Size() int {
return xxx_messageInfo_TensorProto.Size(m)
}
func (m *TensorProto) XXX_DiscardUnknown() {
xxx_messageInfo_TensorProto.DiscardUnknown(m)
}
var xxx_messageInfo_TensorProto proto.InternalMessageInfo
func (m *TensorProto) GetDims() []int64 {
if m != nil {
return m.Dims
}
return nil
}
func (m *TensorProto) GetDataType() int32 {
if m != nil {
return m.DataType
}
return 0
}
func (m *TensorProto) GetSegment() *TensorProto_Segment {
if m != nil {
return m.Segment
}
return nil
}
func (m *TensorProto) GetFloatData() []float32 {
if m != nil {
return m.FloatData
}
return nil
}
func (m *TensorProto) GetInt32Data() []int32 {
if m != nil {
return m.Int32Data
}
return nil
}
func (m *TensorProto) GetStringData() [][]byte {
if m != nil {
return m.StringData
}
return nil
}
func (m *TensorProto) GetInt64Data() []int64 {
if m != nil {
return m.Int64Data
}
return nil
}
func (m *TensorProto) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *TensorProto) GetDocString() string {
if m != nil {
return m.DocString
}
return ""
}
func (m *TensorProto) GetRawData() []byte {
if m != nil {
return m.RawData
}
return nil
}
func (m *TensorProto) GetDoubleData() []float64 {
if m != nil {
return m.DoubleData
}
return nil
}
func (m *TensorProto) GetUint64Data() []uint64 {
if m != nil {
return m.Uint64Data
}
return nil
}
// For very large tensors, we may want to store them in chunks, in which
// case the following fields will specify the segment that is stored in
// the current TensorProto.
type TensorProto_Segment struct {
Begin int64 `protobuf:"varint,1,opt,name=begin,proto3" json:"begin,omitempty"`
End int64 `protobuf:"varint,2,opt,name=end,proto3" json:"end,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`