protos

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 2, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

README

Protobuf Generated Files

All files in this directory are generated using onnx-gomlx/internal/cmd/protoc_onnx_protos tool, except the protos.go file, which includes the one //go:generate go run ../cmd/protoc_onnx_protos line.

Notice there are two variants of ONNX protos: onnx.proto and onnx-ml.proto, and one can't include both, since they redefine each other. Why would they do that :sad: !? (and not document it in the proto files ...)

Anyway, this project takes the onnx-ml.proto, because according to the IR mention it seems to be more complete, even though onnx-gomlx not necessarily supports all its operations.

Documentation

Overview

Package protos is empty, it simply includes a rule to generate all the sub-packages with protobuf generated code:

Index

Constants

This section is empty.

Variables

View Source
var (
	SequenceProto_DataType_name = map[int32]string{
		0: "UNDEFINED",
		1: "TENSOR",
		2: "SPARSE_TENSOR",
		3: "SEQUENCE",
		4: "MAP",
		5: "OPTIONAL",
	}
	SequenceProto_DataType_value = map[string]int32{
		"UNDEFINED":     0,
		"TENSOR":        1,
		"SPARSE_TENSOR": 2,
		"SEQUENCE":      3,
		"MAP":           4,
		"OPTIONAL":      5,
	}
)

Enum value maps for SequenceProto_DataType.

View Source
var (
	OptionalProto_DataType_name = map[int32]string{
		0: "UNDEFINED",
		1: "TENSOR",
		2: "SPARSE_TENSOR",
		3: "SEQUENCE",
		4: "MAP",
		5: "OPTIONAL",
	}
	OptionalProto_DataType_value = map[string]int32{
		"UNDEFINED":     0,
		"TENSOR":        1,
		"SPARSE_TENSOR": 2,
		"SEQUENCE":      3,
		"MAP":           4,
		"OPTIONAL":      5,
	}
)

Enum value maps for OptionalProto_DataType.

View Source
var (
	Version_name = map[int32]string{
		0:  "_START_VERSION",
		1:  "IR_VERSION_2017_10_10",
		2:  "IR_VERSION_2017_10_30",
		3:  "IR_VERSION_2017_11_3",
		4:  "IR_VERSION_2019_1_22",
		5:  "IR_VERSION_2019_3_18",
		6:  "IR_VERSION_2019_9_19",
		7:  "IR_VERSION_2020_5_8",
		8:  "IR_VERSION_2021_7_30",
		9:  "IR_VERSION_2023_5_5",
		10: "IR_VERSION_2024_3_25",
		11: "IR_VERSION",
	}
	Version_value = map[string]int32{
		"_START_VERSION":        0,
		"IR_VERSION_2017_10_10": 1,
		"IR_VERSION_2017_10_30": 2,
		"IR_VERSION_2017_11_3":  3,
		"IR_VERSION_2019_1_22":  4,
		"IR_VERSION_2019_3_18":  5,
		"IR_VERSION_2019_9_19":  6,
		"IR_VERSION_2020_5_8":   7,
		"IR_VERSION_2021_7_30":  8,
		"IR_VERSION_2023_5_5":   9,
		"IR_VERSION_2024_3_25":  10,
		"IR_VERSION":            11,
	}
)

Enum value maps for Version.

View Source
var (
	OperatorStatus_name = map[int32]string{
		0: "EXPERIMENTAL",
		1: "STABLE",
	}
	OperatorStatus_value = map[string]int32{
		"EXPERIMENTAL": 0,
		"STABLE":       1,
	}
)

Enum value maps for OperatorStatus.

View Source
var (
	AttributeProto_AttributeType_name = map[int32]string{
		0:  "UNDEFINED",
		1:  "FLOAT",
		2:  "INT",
		3:  "STRING",
		4:  "TENSOR",
		5:  "GRAPH",
		11: "SPARSE_TENSOR",
		13: "TYPE_PROTO",
		6:  "FLOATS",
		7:  "INTS",
		8:  "STRINGS",
		9:  "TENSORS",
		10: "GRAPHS",
		12: "SPARSE_TENSORS",
		14: "TYPE_PROTOS",
	}
	AttributeProto_AttributeType_value = map[string]int32{
		"UNDEFINED":      0,
		"FLOAT":          1,
		"INT":            2,
		"STRING":         3,
		"TENSOR":         4,
		"GRAPH":          5,
		"SPARSE_TENSOR":  11,
		"TYPE_PROTO":     13,
		"FLOATS":         6,
		"INTS":           7,
		"STRINGS":        8,
		"TENSORS":        9,
		"GRAPHS":         10,
		"SPARSE_TENSORS": 12,
		"TYPE_PROTOS":    14,
	}
)

Enum value maps for AttributeProto_AttributeType.

View Source
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",
		17: "FLOAT8E4M3FN",
		18: "FLOAT8E4M3FNUZ",
		19: "FLOAT8E5M2",
		20: "FLOAT8E5M2FNUZ",
		21: "UINT4",
		22: "INT4",
		23: "FLOAT4E2M1",
	}
	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,
		"FLOAT8E4M3FN":   17,
		"FLOAT8E4M3FNUZ": 18,
		"FLOAT8E5M2":     19,
		"FLOAT8E5M2FNUZ": 20,
		"UINT4":          21,
		"INT4":           22,
		"FLOAT4E2M1":     23,
	}
)

Enum value maps for TensorProto_DataType.

View Source
var (
	TensorProto_DataLocation_name = map[int32]string{
		0: "DEFAULT",
		1: "EXTERNAL",
	}
	TensorProto_DataLocation_value = map[string]int32{
		"DEFAULT":  0,
		"EXTERNAL": 1,
	}
)

Enum value maps for TensorProto_DataLocation.

View Source
var File_onnx_data_proto protoreflect.FileDescriptor
View Source
var File_onnx_ml_proto protoreflect.FileDescriptor
View Source
var File_onnx_operators_ml_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type AttributeProto

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"` // namespace Attribute
	// 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 heuristics 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 accommodate proto3 implementations.
	Type AttributeProto_AttributeType `protobuf:"varint,20,opt,name=type,proto3,enum=protos.AttributeProto_AttributeType" json:"type,omitempty"` // discriminator that indicates which field below is in use
	// 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"`                                          // float
	I            int64              `protobuf:"varint,3,opt,name=i,proto3" json:"i,omitempty"`                                           // int
	S            []byte             `protobuf:"bytes,4,opt,name=s,proto3" json:"s,omitempty"`                                            // UTF-8 string
	T            *TensorProto       `protobuf:"bytes,5,opt,name=t,proto3" json:"t,omitempty"`                                            // tensor value
	G            *GraphProto        `protobuf:"bytes,6,opt,name=g,proto3" json:"g,omitempty"`                                            // graph
	SparseTensor *SparseTensorProto `protobuf:"bytes,22,opt,name=sparse_tensor,json=sparseTensor,proto3" json:"sparse_tensor,omitempty"` // sparse tensor value
	// Do not use field below, it's deprecated.
	// optional ValueProto v = 12;         // value - subsumes everything but graph
	Tp            *TypeProto           `protobuf:"bytes,14,opt,name=tp,proto3" json:"tp,omitempty"`                                            // type proto
	Floats        []float32            `protobuf:"fixed32,7,rep,packed,name=floats,proto3" json:"floats,omitempty"`                            // list of floats
	Ints          []int64              `protobuf:"varint,8,rep,packed,name=ints,proto3" json:"ints,omitempty"`                                 // list of ints
	Strings       [][]byte             `protobuf:"bytes,9,rep,name=strings,proto3" json:"strings,omitempty"`                                   // list of UTF-8 strings
	Tensors       []*TensorProto       `protobuf:"bytes,10,rep,name=tensors,proto3" json:"tensors,omitempty"`                                  // list of tensors
	Graphs        []*GraphProto        `protobuf:"bytes,11,rep,name=graphs,proto3" json:"graphs,omitempty"`                                    // list of graph
	SparseTensors []*SparseTensorProto `protobuf:"bytes,23,rep,name=sparse_tensors,json=sparseTensors,proto3" json:"sparse_tensors,omitempty"` // list of sparse tensors
	TypeProtos    []*TypeProto         `protobuf:"bytes,15,rep,name=type_protos,json=typeProtos,proto3" json:"type_protos,omitempty"`          // list of type protos
	// contains filtered or unexported fields
}

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.

func (*AttributeProto) Descriptor deprecated

func (*AttributeProto) Descriptor() ([]byte, []int)

Deprecated: Use AttributeProto.ProtoReflect.Descriptor instead.

func (*AttributeProto) GetDocString

func (x *AttributeProto) GetDocString() string

func (*AttributeProto) GetF

func (x *AttributeProto) GetF() float32

func (*AttributeProto) GetFloats

func (x *AttributeProto) GetFloats() []float32

func (*AttributeProto) GetG

func (x *AttributeProto) GetG() *GraphProto

func (*AttributeProto) GetGraphs

func (x *AttributeProto) GetGraphs() []*GraphProto

func (*AttributeProto) GetI

func (x *AttributeProto) GetI() int64

func (*AttributeProto) GetInts

func (x *AttributeProto) GetInts() []int64

func (*AttributeProto) GetName

func (x *AttributeProto) GetName() string

func (*AttributeProto) GetRefAttrName

func (x *AttributeProto) GetRefAttrName() string

func (*AttributeProto) GetS

func (x *AttributeProto) GetS() []byte

func (*AttributeProto) GetSparseTensor

func (x *AttributeProto) GetSparseTensor() *SparseTensorProto

func (*AttributeProto) GetSparseTensors

func (x *AttributeProto) GetSparseTensors() []*SparseTensorProto

func (*AttributeProto) GetStrings

func (x *AttributeProto) GetStrings() [][]byte

func (*AttributeProto) GetT

func (x *AttributeProto) GetT() *TensorProto

func (*AttributeProto) GetTensors

func (x *AttributeProto) GetTensors() []*TensorProto

func (*AttributeProto) GetTp

func (x *AttributeProto) GetTp() *TypeProto

func (*AttributeProto) GetType

func (*AttributeProto) GetTypeProtos

func (x *AttributeProto) GetTypeProtos() []*TypeProto

func (*AttributeProto) ProtoMessage

func (*AttributeProto) ProtoMessage()

func (*AttributeProto) ProtoReflect

func (x *AttributeProto) ProtoReflect() protoreflect.Message

func (*AttributeProto) Reset

func (x *AttributeProto) Reset()

func (*AttributeProto) String

func (x *AttributeProto) String() string

type AttributeProto_AttributeType

type AttributeProto_AttributeType int32

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.

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_SPARSE_TENSOR  AttributeProto_AttributeType = 11
	AttributeProto_TYPE_PROTO     AttributeProto_AttributeType = 13
	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
	AttributeProto_SPARSE_TENSORS AttributeProto_AttributeType = 12
	AttributeProto_TYPE_PROTOS    AttributeProto_AttributeType = 14
)

func (AttributeProto_AttributeType) Descriptor

func (AttributeProto_AttributeType) Enum

func (AttributeProto_AttributeType) EnumDescriptor deprecated

func (AttributeProto_AttributeType) EnumDescriptor() ([]byte, []int)

Deprecated: Use AttributeProto_AttributeType.Descriptor instead.

func (AttributeProto_AttributeType) Number

func (AttributeProto_AttributeType) String

func (AttributeProto_AttributeType) Type

type FunctionProto

type FunctionProto struct {

	// The name of the function, similar to op_type in NodeProto.
	// This is part of the unique-id (domain, name, overload) of FunctionProtos in a model.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// The inputs and outputs of the function.
	Input  []string `protobuf:"bytes,4,rep,name=input,proto3" json:"input,omitempty"`
	Output []string `protobuf:"bytes,5,rep,name=output,proto3" json:"output,omitempty"`
	// The attribute parameters of the function.
	// It is for function parameters without default values.
	Attribute []string `protobuf:"bytes,6,rep,name=attribute,proto3" json:"attribute,omitempty"`
	// The attribute protos of the function.
	// It is for function attributes with default values.
	// A function attribute shall be represented either as
	// a string attribute or an AttributeProto, not both.
	AttributeProto []*AttributeProto `protobuf:"bytes,11,rep,name=attribute_proto,json=attributeProto,proto3" json:"attribute_proto,omitempty"`
	// The nodes in the function.
	Node []*NodeProto `protobuf:"bytes,7,rep,name=node,proto3" json:"node,omitempty"`
	// A human-readable documentation for this function. Markdown is allowed.
	DocString   string                `protobuf:"bytes,8,opt,name=doc_string,json=docString,proto3" json:"doc_string,omitempty"`
	OpsetImport []*OperatorSetIdProto `protobuf:"bytes,9,rep,name=opset_import,json=opsetImport,proto3" json:"opset_import,omitempty"`
	// The domain which this function belongs to.
	// This is part of the unique-id (domain, name, overload) of FunctionProtos in a model.
	Domain string `protobuf:"bytes,10,opt,name=domain,proto3" json:"domain,omitempty"`
	// The overload identifier of the function.
	// This is part of the unique-id (domain, name, overload) of FunctionProtos in a model.
	Overload string `protobuf:"bytes,13,opt,name=overload,proto3" json:"overload,omitempty"`
	// Information for the values in the function. The ValueInfoProto.name's
	// must be distinct and refer to names in the function (including inputs,
	// outputs, and intermediate values). It is optional for a value to appear
	// in value_info list.
	ValueInfo []*ValueInfoProto `protobuf:"bytes,12,rep,name=value_info,json=valueInfo,proto3" json:"value_info,omitempty"`
	// Named metadata values; keys should be distinct.
	MetadataProps []*StringStringEntryProto `protobuf:"bytes,14,rep,name=metadata_props,json=metadataProps,proto3" json:"metadata_props,omitempty"`
	// contains filtered or unexported fields
}

func (*FunctionProto) Descriptor deprecated

func (*FunctionProto) Descriptor() ([]byte, []int)

Deprecated: Use FunctionProto.ProtoReflect.Descriptor instead.

func (*FunctionProto) GetAttribute

func (x *FunctionProto) GetAttribute() []string

func (*FunctionProto) GetAttributeProto

func (x *FunctionProto) GetAttributeProto() []*AttributeProto

func (*FunctionProto) GetDocString

func (x *FunctionProto) GetDocString() string

func (*FunctionProto) GetDomain

func (x *FunctionProto) GetDomain() string

func (*FunctionProto) GetInput

func (x *FunctionProto) GetInput() []string

func (*FunctionProto) GetMetadataProps

func (x *FunctionProto) GetMetadataProps() []*StringStringEntryProto

func (*FunctionProto) GetName

func (x *FunctionProto) GetName() string

func (*FunctionProto) GetNode

func (x *FunctionProto) GetNode() []*NodeProto

func (*FunctionProto) GetOpsetImport

func (x *FunctionProto) GetOpsetImport() []*OperatorSetIdProto

func (*FunctionProto) GetOutput

func (x *FunctionProto) GetOutput() []string

func (*FunctionProto) GetOverload

func (x *FunctionProto) GetOverload() string

func (*FunctionProto) GetValueInfo

func (x *FunctionProto) GetValueInfo() []*ValueInfoProto

func (*FunctionProto) ProtoMessage

func (*FunctionProto) ProtoMessage()

func (*FunctionProto) ProtoReflect

func (x *FunctionProto) ProtoReflect() protoreflect.Message

func (*FunctionProto) Reset

func (x *FunctionProto) Reset()

func (*FunctionProto) String

func (x *FunctionProto) String() string

type GraphProto

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"` // namespace Graph
	// A list of named tensor values, used to specify constant inputs of the graph.
	// Each initializer (both TensorProto as well SparseTensorProto) MUST have a name.
	// The name MUST be unique across both initializer and sparse_initializer,
	// but the name MAY also appear in the input list.
	Initializer []*TensorProto `protobuf:"bytes,5,rep,name=initializer,proto3" json:"initializer,omitempty"`
	// Initializers (see above) stored in sparse format.
	SparseInitializer []*SparseTensorProto `protobuf:"bytes,15,rep,name=sparse_initializer,json=sparseInitializer,proto3" json:"sparse_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"`
	// This field carries information to indicate the mapping among a tensor and its
	// quantization parameter tensors. For example:
	// For tensor 'a', it may have {'SCALE_TENSOR', 'a_scale'} and {'ZERO_POINT_TENSOR', 'a_zero_point'} annotated,
	// which means, tensor 'a_scale' and tensor 'a_zero_point' are scale and zero point of tensor 'a' in the model.
	QuantizationAnnotation []*TensorAnnotation `` /* 128-byte string literal not displayed */
	// Named metadata values; keys should be distinct.
	MetadataProps []*StringStringEntryProto `protobuf:"bytes,16,rep,name=metadata_props,json=metadataProps,proto3" json:"metadata_props,omitempty"`
	// contains filtered or unexported fields
}

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.

func (*GraphProto) Descriptor deprecated

func (*GraphProto) Descriptor() ([]byte, []int)

Deprecated: Use GraphProto.ProtoReflect.Descriptor instead.

func (*GraphProto) GetDocString

func (x *GraphProto) GetDocString() string

func (*GraphProto) GetInitializer

func (x *GraphProto) GetInitializer() []*TensorProto

func (*GraphProto) GetInput

func (x *GraphProto) GetInput() []*ValueInfoProto

func (*GraphProto) GetMetadataProps

func (x *GraphProto) GetMetadataProps() []*StringStringEntryProto

func (*GraphProto) GetName

func (x *GraphProto) GetName() string

func (*GraphProto) GetNode

func (x *GraphProto) GetNode() []*NodeProto

func (*GraphProto) GetOutput

func (x *GraphProto) GetOutput() []*ValueInfoProto

func (*GraphProto) GetQuantizationAnnotation

func (x *GraphProto) GetQuantizationAnnotation() []*TensorAnnotation

func (*GraphProto) GetSparseInitializer

func (x *GraphProto) GetSparseInitializer() []*SparseTensorProto

func (*GraphProto) GetValueInfo

func (x *GraphProto) GetValueInfo() []*ValueInfoProto

func (*GraphProto) ProtoMessage

func (*GraphProto) ProtoMessage()

func (*GraphProto) ProtoReflect

func (x *GraphProto) ProtoReflect() protoreflect.Message

func (*GraphProto) Reset

func (x *GraphProto) Reset()

func (*GraphProto) String

func (x *GraphProto) String() string

type MapProto

type MapProto struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// The data type of the key.
	// This field MUST have a valid TensorProto.DataType value of
	// INT8, INT16, INT32, INT64, UINT8, UINT16, UINT32, UINT64, or STRING
	KeyType int32 `protobuf:"varint,2,opt,name=key_type,json=keyType,proto3" json:"key_type,omitempty"`
	// Every element of keys has to be one of the following data types
	// INT8, INT16, INT32, INT64, UINT8, UINT16, UINT32, UINT64, or STRING.
	// The integer cases are represented by the repeated int64 field keys below.
	Keys []int64 `protobuf:"varint,3,rep,packed,name=keys,proto3" json:"keys,omitempty"`
	// If keys are strings, they are represented by the repeated bytes field
	// string_keys below.
	StringKeys [][]byte `protobuf:"bytes,4,rep,name=string_keys,json=stringKeys,proto3" json:"string_keys,omitempty"`
	// MapProto values are represented in a SequenceProto of the same length as the
	// repeated keys field and have to be one of the following data types
	// TENSOR, SPARSE_TENSOR, MAP, SEQUENCE.
	Values *SequenceProto `protobuf:"bytes,5,opt,name=values,proto3" json:"values,omitempty"`
	// contains filtered or unexported fields
}

Maps

Specifies an associative table, defined by keys and values. MapProto is formed with a repeated field of keys (of type INT8, INT16, INT32, INT64, UINT8, UINT16, UINT32, UINT64, or STRING) and values (of type TENSOR, SPARSE_TENSOR, SEQUENCE, or MAP). Key types and value types have to remain the same throughout the instantiation of the MapProto.

func (*MapProto) Descriptor deprecated

func (*MapProto) Descriptor() ([]byte, []int)

Deprecated: Use MapProto.ProtoReflect.Descriptor instead.

func (*MapProto) GetKeyType

func (x *MapProto) GetKeyType() int32

func (*MapProto) GetKeys

func (x *MapProto) GetKeys() []int64

func (*MapProto) GetName

func (x *MapProto) GetName() string

func (*MapProto) GetStringKeys

func (x *MapProto) GetStringKeys() [][]byte

func (*MapProto) GetValues

func (x *MapProto) GetValues() *SequenceProto

func (*MapProto) ProtoMessage

func (*MapProto) ProtoMessage()

func (*MapProto) ProtoReflect

func (x *MapProto) ProtoReflect() protoreflect.Message

func (*MapProto) Reset

func (x *MapProto) Reset()

func (*MapProto) String

func (x *MapProto) String() string

type ModelProto

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"`
	// Training-specific information. Sequentially executing all stored
	// `TrainingInfoProto.algorithm`s and assigning their outputs following
	// the corresponding `TrainingInfoProto.update_binding`s is one training
	// iteration. Similarly, to initialize the model
	// (as if training hasn't happened), the user should sequentially execute
	// all stored `TrainingInfoProto.initialization`s and assigns their outputs
	// using `TrainingInfoProto.initialization_binding`s.
	//
	// If this field is empty, the training behavior of the model is undefined.
	TrainingInfo []*TrainingInfoProto `protobuf:"bytes,20,rep,name=training_info,json=trainingInfo,proto3" json:"training_info,omitempty"`
	// A list of function protos local to the model.
	//
	// The (domain, name, overload) tuple must be unique across the function protos in this list.
	// In case of any conflicts the behavior (whether the model local functions are given higher priority,
	// or standard operator sets are given higher priotity or this is treated as error) is defined by
	// the runtimes.
	//
	// The operator sets imported by FunctionProto should be compatible with the ones
	// imported by ModelProto and other model local FunctionProtos.
	// Example, if same operator set say 'A' is imported by a FunctionProto and ModelProto
	// or by 2 FunctionProtos then versions for the operator set may be different but,
	// the operator schema returned for op_type, domain, version combination
	// for both the versions should be same for every node in the function body.
	//
	// One FunctionProto can reference other FunctionProto in the model, however, recursive reference
	// is not allowed.
	Functions []*FunctionProto `protobuf:"bytes,25,rep,name=functions,proto3" json:"functions,omitempty"`
	// contains filtered or unexported fields
}

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's.

func (*ModelProto) Descriptor deprecated

func (*ModelProto) Descriptor() ([]byte, []int)

Deprecated: Use ModelProto.ProtoReflect.Descriptor instead.

func (*ModelProto) GetDocString

func (x *ModelProto) GetDocString() string

func (*ModelProto) GetDomain

func (x *ModelProto) GetDomain() string

func (*ModelProto) GetFunctions

func (x *ModelProto) GetFunctions() []*FunctionProto

func (*ModelProto) GetGraph

func (x *ModelProto) GetGraph() *GraphProto

func (*ModelProto) GetIrVersion

func (x *ModelProto) GetIrVersion() int64

func (*ModelProto) GetMetadataProps

func (x *ModelProto) GetMetadataProps() []*StringStringEntryProto

func (*ModelProto) GetModelVersion

func (x *ModelProto) GetModelVersion() int64

func (*ModelProto) GetOpsetImport

func (x *ModelProto) GetOpsetImport() []*OperatorSetIdProto

func (*ModelProto) GetProducerName

func (x *ModelProto) GetProducerName() string

func (*ModelProto) GetProducerVersion

func (x *ModelProto) GetProducerVersion() string

func (*ModelProto) GetTrainingInfo

func (x *ModelProto) GetTrainingInfo() []*TrainingInfoProto

func (*ModelProto) ProtoMessage

func (*ModelProto) ProtoMessage()

func (*ModelProto) ProtoReflect

func (x *ModelProto) ProtoReflect() protoreflect.Message

func (*ModelProto) Reset

func (x *ModelProto) Reset()

func (*ModelProto) String

func (x *ModelProto) String() string

type NodeProto

type NodeProto struct {
	Input  []string `protobuf:"bytes,1,rep,name=input,proto3" json:"input,omitempty"`   // namespace Value
	Output []string `protobuf:"bytes,2,rep,name=output,proto3" json:"output,omitempty"` // namespace Value
	// An optional identifier for this node in a graph.
	// This field MAY be absent in this version of the IR.
	Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` // namespace Node
	// The symbolic identifier of the Operator to execute.
	OpType string `protobuf:"bytes,4,opt,name=op_type,json=opType,proto3" json:"op_type,omitempty"` // namespace Operator
	// 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"` // namespace Domain
	// Overload identifier, used only to map this to a model-local function.
	Overload string `protobuf:"bytes,8,opt,name=overload,proto3" json:"overload,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"`
	// Named metadata values; keys should be distinct.
	MetadataProps []*StringStringEntryProto `protobuf:"bytes,9,rep,name=metadata_props,json=metadataProps,proto3" json:"metadata_props,omitempty"`
	// contains filtered or unexported fields
}

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.

func (*NodeProto) Descriptor deprecated

func (*NodeProto) Descriptor() ([]byte, []int)

Deprecated: Use NodeProto.ProtoReflect.Descriptor instead.

func (*NodeProto) GetAttribute

func (x *NodeProto) GetAttribute() []*AttributeProto

func (*NodeProto) GetDocString

func (x *NodeProto) GetDocString() string

func (*NodeProto) GetDomain

func (x *NodeProto) GetDomain() string

func (*NodeProto) GetInput

func (x *NodeProto) GetInput() []string

func (*NodeProto) GetMetadataProps

func (x *NodeProto) GetMetadataProps() []*StringStringEntryProto

func (*NodeProto) GetName

func (x *NodeProto) GetName() string

func (*NodeProto) GetOpType

func (x *NodeProto) GetOpType() string

func (*NodeProto) GetOutput

func (x *NodeProto) GetOutput() []string

func (*NodeProto) GetOverload

func (x *NodeProto) GetOverload() string

func (*NodeProto) ProtoMessage

func (*NodeProto) ProtoMessage()

func (*NodeProto) ProtoReflect

func (x *NodeProto) ProtoReflect() protoreflect.Message

func (*NodeProto) Reset

func (x *NodeProto) Reset()

func (*NodeProto) String

func (x *NodeProto) String() string

type OperatorProto

type OperatorProto struct {

	// The name of the operator within a domain.
	// This field MUST be present in this version of the IR.
	OpType string `protobuf:"bytes,1,opt,name=op_type,json=opType,proto3" json:"op_type,omitempty"`
	// The version of the operator set that first introduced this
	// operator. This value MUST be the same value as the
	// opset_version of the operator set that first published this operator.
	// Subsequent versions of the operator set MUST NOT alter the signature
	// or semantics of the operator once published as STABLE.
	// This field MUST be present in this version of the IR.
	SinceVersion int64 `protobuf:"varint,2,opt,name=since_version,json=sinceVersion,proto3" json:"since_version,omitempty"`
	// This field indicates whether the syntax, semantics, or presence
	// of this operator is in an experimental or stable stage. Once an
	// operator is published as STABLE, it's syntax and semantics MUST NOT
	// change in subsequent versions of the operator set.
	// When an operator is published as EXPERIMENTAL, the syntax and semantics
	// of the operator MAY change across operator set versions.
	// Operators "become" stable by deprecating the experimental version and
	// introducing a new stable operator with the same op_type.
	Status OperatorStatus `protobuf:"varint,3,opt,name=status,proto3,enum=protos.OperatorStatus" json:"status,omitempty"`
	// A human-readable documentation for this operator. Markdown is allowed.
	DocString string `protobuf:"bytes,10,opt,name=doc_string,json=docString,proto3" json:"doc_string,omitempty"`
	// contains filtered or unexported fields
}

An OperatorProto represents the immutable specification of the signature and semantics of an operator.

Operators are declared as part of an OperatorSet, which also defines the domain name for the set.

Operators are uniquely identified by a three part identifier

(domain, op_type, since_version)

where

*domain* is the domain of an operator set that
   contains this operator specification.

*op_type* is the name of the operator as referenced by a
   NodeProto.op_type

*since_version* is the version of the operator set that
   this operator was initially declared in.

func (*OperatorProto) Descriptor deprecated

func (*OperatorProto) Descriptor() ([]byte, []int)

Deprecated: Use OperatorProto.ProtoReflect.Descriptor instead.

func (*OperatorProto) GetDocString

func (x *OperatorProto) GetDocString() string

func (*OperatorProto) GetOpType

func (x *OperatorProto) GetOpType() string

func (*OperatorProto) GetSinceVersion

func (x *OperatorProto) GetSinceVersion() int64

func (*OperatorProto) GetStatus

func (x *OperatorProto) GetStatus() OperatorStatus

func (*OperatorProto) ProtoMessage

func (*OperatorProto) ProtoMessage()

func (*OperatorProto) ProtoReflect

func (x *OperatorProto) ProtoReflect() protoreflect.Message

func (*OperatorProto) Reset

func (x *OperatorProto) Reset()

func (*OperatorProto) String

func (x *OperatorProto) String() string

type OperatorSetIdProto

type OperatorSetIdProto struct {

	// The domain of the operator set being identified.
	// The empty string ("") or absence of this field implies the operator
	// set that is defined as part of the ONNX specification.
	// This field MUST be present in this version of the IR when referring to any other operator set.
	Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain,omitempty"`
	// The version of the operator set being identified.
	// This field MUST be present in this version of the IR.
	Version int64 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
	// contains filtered or unexported fields
}

Operator Sets

OperatorSets are uniquely identified by a (domain, opset_version) pair.

func (*OperatorSetIdProto) Descriptor deprecated

func (*OperatorSetIdProto) Descriptor() ([]byte, []int)

Deprecated: Use OperatorSetIdProto.ProtoReflect.Descriptor instead.

func (*OperatorSetIdProto) GetDomain

func (x *OperatorSetIdProto) GetDomain() string

func (*OperatorSetIdProto) GetVersion

func (x *OperatorSetIdProto) GetVersion() int64

func (*OperatorSetIdProto) ProtoMessage

func (*OperatorSetIdProto) ProtoMessage()

func (*OperatorSetIdProto) ProtoReflect

func (x *OperatorSetIdProto) ProtoReflect() protoreflect.Message

func (*OperatorSetIdProto) Reset

func (x *OperatorSetIdProto) Reset()

func (*OperatorSetIdProto) String

func (x *OperatorSetIdProto) String() string

type OperatorSetProto

type OperatorSetProto struct {

	// All OperatorSetProtos start with a distingushed byte sequence to disambiguate
	// protobuf files containing OperatorSets from other content.
	// This field MUST be "ONNXOPSET"
	// This field MUST be present in this version of the IR
	Magic string `protobuf:"bytes,1,opt,name=magic,proto3" json:"magic,omitempty"`
	// All OperatorSetProtos indicate the version of the IR syntax and semantics
	// they adhere to. It is always IR_VERSION.
	// This field MUST be present in this version of the IR
	IrVersion int64 `protobuf:"varint,2,opt,name=ir_version,json=irVersion,proto3" json:"ir_version,omitempty"`
	// The prerelease component of the SemVer of the IR.
	// This field MAY be absent in this version of the IR
	IrVersionPrerelease string `protobuf:"bytes,3,opt,name=ir_version_prerelease,json=irVersionPrerelease,proto3" json:"ir_version_prerelease,omitempty"`
	// The build metadata component of the SemVer of the IR.
	// This field MAY be absent in this version of the IR
	IrBuildMetadata string `protobuf:"bytes,7,opt,name=ir_build_metadata,json=irBuildMetadata,proto3" json:"ir_build_metadata,omitempty"`
	// Domain name of the operator set, in reverse DNS form (e.g., com.acme.dnnops).
	Domain string `protobuf:"bytes,4,opt,name=domain,proto3" json:"domain,omitempty"`
	// The version of the set of operators. This is a simple int value
	// that is monotonically increasing as new versions of the operator set
	// are published. All operators in this set MUST have since_version
	// <= opset_version.
	OpsetVersion int64 `protobuf:"varint,5,opt,name=opset_version,json=opsetVersion,proto3" json:"opset_version,omitempty"`
	// A human-readable documentation for this set of operators. Markdown is allowed.
	DocString string `protobuf:"bytes,6,opt,name=doc_string,json=docString,proto3" json:"doc_string,omitempty"`
	// The operators specified by this operator set.
	// The (name, version) MUST be unique across all OperatorProtos in operator
	Operator []*OperatorProto `protobuf:"bytes,8,rep,name=operator,proto3" json:"operator,omitempty"`
	// The functions specified by this operator set.
	// The (name, version) MUST be unique across all OperatorProtos/FunctionProtos in operator/functions
	Functions []*FunctionProto `protobuf:"bytes,9,rep,name=functions,proto3" json:"functions,omitempty"`
	// contains filtered or unexported fields
}

An OperatorSetProto represents an immutable set of immutable operator specifications.

The domain of the set (OperatorSetProto.domain) is a reverse-DNS name that disambiguates operator sets defined by independent entities.

The version of the set (opset_version) is a monotonically increasing integer that indicates changes to the membership of the operator set.

Operator sets are uniquely identified by a two part identifier (domain, opset_version)

Like ModelProto, OperatorSetProto is intended as a top-level file/wire format, and thus has the standard format headers in addition to the operator set information.

func (*OperatorSetProto) Descriptor deprecated

func (*OperatorSetProto) Descriptor() ([]byte, []int)

Deprecated: Use OperatorSetProto.ProtoReflect.Descriptor instead.

func (*OperatorSetProto) GetDocString

func (x *OperatorSetProto) GetDocString() string

func (*OperatorSetProto) GetDomain

func (x *OperatorSetProto) GetDomain() string

func (*OperatorSetProto) GetFunctions

func (x *OperatorSetProto) GetFunctions() []*FunctionProto

func (*OperatorSetProto) GetIrBuildMetadata

func (x *OperatorSetProto) GetIrBuildMetadata() string

func (*OperatorSetProto) GetIrVersion

func (x *OperatorSetProto) GetIrVersion() int64

func (*OperatorSetProto) GetIrVersionPrerelease

func (x *OperatorSetProto) GetIrVersionPrerelease() string

func (*OperatorSetProto) GetMagic

func (x *OperatorSetProto) GetMagic() string

func (*OperatorSetProto) GetOperator

func (x *OperatorSetProto) GetOperator() []*OperatorProto

func (*OperatorSetProto) GetOpsetVersion

func (x *OperatorSetProto) GetOpsetVersion() int64

func (*OperatorSetProto) ProtoMessage

func (*OperatorSetProto) ProtoMessage()

func (*OperatorSetProto) ProtoReflect

func (x *OperatorSetProto) ProtoReflect() protoreflect.Message

func (*OperatorSetProto) Reset

func (x *OperatorSetProto) Reset()

func (*OperatorSetProto) String

func (x *OperatorSetProto) String() string

type OperatorStatus

type OperatorStatus int32

Operator/function status.

const (
	OperatorStatus_EXPERIMENTAL OperatorStatus = 0
	OperatorStatus_STABLE       OperatorStatus = 1
)

func (OperatorStatus) Descriptor

func (OperatorStatus) Enum

func (x OperatorStatus) Enum() *OperatorStatus

func (OperatorStatus) EnumDescriptor deprecated

func (OperatorStatus) EnumDescriptor() ([]byte, []int)

Deprecated: Use OperatorStatus.Descriptor instead.

func (OperatorStatus) Number

func (OperatorStatus) String

func (x OperatorStatus) String() string

func (OperatorStatus) Type

type OptionalProto

type OptionalProto struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// The data type of the element, identifies if the OptionalProto value
	// is Tensor, Sparse Tensor, Sequence, Map, or Optional.
	// The type of the optional value MUST match the elem_type specified.
	// This field MUST have a valid OptionalProto.DataType value.
	ElemType int32 `protobuf:"varint,2,opt,name=elem_type,json=elemType,proto3" json:"elem_type,omitempty"`
	// For TensorProto value.
	// When this field is present, the elem_type field MUST be TENSOR.
	TensorValue *TensorProto `protobuf:"bytes,3,opt,name=tensor_value,json=tensorValue,proto3" json:"tensor_value,omitempty"`
	// For SparseTensorProto value.
	// When this field is present, the elem_type field MUST be SPARSE_TENSOR.
	SparseTensorValue *SparseTensorProto `protobuf:"bytes,4,opt,name=sparse_tensor_value,json=sparseTensorValue,proto3" json:"sparse_tensor_value,omitempty"`
	// For SequenceProto value.
	// When this field is present, the elem_type field MUST be SEQUENCE.
	SequenceValue *SequenceProto `protobuf:"bytes,5,opt,name=sequence_value,json=sequenceValue,proto3" json:"sequence_value,omitempty"`
	// For MapProto value.
	// When this field is present, the elem_type field MUST be MAP.
	MapValue *MapProto `protobuf:"bytes,6,opt,name=map_value,json=mapValue,proto3" json:"map_value,omitempty"`
	// For OptionalProto value, allowing optional to be of itself (completeness)
	// When this field is present, the elem_type field MUST be OPTIONAL.
	OptionalValue *OptionalProto `protobuf:"bytes,7,opt,name=optional_value,json=optionalValue,proto3" json:"optional_value,omitempty"`
	// contains filtered or unexported fields
}

Optional

func (*OptionalProto) Descriptor deprecated

func (*OptionalProto) Descriptor() ([]byte, []int)

Deprecated: Use OptionalProto.ProtoReflect.Descriptor instead.

func (*OptionalProto) GetElemType

func (x *OptionalProto) GetElemType() int32

func (*OptionalProto) GetMapValue

func (x *OptionalProto) GetMapValue() *MapProto

func (*OptionalProto) GetName

func (x *OptionalProto) GetName() string

func (*OptionalProto) GetOptionalValue

func (x *OptionalProto) GetOptionalValue() *OptionalProto

func (*OptionalProto) GetSequenceValue

func (x *OptionalProto) GetSequenceValue() *SequenceProto

func (*OptionalProto) GetSparseTensorValue

func (x *OptionalProto) GetSparseTensorValue() *SparseTensorProto

func (*OptionalProto) GetTensorValue

func (x *OptionalProto) GetTensorValue() *TensorProto

func (*OptionalProto) ProtoMessage

func (*OptionalProto) ProtoMessage()

func (*OptionalProto) ProtoReflect

func (x *OptionalProto) ProtoReflect() protoreflect.Message

func (*OptionalProto) Reset

func (x *OptionalProto) Reset()

func (*OptionalProto) String

func (x *OptionalProto) String() string

type OptionalProto_DataType

type OptionalProto_DataType int32
const (
	OptionalProto_UNDEFINED     OptionalProto_DataType = 0
	OptionalProto_TENSOR        OptionalProto_DataType = 1
	OptionalProto_SPARSE_TENSOR OptionalProto_DataType = 2
	OptionalProto_SEQUENCE      OptionalProto_DataType = 3
	OptionalProto_MAP           OptionalProto_DataType = 4
	OptionalProto_OPTIONAL      OptionalProto_DataType = 5
)

func (OptionalProto_DataType) Descriptor

func (OptionalProto_DataType) Enum

func (OptionalProto_DataType) EnumDescriptor deprecated

func (OptionalProto_DataType) EnumDescriptor() ([]byte, []int)

Deprecated: Use OptionalProto_DataType.Descriptor instead.

func (OptionalProto_DataType) Number

func (OptionalProto_DataType) String

func (x OptionalProto_DataType) String() string

func (OptionalProto_DataType) Type

type SequenceProto

type SequenceProto struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// The data type of the element.
	// This field MUST have a valid SequenceProto.DataType value
	ElemType int32 `protobuf:"varint,2,opt,name=elem_type,json=elemType,proto3" json:"elem_type,omitempty"`
	// For TensorProto values.
	// When this field is present, the elem_type field MUST be TENSOR.
	TensorValues []*TensorProto `protobuf:"bytes,3,rep,name=tensor_values,json=tensorValues,proto3" json:"tensor_values,omitempty"`
	// For SparseTensorProto values.
	// When this field is present, the elem_type field MUST be SPARSE_TENSOR.
	SparseTensorValues []*SparseTensorProto `protobuf:"bytes,4,rep,name=sparse_tensor_values,json=sparseTensorValues,proto3" json:"sparse_tensor_values,omitempty"`
	// For SequenceProto values, allowing sequences to be of themselves.
	// When this field is present, the elem_type field MUST be SEQUENCE.
	SequenceValues []*SequenceProto `protobuf:"bytes,5,rep,name=sequence_values,json=sequenceValues,proto3" json:"sequence_values,omitempty"`
	// For MapProto values.
	// When this field is present, the elem_type field MUST be MAP.
	MapValues []*MapProto `protobuf:"bytes,6,rep,name=map_values,json=mapValues,proto3" json:"map_values,omitempty"`
	// For OptionalProto values.
	// When this field is present, the elem_type field MUST be Optional.
	OptionalValues []*OptionalProto `protobuf:"bytes,7,rep,name=optional_values,json=optionalValues,proto3" json:"optional_values,omitempty"`
	// contains filtered or unexported fields
}

Sequences

Defines a dense, ordered, collection of elements that are of homogeneous types. Sequences can be made out of tensors, maps, or sequences.

If a sequence is made out of tensors, the tensors must have the same element type (i.e. int32). In some cases, the tensors in a sequence can have different shapes. Whether the tensors can have different shapes or not depends on the type/shape associated with the corresponding "ValueInfo". For example, "Sequence<Tensor<float, [M,N]>" means that all tensors have same shape. However, "Sequence<Tensor<float, [omitted,omitted]>" means they can have different shapes (all of rank 2), where "omitted" means the corresponding dimension has no symbolic/constant value. Finally, "Sequence<Tensor<float, omitted>>" means that the different tensors can have different ranks, when the "shape" itself is omitted from the tensor-type. For a more complete description, refer to https://github.com/onnx/onnx/blob/main/docs/IR.md#static-tensor-shapes.

func (*SequenceProto) Descriptor deprecated

func (*SequenceProto) Descriptor() ([]byte, []int)

Deprecated: Use SequenceProto.ProtoReflect.Descriptor instead.

func (*SequenceProto) GetElemType

func (x *SequenceProto) GetElemType() int32

func (*SequenceProto) GetMapValues

func (x *SequenceProto) GetMapValues() []*MapProto

func (*SequenceProto) GetName

func (x *SequenceProto) GetName() string

func (*SequenceProto) GetOptionalValues

func (x *SequenceProto) GetOptionalValues() []*OptionalProto

func (*SequenceProto) GetSequenceValues

func (x *SequenceProto) GetSequenceValues() []*SequenceProto

func (*SequenceProto) GetSparseTensorValues

func (x *SequenceProto) GetSparseTensorValues() []*SparseTensorProto

func (*SequenceProto) GetTensorValues

func (x *SequenceProto) GetTensorValues() []*TensorProto

func (*SequenceProto) ProtoMessage

func (*SequenceProto) ProtoMessage()

func (*SequenceProto) ProtoReflect

func (x *SequenceProto) ProtoReflect() protoreflect.Message

func (*SequenceProto) Reset

func (x *SequenceProto) Reset()

func (*SequenceProto) String

func (x *SequenceProto) String() string

type SequenceProto_DataType

type SequenceProto_DataType int32
const (
	SequenceProto_UNDEFINED     SequenceProto_DataType = 0
	SequenceProto_TENSOR        SequenceProto_DataType = 1
	SequenceProto_SPARSE_TENSOR SequenceProto_DataType = 2
	SequenceProto_SEQUENCE      SequenceProto_DataType = 3
	SequenceProto_MAP           SequenceProto_DataType = 4
	SequenceProto_OPTIONAL      SequenceProto_DataType = 5
)

func (SequenceProto_DataType) Descriptor

func (SequenceProto_DataType) Enum

func (SequenceProto_DataType) EnumDescriptor deprecated

func (SequenceProto_DataType) EnumDescriptor() ([]byte, []int)

Deprecated: Use SequenceProto_DataType.Descriptor instead.

func (SequenceProto_DataType) Number

func (SequenceProto_DataType) String

func (x SequenceProto_DataType) String() string

func (SequenceProto_DataType) Type

type SparseTensorProto

type SparseTensorProto struct {

	// The sequence of non-default values are encoded as a tensor of shape [NNZ].
	// The default-value is zero for numeric tensors, and empty-string for string tensors.
	// values must have a non-empty name present which serves as a name for SparseTensorProto
	// when used in sparse_initializer list.
	Values *TensorProto `protobuf:"bytes,1,opt,name=values,proto3" json:"values,omitempty"`
	// The indices of the non-default values, which may be stored in one of two formats.
	// (a) Indices can be a tensor of shape [NNZ, rank] with the [i,j]-th value
	// corresponding to the j-th index of the i-th value (in the values tensor).
	// (b) Indices can be a tensor of shape [NNZ], in which case the i-th value
	// must be the linearized-index of the i-th value (in the values tensor).
	// The linearized-index can be converted into an index tuple (k_1,...,k_rank)
	// using the shape provided below.
	// The indices must appear in ascending order without duplication.
	// In the first format, the ordering is lexicographic-ordering:
	// e.g., index-value [1,4] must appear before [2,1]
	Indices *TensorProto `protobuf:"bytes,2,opt,name=indices,proto3" json:"indices,omitempty"`
	// The shape of the underlying dense-tensor: [dim_1, dim_2, ... dim_rank]
	Dims []int64 `protobuf:"varint,3,rep,packed,name=dims,proto3" json:"dims,omitempty"`
	// contains filtered or unexported fields
}

A serialized sparse-tensor value

func (*SparseTensorProto) Descriptor deprecated

func (*SparseTensorProto) Descriptor() ([]byte, []int)

Deprecated: Use SparseTensorProto.ProtoReflect.Descriptor instead.

func (*SparseTensorProto) GetDims

func (x *SparseTensorProto) GetDims() []int64

func (*SparseTensorProto) GetIndices

func (x *SparseTensorProto) GetIndices() *TensorProto

func (*SparseTensorProto) GetValues

func (x *SparseTensorProto) GetValues() *TensorProto

func (*SparseTensorProto) ProtoMessage

func (*SparseTensorProto) ProtoMessage()

func (*SparseTensorProto) ProtoReflect

func (x *SparseTensorProto) ProtoReflect() protoreflect.Message

func (*SparseTensorProto) Reset

func (x *SparseTensorProto) Reset()

func (*SparseTensorProto) String

func (x *SparseTensorProto) String() string

type StringStringEntryProto

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"`
	// contains filtered or unexported fields
}

StringStringEntryProto follows the pattern for cross-proto-version maps. See https://developers.google.com/protocol-buffers/docs/proto3#maps

func (*StringStringEntryProto) Descriptor deprecated

func (*StringStringEntryProto) Descriptor() ([]byte, []int)

Deprecated: Use StringStringEntryProto.ProtoReflect.Descriptor instead.

func (*StringStringEntryProto) GetKey

func (x *StringStringEntryProto) GetKey() string

func (*StringStringEntryProto) GetValue

func (x *StringStringEntryProto) GetValue() string

func (*StringStringEntryProto) ProtoMessage

func (*StringStringEntryProto) ProtoMessage()

func (*StringStringEntryProto) ProtoReflect

func (x *StringStringEntryProto) ProtoReflect() protoreflect.Message

func (*StringStringEntryProto) Reset

func (x *StringStringEntryProto) Reset()

func (*StringStringEntryProto) String

func (x *StringStringEntryProto) String() string

type TensorAnnotation

type TensorAnnotation struct {
	TensorName string `protobuf:"bytes,1,opt,name=tensor_name,json=tensorName,proto3" json:"tensor_name,omitempty"`
	// <key, value> pairs to annotate tensor specified by <tensor_name> above.
	// The keys used in the mapping below must be pre-defined in ONNX spec.
	// For example, for 8-bit linear quantization case, 'SCALE_TENSOR', 'ZERO_POINT_TENSOR' will be pre-defined as
	// quantization parameter keys.
	QuantParameterTensorNames []*StringStringEntryProto `` /* 140-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*TensorAnnotation) Descriptor deprecated

func (*TensorAnnotation) Descriptor() ([]byte, []int)

Deprecated: Use TensorAnnotation.ProtoReflect.Descriptor instead.

func (*TensorAnnotation) GetQuantParameterTensorNames

func (x *TensorAnnotation) GetQuantParameterTensorNames() []*StringStringEntryProto

func (*TensorAnnotation) GetTensorName

func (x *TensorAnnotation) GetTensorName() string

func (*TensorAnnotation) ProtoMessage

func (*TensorAnnotation) ProtoMessage()

func (*TensorAnnotation) ProtoReflect

func (x *TensorAnnotation) ProtoReflect() protoreflect.Message

func (*TensorAnnotation) Reset

func (x *TensorAnnotation) Reset()

func (*TensorAnnotation) String

func (x *TensorAnnotation) String() string

type TensorProto

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 appearing 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, uint4, int4, bool, float8 and float16 values
	// float16 and float8 values must be bit-wise converted to an uint16_t prior
	// to writing to the buffer.
	// uint4 and int4 values must be packed to 4bitx2 prior to writing to the buffer, the first element is stored in
	// the 4 LSB and the second element is stored in the 4 MSB.
	// When this field is present, the data_type field MUST be
	// INT32, INT16, INT8, INT4, UINT16, UINT8, UINT4, BOOL, FLOAT16, BFLOAT16, FLOAT8E4M3FN, FLOAT8E4M3FNUZ, FLOAT8E5M2, FLOAT8E5M2FNUZ
	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"` // namespace Value
	// 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).
	// uint4 and int4 values must be packed to 4bitx2, the first element is stored in the 4 LSB and the second element is stored in the 4 MSB.
	//
	// 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"`
	// Data can be stored inside the protobuf file using type-specific fields or raw_data.
	// Alternatively, raw bytes data can be stored in an external file, using the external_data field.
	// external_data stores key-value pairs describing data location. Recognized keys are:
	//   - "location" (required) - POSIX filesystem path relative to the directory where the ONNX
	//     protobuf model was stored
	//   - "offset" (optional) - position of byte at which stored data begins. Integer stored as string.
	//     Offset values SHOULD be multiples 4096 (page size) to enable mmap support.
	//   - "length" (optional) - number of bytes containing data. Integer stored as string.
	//   - "checksum" (optional) - SHA1 digest of file specified in under 'location' key.
	ExternalData []*StringStringEntryProto `protobuf:"bytes,13,rep,name=external_data,json=externalData,proto3" json:"external_data,omitempty"`
	// If value not set, data is stored in raw_data (if set) otherwise in type-specified field.
	DataLocation TensorProto_DataLocation `` /* 136-byte string literal not displayed */
	// 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 appearing 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"`
	// Named metadata values; keys should be distinct.
	MetadataProps []*StringStringEntryProto `protobuf:"bytes,16,rep,name=metadata_props,json=metadataProps,proto3" json:"metadata_props,omitempty"`
	// contains filtered or unexported fields
}

Tensors

A serialized tensor value.

func (*TensorProto) Descriptor deprecated

func (*TensorProto) Descriptor() ([]byte, []int)

Deprecated: Use TensorProto.ProtoReflect.Descriptor instead.

func (*TensorProto) GetDataLocation

func (x *TensorProto) GetDataLocation() TensorProto_DataLocation

func (*TensorProto) GetDataType

func (x *TensorProto) GetDataType() int32

func (*TensorProto) GetDims

func (x *TensorProto) GetDims() []int64

func (*TensorProto) GetDocString

func (x *TensorProto) GetDocString() string

func (*TensorProto) GetDoubleData

func (x *TensorProto) GetDoubleData() []float64

func (*TensorProto) GetExternalData

func (x *TensorProto) GetExternalData() []*StringStringEntryProto

func (*TensorProto) GetFloatData

func (x *TensorProto) GetFloatData() []float32

func (*TensorProto) GetInt32Data

func (x *TensorProto) GetInt32Data() []int32

func (*TensorProto) GetInt64Data

func (x *TensorProto) GetInt64Data() []int64

func (*TensorProto) GetMetadataProps

func (x *TensorProto) GetMetadataProps() []*StringStringEntryProto

func (*TensorProto) GetName

func (x *TensorProto) GetName() string

func (*TensorProto) GetRawData

func (x *TensorProto) GetRawData() []byte

func (*TensorProto) GetSegment

func (x *TensorProto) GetSegment() *TensorProto_Segment

func (*TensorProto) GetStringData

func (x *TensorProto) GetStringData() [][]byte

func (*TensorProto) GetUint64Data

func (x *TensorProto) GetUint64Data() []uint64

func (*TensorProto) ProtoMessage

func (*TensorProto) ProtoMessage()

func (*TensorProto) ProtoReflect

func (x *TensorProto) ProtoReflect() protoreflect.Message

func (*TensorProto) Reset

func (x *TensorProto) Reset()

func (*TensorProto) String

func (x *TensorProto) String() string

type TensorProto_DataLocation

type TensorProto_DataLocation int32

Location of the data for this tensor. MUST be one of: - DEFAULT - data stored inside the protobuf message. Data is stored in raw_data (if set) otherwise in type-specified field. - EXTERNAL - data stored in an external location as described by external_data field.

const (
	TensorProto_DEFAULT  TensorProto_DataLocation = 0
	TensorProto_EXTERNAL TensorProto_DataLocation = 1
)

func (TensorProto_DataLocation) Descriptor

func (TensorProto_DataLocation) Enum

func (TensorProto_DataLocation) EnumDescriptor deprecated

func (TensorProto_DataLocation) EnumDescriptor() ([]byte, []int)

Deprecated: Use TensorProto_DataLocation.Descriptor instead.

func (TensorProto_DataLocation) Number

func (TensorProto_DataLocation) String

func (x TensorProto_DataLocation) String() string

func (TensorProto_DataLocation) Type

type TensorProto_DataType

type TensorProto_DataType int32
const (
	TensorProto_UNDEFINED TensorProto_DataType = 0
	// Basic types.
	TensorProto_FLOAT  TensorProto_DataType = 1 // float
	TensorProto_UINT8  TensorProto_DataType = 2 // uint8_t
	TensorProto_INT8   TensorProto_DataType = 3 // int8_t
	TensorProto_UINT16 TensorProto_DataType = 4 // uint16_t
	TensorProto_INT16  TensorProto_DataType = 5 // int16_t
	TensorProto_INT32  TensorProto_DataType = 6 // int32_t
	TensorProto_INT64  TensorProto_DataType = 7 // int64_t
	TensorProto_STRING TensorProto_DataType = 8 // string
	TensorProto_BOOL   TensorProto_DataType = 9 // bool
	// 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 // complex with float32 real and imaginary components
	TensorProto_COMPLEX128 TensorProto_DataType = 15 // complex with float64 real and imaginary components
	// 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
	// Non-IEEE floating-point format based on papers
	// FP8 Formats for Deep Learning, https://arxiv.org/abs/2209.05433,
	// 8-bit Numerical Formats For Deep Neural Networks, https://arxiv.org/pdf/2206.02915.pdf.
	// Operators supported FP8 are Cast, CastLike, QuantizeLinear, DequantizeLinear.
	// The computation usually happens inside a block quantize / dequantize
	// fused by the runtime.
	TensorProto_FLOAT8E4M3FN   TensorProto_DataType = 17 // float 8, mostly used for coefficients, supports nan, not inf
	TensorProto_FLOAT8E4M3FNUZ TensorProto_DataType = 18 // float 8, mostly used for coefficients, supports nan, not inf, no negative zero
	TensorProto_FLOAT8E5M2     TensorProto_DataType = 19 // follows IEEE 754, supports nan, inf, mostly used for gradients
	TensorProto_FLOAT8E5M2FNUZ TensorProto_DataType = 20 // follows IEEE 754, supports nan, not inf, mostly used for gradients, no negative zero
	// 4-bit integer data types
	TensorProto_UINT4 TensorProto_DataType = 21 // Unsigned integer in range [0, 15]
	TensorProto_INT4  TensorProto_DataType = 22 // Signed integer in range [-8, 7], using two's-complement representation
	// 4-bit floating point data types
	TensorProto_FLOAT4E2M1 TensorProto_DataType = 23
)

func (TensorProto_DataType) Descriptor

func (TensorProto_DataType) Enum

func (TensorProto_DataType) EnumDescriptor deprecated

func (TensorProto_DataType) EnumDescriptor() ([]byte, []int)

Deprecated: Use TensorProto_DataType.Descriptor instead.

func (TensorProto_DataType) Number

func (TensorProto_DataType) String

func (x TensorProto_DataType) String() string

func (TensorProto_DataType) Type

type TensorProto_Segment

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"`
	// contains filtered or unexported fields
}

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.

func (*TensorProto_Segment) Descriptor deprecated

func (*TensorProto_Segment) Descriptor() ([]byte, []int)

Deprecated: Use TensorProto_Segment.ProtoReflect.Descriptor instead.

func (*TensorProto_Segment) GetBegin

func (x *TensorProto_Segment) GetBegin() int64

func (*TensorProto_Segment) GetEnd

func (x *TensorProto_Segment) GetEnd() int64

func (*TensorProto_Segment) ProtoMessage

func (*TensorProto_Segment) ProtoMessage()

func (*TensorProto_Segment) ProtoReflect

func (x *TensorProto_Segment) ProtoReflect() protoreflect.Message

func (*TensorProto_Segment) Reset

func (x *TensorProto_Segment) Reset()

func (*TensorProto_Segment) String

func (x *TensorProto_Segment) String() string

type TensorShapeProto

type TensorShapeProto struct {
	Dim []*TensorShapeProto_Dimension `protobuf:"bytes,1,rep,name=dim,proto3" json:"dim,omitempty"`
	// contains filtered or unexported fields
}

Defines a tensor shape. A dimension can be either an integer value or a symbolic variable. A symbolic variable represents an unknown dimension.

func (*TensorShapeProto) Descriptor deprecated

func (*TensorShapeProto) Descriptor() ([]byte, []int)

Deprecated: Use TensorShapeProto.ProtoReflect.Descriptor instead.

func (*TensorShapeProto) GetDim

func (*TensorShapeProto) ProtoMessage

func (*TensorShapeProto) ProtoMessage()

func (*TensorShapeProto) ProtoReflect

func (x *TensorShapeProto) ProtoReflect() protoreflect.Message

func (*TensorShapeProto) Reset

func (x *TensorShapeProto) Reset()

func (*TensorShapeProto) String

func (x *TensorShapeProto) String() string

type TensorShapeProto_Dimension

type TensorShapeProto_Dimension struct {

	// Types that are assignable to Value:
	//
	//	*TensorShapeProto_Dimension_DimValue
	//	*TensorShapeProto_Dimension_DimParam
	Value isTensorShapeProto_Dimension_Value `protobuf_oneof:"value"`
	// Standard denotation can optionally be used to denote tensor
	// dimensions with standard semantic descriptions to ensure
	// that operations are applied to the correct axis of a tensor.
	// Refer to https://github.com/onnx/onnx/blob/main/docs/DimensionDenotation.md#denotation-definition
	// for pre-defined dimension denotations.
	Denotation string `protobuf:"bytes,3,opt,name=denotation,proto3" json:"denotation,omitempty"`
	// contains filtered or unexported fields
}

func (*TensorShapeProto_Dimension) Descriptor deprecated

func (*TensorShapeProto_Dimension) Descriptor() ([]byte, []int)

Deprecated: Use TensorShapeProto_Dimension.ProtoReflect.Descriptor instead.

func (*TensorShapeProto_Dimension) GetDenotation

func (x *TensorShapeProto_Dimension) GetDenotation() string

func (*TensorShapeProto_Dimension) GetDimParam

func (x *TensorShapeProto_Dimension) GetDimParam() string

func (*TensorShapeProto_Dimension) GetDimValue

func (x *TensorShapeProto_Dimension) GetDimValue() int64

func (*TensorShapeProto_Dimension) GetValue

func (m *TensorShapeProto_Dimension) GetValue() isTensorShapeProto_Dimension_Value

func (*TensorShapeProto_Dimension) ProtoMessage

func (*TensorShapeProto_Dimension) ProtoMessage()

func (*TensorShapeProto_Dimension) ProtoReflect

func (*TensorShapeProto_Dimension) Reset

func (x *TensorShapeProto_Dimension) Reset()

func (*TensorShapeProto_Dimension) String

func (x *TensorShapeProto_Dimension) String() string

type TensorShapeProto_Dimension_DimParam

type TensorShapeProto_Dimension_DimParam struct {
	DimParam string `protobuf:"bytes,2,opt,name=dim_param,json=dimParam,proto3,oneof"` // namespace Shape
}

type TensorShapeProto_Dimension_DimValue

type TensorShapeProto_Dimension_DimValue struct {
	DimValue int64 `protobuf:"varint,1,opt,name=dim_value,json=dimValue,proto3,oneof"`
}

type TrainingInfoProto

type TrainingInfoProto struct {

	// This field describes a graph to compute the initial tensors
	// upon starting the training process. Initialization graph has no input
	// and can have multiple outputs. Usually, trainable tensors in neural
	// networks are randomly initialized. To achieve that, for each tensor,
	// the user can put a random number operator such as RandomNormal or
	// RandomUniform in TrainingInfoProto.initialization.node and assign its
	// random output to the specific tensor using "initialization_binding".
	// This graph can also set the initializers in "algorithm" in the same
	// TrainingInfoProto; a use case is resetting the number of training
	// iteration to zero.
	//
	// By default, this field is an empty graph and its evaluation does not
	// produce any output. Thus, no initializer would be changed by default.
	Initialization *GraphProto `protobuf:"bytes,1,opt,name=initialization,proto3" json:"initialization,omitempty"`
	// This field represents a training algorithm step. Given required inputs,
	// it computes outputs to update initializers in its own or inference graph's
	// initializer lists. In general, this field contains loss node, gradient node,
	// optimizer node, increment of iteration count.
	//
	// An execution of the training algorithm step is performed by executing the
	// graph obtained by combining the inference graph (namely "ModelProto.graph")
	// and the "algorithm" graph. That is, the actual
	// input/initializer/output/node/value_info/sparse_initializer list of
	// the training graph is the concatenation of
	// "ModelProto.graph.input/initializer/output/node/value_info/sparse_initializer"
	// and "algorithm.input/initializer/output/node/value_info/sparse_initializer"
	// in that order. This combined graph must satisfy the normal ONNX conditions.
	// Now, let's provide a visualization of graph combination for clarity.
	// Let the inference graph (i.e., "ModelProto.graph") be
	//
	//	tensor_a, tensor_b -> MatMul -> tensor_c -> Sigmoid -> tensor_d
	//
	// and the "algorithm" graph be
	//
	//	tensor_d -> Add -> tensor_e
	//
	// The combination process results
	//
	//	tensor_a, tensor_b -> MatMul -> tensor_c -> Sigmoid -> tensor_d -> Add -> tensor_e
	//
	// Notice that an input of a node in the "algorithm" graph may reference the
	// output of a node in the inference graph (but not the other way round). Also, inference
	// node cannot reference inputs of "algorithm". With these restrictions, inference graph
	// can always be run independently without training information.
	//
	// By default, this field is an empty graph and its evaluation does not
	// produce any output. Evaluating the default training step never
	// update any initializers.
	Algorithm *GraphProto `protobuf:"bytes,2,opt,name=algorithm,proto3" json:"algorithm,omitempty"`
	// This field specifies the bindings from the outputs of "initialization" to
	// some initializers in "ModelProto.graph.initializer" and
	// the "algorithm.initializer" in the same TrainingInfoProto.
	// See "update_binding" below for details.
	//
	// By default, this field is empty and no initializer would be changed
	// by the execution of "initialization".
	InitializationBinding []*StringStringEntryProto `protobuf:"bytes,3,rep,name=initialization_binding,json=initializationBinding,proto3" json:"initialization_binding,omitempty"`
	// Gradient-based training is usually an iterative procedure. In one gradient
	// descent iteration, we apply
	//
	// x = x - r * g
	//
	// where "x" is the optimized tensor, "r" stands for learning rate, and "g" is
	// gradient of "x" with respect to a chosen loss. To avoid adding assignments
	// into the training graph, we split the update equation into
	//
	// y = x - r * g
	// x = y
	//
	// The user needs to save "y = x - r * g" into TrainingInfoProto.algorithm. To
	// tell that "y" should be assigned to "x", the field "update_binding" may
	// contain a key-value pair of strings, "x" (key of StringStringEntryProto)
	// and "y" (value of StringStringEntryProto).
	// For a neural network with multiple trainable (mutable) tensors, there can
	// be multiple key-value pairs in "update_binding".
	//
	// The initializers appears as keys in "update_binding" are considered
	// mutable variables. This implies some behaviors
	// as described below.
	//
	//  1. We have only unique keys in all "update_binding"s so that two
	//     variables may not have the same name. This ensures that one
	//     variable is assigned up to once.
	//  2. The keys must appear in names of "ModelProto.graph.initializer" or
	//     "TrainingInfoProto.algorithm.initializer".
	//  3. The values must be output names of "algorithm" or "ModelProto.graph.output".
	//  4. Mutable variables are initialized to the value specified by the
	//     corresponding initializer, and then potentially updated by
	//     "initializer_binding"s and "update_binding"s in "TrainingInfoProto"s.
	//
	// This field usually contains names of trainable tensors
	// (in ModelProto.graph), optimizer states such as momentums in advanced
	// stochastic gradient methods (in TrainingInfoProto.graph),
	// and number of training iterations (in TrainingInfoProto.graph).
	//
	// By default, this field is empty and no initializer would be changed
	// by the execution of "algorithm".
	UpdateBinding []*StringStringEntryProto `protobuf:"bytes,4,rep,name=update_binding,json=updateBinding,proto3" json:"update_binding,omitempty"`
	// contains filtered or unexported fields
}

Training information TrainingInfoProto stores information for training a model. In particular, this defines two functionalities: an initialization-step and a training-algorithm-step. Initialization resets the model back to its original state as if no training has been performed. Training algorithm improves the model based on input data.

The semantics of the initialization-step is that the initializers in ModelProto.graph and in TrainingInfoProto.algorithm are first initialized as specified by the initializers in the graph, and then updated by the "initialization_binding" in every instance in ModelProto.training_info.

The field "algorithm" defines a computation graph which represents a training algorithm's step. After the execution of a TrainingInfoProto.algorithm, the initializers specified by "update_binding" may be immediately updated. If the targeted training algorithm contains consecutive update steps (such as block coordinate descent methods), the user needs to create a TrainingInfoProto for each step.

func (*TrainingInfoProto) Descriptor deprecated

func (*TrainingInfoProto) Descriptor() ([]byte, []int)

Deprecated: Use TrainingInfoProto.ProtoReflect.Descriptor instead.

func (*TrainingInfoProto) GetAlgorithm

func (x *TrainingInfoProto) GetAlgorithm() *GraphProto

func (*TrainingInfoProto) GetInitialization

func (x *TrainingInfoProto) GetInitialization() *GraphProto

func (*TrainingInfoProto) GetInitializationBinding

func (x *TrainingInfoProto) GetInitializationBinding() []*StringStringEntryProto

func (*TrainingInfoProto) GetUpdateBinding

func (x *TrainingInfoProto) GetUpdateBinding() []*StringStringEntryProto

func (*TrainingInfoProto) ProtoMessage

func (*TrainingInfoProto) ProtoMessage()

func (*TrainingInfoProto) ProtoReflect

func (x *TrainingInfoProto) ProtoReflect() protoreflect.Message

func (*TrainingInfoProto) Reset

func (x *TrainingInfoProto) Reset()

func (*TrainingInfoProto) String

func (x *TrainingInfoProto) String() string

type TypeProto

type TypeProto struct {

	// Types that are assignable to Value:
	//
	//	*TypeProto_TensorType
	//	*TypeProto_SequenceType
	//	*TypeProto_MapType
	//	*TypeProto_OptionalType
	//	*TypeProto_SparseTensorType
	//	*TypeProto_OpaqueType
	Value isTypeProto_Value `protobuf_oneof:"value"`
	// An optional denotation can be used to denote the whole
	// type with a standard semantic description as to what is
	// stored inside. Refer to https://github.com/onnx/onnx/blob/main/docs/TypeDenotation.md#type-denotation-definition
	// for pre-defined type denotations.
	Denotation string `protobuf:"bytes,6,opt,name=denotation,proto3" json:"denotation,omitempty"`
	// contains filtered or unexported fields
}

Types

The standard ONNX data types.

func (*TypeProto) Descriptor deprecated

func (*TypeProto) Descriptor() ([]byte, []int)

Deprecated: Use TypeProto.ProtoReflect.Descriptor instead.

func (*TypeProto) GetDenotation

func (x *TypeProto) GetDenotation() string

func (*TypeProto) GetMapType

func (x *TypeProto) GetMapType() *TypeProto_Map

func (*TypeProto) GetOpaqueType

func (x *TypeProto) GetOpaqueType() *TypeProto_Opaque

func (*TypeProto) GetOptionalType

func (x *TypeProto) GetOptionalType() *TypeProto_Optional

func (*TypeProto) GetSequenceType

func (x *TypeProto) GetSequenceType() *TypeProto_Sequence

func (*TypeProto) GetSparseTensorType

func (x *TypeProto) GetSparseTensorType() *TypeProto_SparseTensor

func (*TypeProto) GetTensorType

func (x *TypeProto) GetTensorType() *TypeProto_Tensor

func (*TypeProto) GetValue

func (m *TypeProto) GetValue() isTypeProto_Value

func (*TypeProto) ProtoMessage

func (*TypeProto) ProtoMessage()

func (*TypeProto) ProtoReflect

func (x *TypeProto) ProtoReflect() protoreflect.Message

func (*TypeProto) Reset

func (x *TypeProto) Reset()

func (*TypeProto) String

func (x *TypeProto) String() string

type TypeProto_Map

type TypeProto_Map struct {

	// This field MUST have a valid TensorProto.DataType value
	// This field MUST be present for this version of the IR.
	// This field MUST refer to an integral type ([U]INT{8|16|32|64}) or STRING
	KeyType int32 `protobuf:"varint,1,opt,name=key_type,json=keyType,proto3" json:"key_type,omitempty"`
	// This field MUST be present for this version of the IR.
	ValueType *TypeProto `protobuf:"bytes,2,opt,name=value_type,json=valueType,proto3" json:"value_type,omitempty"`
	// contains filtered or unexported fields
}

map<K,V>

func (*TypeProto_Map) Descriptor deprecated

func (*TypeProto_Map) Descriptor() ([]byte, []int)

Deprecated: Use TypeProto_Map.ProtoReflect.Descriptor instead.

func (*TypeProto_Map) GetKeyType

func (x *TypeProto_Map) GetKeyType() int32

func (*TypeProto_Map) GetValueType

func (x *TypeProto_Map) GetValueType() *TypeProto

func (*TypeProto_Map) ProtoMessage

func (*TypeProto_Map) ProtoMessage()

func (*TypeProto_Map) ProtoReflect

func (x *TypeProto_Map) ProtoReflect() protoreflect.Message

func (*TypeProto_Map) Reset

func (x *TypeProto_Map) Reset()

func (*TypeProto_Map) String

func (x *TypeProto_Map) String() string

type TypeProto_MapType

type TypeProto_MapType struct {
	// The type of a map.
	MapType *TypeProto_Map `protobuf:"bytes,5,opt,name=map_type,json=mapType,proto3,oneof"`
}

type TypeProto_Opaque

type TypeProto_Opaque struct {

	// When missing, the domain is the same as the model's.
	Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain,omitempty"`
	// The name is optional but significant when provided.
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*TypeProto_Opaque) Descriptor deprecated

func (*TypeProto_Opaque) Descriptor() ([]byte, []int)

Deprecated: Use TypeProto_Opaque.ProtoReflect.Descriptor instead.

func (*TypeProto_Opaque) GetDomain

func (x *TypeProto_Opaque) GetDomain() string

func (*TypeProto_Opaque) GetName

func (x *TypeProto_Opaque) GetName() string

func (*TypeProto_Opaque) ProtoMessage

func (*TypeProto_Opaque) ProtoMessage()

func (*TypeProto_Opaque) ProtoReflect

func (x *TypeProto_Opaque) ProtoReflect() protoreflect.Message

func (*TypeProto_Opaque) Reset

func (x *TypeProto_Opaque) Reset()

func (*TypeProto_Opaque) String

func (x *TypeProto_Opaque) String() string

type TypeProto_OpaqueType

type TypeProto_OpaqueType struct {
	OpaqueType *TypeProto_Opaque `protobuf:"bytes,7,opt,name=opaque_type,json=opaqueType,proto3,oneof"`
}

type TypeProto_Optional

type TypeProto_Optional struct {

	// The type and optional shape of the element wrapped.
	// This field MUST be present for this version of the IR.
	// Possible values correspond to OptionalProto.DataType enum
	ElemType *TypeProto `protobuf:"bytes,1,opt,name=elem_type,json=elemType,proto3" json:"elem_type,omitempty"`
	// contains filtered or unexported fields
}

wrapper for Tensor, Sequence, or Map

func (*TypeProto_Optional) Descriptor deprecated

func (*TypeProto_Optional) Descriptor() ([]byte, []int)

Deprecated: Use TypeProto_Optional.ProtoReflect.Descriptor instead.

func (*TypeProto_Optional) GetElemType

func (x *TypeProto_Optional) GetElemType() *TypeProto

func (*TypeProto_Optional) ProtoMessage

func (*TypeProto_Optional) ProtoMessage()

func (*TypeProto_Optional) ProtoReflect

func (x *TypeProto_Optional) ProtoReflect() protoreflect.Message

func (*TypeProto_Optional) Reset

func (x *TypeProto_Optional) Reset()

func (*TypeProto_Optional) String

func (x *TypeProto_Optional) String() string

type TypeProto_OptionalType

type TypeProto_OptionalType struct {
	// The type of an optional.
	OptionalType *TypeProto_Optional `protobuf:"bytes,9,opt,name=optional_type,json=optionalType,proto3,oneof"`
}

type TypeProto_Sequence

type TypeProto_Sequence struct {

	// The type and optional shape of each element of the sequence.
	// This field MUST be present for this version of the IR.
	ElemType *TypeProto `protobuf:"bytes,1,opt,name=elem_type,json=elemType,proto3" json:"elem_type,omitempty"`
	// contains filtered or unexported fields
}

repeated T

func (*TypeProto_Sequence) Descriptor deprecated

func (*TypeProto_Sequence) Descriptor() ([]byte, []int)

Deprecated: Use TypeProto_Sequence.ProtoReflect.Descriptor instead.

func (*TypeProto_Sequence) GetElemType

func (x *TypeProto_Sequence) GetElemType() *TypeProto

func (*TypeProto_Sequence) ProtoMessage

func (*TypeProto_Sequence) ProtoMessage()

func (*TypeProto_Sequence) ProtoReflect

func (x *TypeProto_Sequence) ProtoReflect() protoreflect.Message

func (*TypeProto_Sequence) Reset

func (x *TypeProto_Sequence) Reset()

func (*TypeProto_Sequence) String

func (x *TypeProto_Sequence) String() string

type TypeProto_SequenceType

type TypeProto_SequenceType struct {
	// The type of a sequence.
	SequenceType *TypeProto_Sequence `protobuf:"bytes,4,opt,name=sequence_type,json=sequenceType,proto3,oneof"`
}

type TypeProto_SparseTensor

type TypeProto_SparseTensor struct {

	// This field MUST NOT have the value of UNDEFINED
	// This field MUST have a valid TensorProto.DataType value
	// This field MUST be present for this version of the IR.
	ElemType int32             `protobuf:"varint,1,opt,name=elem_type,json=elemType,proto3" json:"elem_type,omitempty"`
	Shape    *TensorShapeProto `protobuf:"bytes,2,opt,name=shape,proto3" json:"shape,omitempty"`
	// contains filtered or unexported fields
}

func (*TypeProto_SparseTensor) Descriptor deprecated

func (*TypeProto_SparseTensor) Descriptor() ([]byte, []int)

Deprecated: Use TypeProto_SparseTensor.ProtoReflect.Descriptor instead.

func (*TypeProto_SparseTensor) GetElemType

func (x *TypeProto_SparseTensor) GetElemType() int32

func (*TypeProto_SparseTensor) GetShape

func (*TypeProto_SparseTensor) ProtoMessage

func (*TypeProto_SparseTensor) ProtoMessage()

func (*TypeProto_SparseTensor) ProtoReflect

func (x *TypeProto_SparseTensor) ProtoReflect() protoreflect.Message

func (*TypeProto_SparseTensor) Reset

func (x *TypeProto_SparseTensor) Reset()

func (*TypeProto_SparseTensor) String

func (x *TypeProto_SparseTensor) String() string

type TypeProto_SparseTensorType

type TypeProto_SparseTensorType struct {
	// Type of the sparse tensor
	SparseTensorType *TypeProto_SparseTensor `protobuf:"bytes,8,opt,name=sparse_tensor_type,json=sparseTensorType,proto3,oneof"`
}

type TypeProto_Tensor

type TypeProto_Tensor struct {

	// This field MUST NOT have the value of UNDEFINED
	// This field MUST have a valid TensorProto.DataType value
	// This field MUST be present for this version of the IR.
	ElemType int32             `protobuf:"varint,1,opt,name=elem_type,json=elemType,proto3" json:"elem_type,omitempty"`
	Shape    *TensorShapeProto `protobuf:"bytes,2,opt,name=shape,proto3" json:"shape,omitempty"`
	// contains filtered or unexported fields
}

func (*TypeProto_Tensor) Descriptor deprecated

func (*TypeProto_Tensor) Descriptor() ([]byte, []int)

Deprecated: Use TypeProto_Tensor.ProtoReflect.Descriptor instead.

func (*TypeProto_Tensor) GetElemType

func (x *TypeProto_Tensor) GetElemType() int32

func (*TypeProto_Tensor) GetShape

func (x *TypeProto_Tensor) GetShape() *TensorShapeProto

func (*TypeProto_Tensor) ProtoMessage

func (*TypeProto_Tensor) ProtoMessage()

func (*TypeProto_Tensor) ProtoReflect

func (x *TypeProto_Tensor) ProtoReflect() protoreflect.Message

func (*TypeProto_Tensor) Reset

func (x *TypeProto_Tensor) Reset()

func (*TypeProto_Tensor) String

func (x *TypeProto_Tensor) String() string

type TypeProto_TensorType

type TypeProto_TensorType struct {
	// The type of a tensor.
	TensorType *TypeProto_Tensor `protobuf:"bytes,1,opt,name=tensor_type,json=tensorType,proto3,oneof"`
}

type ValueInfoProto

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"` // namespace Value
	// This field MUST be present in this version of the IR for
	// inputs and outputs of the top-level graph.
	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"`
	// Named metadata values; keys should be distinct.
	MetadataProps []*StringStringEntryProto `protobuf:"bytes,4,rep,name=metadata_props,json=metadataProps,proto3" json:"metadata_props,omitempty"`
	// contains filtered or unexported fields
}

Defines information on value, including the name, the type, and the shape of the value.

func (*ValueInfoProto) Descriptor deprecated

func (*ValueInfoProto) Descriptor() ([]byte, []int)

Deprecated: Use ValueInfoProto.ProtoReflect.Descriptor instead.

func (*ValueInfoProto) GetDocString

func (x *ValueInfoProto) GetDocString() string

func (*ValueInfoProto) GetMetadataProps

func (x *ValueInfoProto) GetMetadataProps() []*StringStringEntryProto

func (*ValueInfoProto) GetName

func (x *ValueInfoProto) GetName() string

func (*ValueInfoProto) GetType

func (x *ValueInfoProto) GetType() *TypeProto

func (*ValueInfoProto) ProtoMessage

func (*ValueInfoProto) ProtoMessage()

func (*ValueInfoProto) ProtoReflect

func (x *ValueInfoProto) ProtoReflect() protoreflect.Message

func (*ValueInfoProto) Reset

func (x *ValueInfoProto) Reset()

func (*ValueInfoProto) String

func (x *ValueInfoProto) String() string

type Version

type Version int32

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.

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 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_2017_11_3 Version = 3
	// IR VERSION 4 published on Jan 22, 2019
	// - Relax constraint that initializers should be a subset of graph inputs
	// - Add type BFLOAT16
	Version_IR_VERSION_2019_1_22 Version = 4
	// IR VERSION 5 published on March 18, 2019
	// - Add message TensorAnnotation.
	// - Add quantization annotation in GraphProto to map tensor with its scale and zero point quantization parameters.
	Version_IR_VERSION_2019_3_18 Version = 5
	// IR VERSION 6 published on Sep 19, 2019
	// - Add support for sparse tensor constants stored in model.
	//   - Add message SparseTensorProto
	//   - Add sparse initializers
	Version_IR_VERSION_2019_9_19 Version = 6
	// IR VERSION 7 published on May 8, 2020
	//   - Add support to allow function body graph to rely on multiple external opreator sets.
	//   - Add a list to promote inference graph's initializers to global and
	//     mutable variables. Global variables are visible in all graphs of the
	//     stored models.
	//   - Add message TrainingInfoProto to store initialization
	//     method and training algorithm. The execution of TrainingInfoProto
	//     can modify the values of mutable variables.
	//   - Implicitly add inference graph into each TrainingInfoProto's algorithm.
	Version_IR_VERSION_2020_5_8 Version = 7
	// IR VERSION 8 published on July 30, 2021
	// Introduce TypeProto.SparseTensor
	// Introduce TypeProto.Optional
	// Added a list of FunctionProtos local to the model
	// Deprecated since_version and operator status from FunctionProto
	Version_IR_VERSION_2021_7_30 Version = 8
	// IR VERSION 9 published on May 5, 2023
	// Added AttributeProto to FunctionProto so that default attribute values can be set.
	// Added FLOAT8E4M3FN, FLOAT8E4M3FNUZ, FLOAT8E5M2, FLOAT8E5M2FNUZ.
	Version_IR_VERSION_2023_5_5 Version = 9
	// IR VERSION 10 published on March 25, 2024
	// Added UINT4, INT4.
	Version_IR_VERSION_2024_3_25 Version = 10
	// IR VERSION 11 published on TBD
	// Added FLOAT4E2M1.
	Version_IR_VERSION Version = 11
)

func (Version) Descriptor

func (Version) Descriptor() protoreflect.EnumDescriptor

func (Version) Enum

func (x Version) Enum() *Version

func (Version) EnumDescriptor deprecated

func (Version) EnumDescriptor() ([]byte, []int)

Deprecated: Use Version.Descriptor instead.

func (Version) Number

func (x Version) Number() protoreflect.EnumNumber

func (Version) String

func (x Version) String() string

func (Version) Type

func (Version) Type() protoreflect.EnumType

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL