onnx-go: github.com/owulveryck/onnx-go Index | Examples | Files

package onnx

import "github.com/owulveryck/onnx-go"

Index

Examples

Package Files

dtype.go errors.go onnx.pb.go tensor.go unmarshal.go

Constants

const (
    // AttrTagName ...
    AttrTagName = "attributeName"
    // RequiredTagName ...
    RequiredTagName = "required"
)

Variables

var (
    // ErrNotYetImplemented ...
    ErrNotYetImplemented = errors.New("Not Yet Implemented")
    // ErrNoDataFound ...
    ErrNoDataFound = errors.New("No data found")
    // ErrCorruptedData ...
    ErrCorruptedData = errors.New("Unable to decode data")
)
var (
    ErrInvalidLengthOnnx = fmt.Errorf("proto: negative length found during unmarshaling")
    ErrIntOverflowOnnx   = fmt.Errorf("proto: integer overflow")
)
var AttributeProto_AttributeType_name = map[int32]string{
    0:  "UNDEFINED",
    1:  "FLOAT",
    2:  "INT",
    3:  "STRING",
    4:  "TENSOR",
    5:  "GRAPH",
    6:  "FLOATS",
    7:  "INTS",
    8:  "STRINGS",
    9:  "TENSORS",
    10: "GRAPHS",
}
var AttributeProto_AttributeType_value = map[string]int32{
    "UNDEFINED": 0,
    "FLOAT":     1,
    "INT":       2,
    "STRING":    3,
    "TENSOR":    4,
    "GRAPH":     5,
    "FLOATS":    6,
    "INTS":      7,
    "STRINGS":   8,
    "TENSORS":   9,
    "GRAPHS":    10,
}
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",
}
var TensorProto_DataType_value = map[string]int32{
    "UNDEFINED":  0,
    "FLOAT":      1,
    "UINT8":      2,
    "INT8":       3,
    "UINT16":     4,
    "INT16":      5,
    "INT32":      6,
    "INT64":      7,
    "STRING":     8,
    "BOOL":       9,
    "FLOAT16":    10,
    "DOUBLE":     11,
    "UINT32":     12,
    "UINT64":     13,
    "COMPLEX64":  14,
    "COMPLEX128": 15,
}
var Version_name = map[int32]string{
    0:  "_START_VERSION",
    1:  "IR_VERSION_2017_10_10",
    2:  "IR_VERSION_2017_10_30",
    3:  "IR_VERSION",
}
var Version_value = map[string]int32{
    "_START_VERSION":        0,
    "IR_VERSION_2017_10_10": 1,
    "IR_VERSION_2017_10_30": 2,
    "IR_VERSION":            3,
}

func UnmarshalAttributes Uses

func UnmarshalAttributes(attrs []*AttributeProto, v interface{}) error

UnmarshalAttributes reads the array of attributes and stores the result in the struct pointed to by v. If v is nil or not a pointer to a struct, Unmarshal returns an InvalidUnmarshalError. The structure pointed by v can only be flat and composed of one of the following types:

* string
* []string
* int64
* []int64
* float32
* []float32
* tensor.Tensor

The values are associated thanks to the `onnx` tag fields and `required` tag if needed. Warning: any attribute not present in the v structure is silently discarded

type AttributeProto Uses

type AttributeProto struct {
    // The name field MUST be present for this version of the IR.
    Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
    // if ref_attr_name is not empty, ref_attr_name is the attribute name in parent function.
    // In this case, this AttributeProto does not contain data, and it's a reference of attribute
    // in parent scope.
    // NOTE: This should ONLY be used in function (sub-graph). It's invalid to be used in main graph.
    RefAttrName *string `protobuf:"bytes,21,opt,name=ref_attr_name,json=refAttrName" 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" json:"doc_string,omitempty"`
    // The type field MUST be present for this version of the IR.
    // For 0.0.1 versions of the IR, this field was not defined, and
    // implementations needed to use has_field hueristics to determine
    // which value field was in use.  For IR_VERSION 0.0.2 or later, this
    // field MUST be set and match the f|i|s|t|... field in use.  This
    // change was made to accomodate proto3 implementations.
    Type *AttributeProto_AttributeType `protobuf:"varint,20,opt,name=type,enum=onnx.AttributeProto_AttributeType" json:"type,omitempty"`
    // Exactly ONE of the following fields must be present for this version of the IR
    F                    *float32       `protobuf:"fixed32,2,opt,name=f" json:"f,omitempty"`
    I                    *int64         `protobuf:"varint,3,opt,name=i" json:"i,omitempty"`
    S                    []byte         `protobuf:"bytes,4,opt,name=s" json:"s,omitempty"`
    T                    *TensorProto   `protobuf:"bytes,5,opt,name=t" json:"t,omitempty"`
    G                    *GraphProto    `protobuf:"bytes,6,opt,name=g" json:"g,omitempty"`
    Floats               []float32      `protobuf:"fixed32,7,rep,name=floats" json:"floats,omitempty"`
    Ints                 []int64        `protobuf:"varint,8,rep,name=ints" json:"ints,omitempty"`
    Strings              [][]byte       `protobuf:"bytes,9,rep,name=strings" json:"strings,omitempty"`
    Tensors              []*TensorProto `protobuf:"bytes,10,rep,name=tensors" json:"tensors,omitempty"`
    Graphs               []*GraphProto  `protobuf:"bytes,11,rep,name=graphs" json:"graphs,omitempty"`
    XXX_NoUnkeyedLiteral struct{}       `json:"-"`
    XXX_unrecognized     []byte         `json:"-"`
    XXX_sizecache        int32          `json:"-"`
}

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 Uses

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

func (*AttributeProto) GetDocString Uses

func (m *AttributeProto) GetDocString() string

func (*AttributeProto) GetF Uses

func (m *AttributeProto) GetF() float32

func (*AttributeProto) GetFloats Uses

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

func (*AttributeProto) GetG Uses

func (m *AttributeProto) GetG() *GraphProto

func (*AttributeProto) GetGraphs Uses

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

func (*AttributeProto) GetI Uses

func (m *AttributeProto) GetI() int64

func (*AttributeProto) GetInts Uses

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

func (*AttributeProto) GetName Uses

func (m *AttributeProto) GetName() string

func (*AttributeProto) GetRefAttrName Uses

func (m *AttributeProto) GetRefAttrName() string

func (*AttributeProto) GetS Uses

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

func (*AttributeProto) GetStrings Uses

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

func (*AttributeProto) GetT Uses

func (m *AttributeProto) GetT() *TensorProto

func (*AttributeProto) GetTensors Uses

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

func (*AttributeProto) GetType Uses

func (m *AttributeProto) GetType() AttributeProto_AttributeType

func (*AttributeProto) Marshal Uses

func (m *AttributeProto) Marshal() (dAtA []byte, err error)

func (*AttributeProto) MarshalTo Uses

func (m *AttributeProto) MarshalTo(dAtA []byte) (int, error)

func (*AttributeProto) ProtoMessage Uses

func (*AttributeProto) ProtoMessage()

func (*AttributeProto) Reset Uses

func (m *AttributeProto) Reset()

func (*AttributeProto) Size Uses

func (m *AttributeProto) Size() (n int)

func (*AttributeProto) String Uses

func (m *AttributeProto) String() string

func (*AttributeProto) Unmarshal Uses

func (m *AttributeProto) Unmarshal(dAtA []byte) error

func (*AttributeProto) XXX_DiscardUnknown Uses

func (m *AttributeProto) XXX_DiscardUnknown()

func (*AttributeProto) XXX_Marshal Uses

func (m *AttributeProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AttributeProto) XXX_Merge Uses

func (dst *AttributeProto) XXX_Merge(src proto.Message)

func (*AttributeProto) XXX_Size Uses

func (m *AttributeProto) XXX_Size() int

func (*AttributeProto) XXX_Unmarshal Uses

func (m *AttributeProto) XXX_Unmarshal(b []byte) error

type AttributeProto_AttributeType Uses

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_FLOATS    AttributeProto_AttributeType = 6
    AttributeProto_INTS      AttributeProto_AttributeType = 7
    AttributeProto_STRINGS   AttributeProto_AttributeType = 8
    AttributeProto_TENSORS   AttributeProto_AttributeType = 9
    AttributeProto_GRAPHS    AttributeProto_AttributeType = 10
)

func (AttributeProto_AttributeType) Enum Uses

func (x AttributeProto_AttributeType) Enum() *AttributeProto_AttributeType

func (AttributeProto_AttributeType) EnumDescriptor Uses

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

func (AttributeProto_AttributeType) String Uses

func (x AttributeProto_AttributeType) String() string

func (*AttributeProto_AttributeType) UnmarshalJSON Uses

func (x *AttributeProto_AttributeType) UnmarshalJSON(data []byte) error

type ErrNotImplemented Uses

type ErrNotImplemented struct {
    Operator       string
    AttributeName  string
    AttributeValue interface{}
    Message        string
}

ErrNotImplemented is returned for any operator or attribute

func (*ErrNotImplemented) Error Uses

func (e *ErrNotImplemented) Error() string

type GraphProto Uses

type GraphProto struct {
    // The nodes in the graph, sorted topologically.
    Node []*NodeProto `protobuf:"bytes,1,rep,name=node" json:"node,omitempty"`
    // The name of the graph.
    Name *string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"`
    // A list of named tensor values, used to specify constant inputs of the graph.
    // Each TensorProto entry must have a distinct name (within the list) that
    // also appears in the input list.
    Initializer []*TensorProto `protobuf:"bytes,5,rep,name=initializer" json:"initializer,omitempty"`
    // A human-readable documentation for this graph. Markdown is allowed.
    DocString *string `protobuf:"bytes,10,opt,name=doc_string,json=docString" json:"doc_string,omitempty"`
    // The inputs and outputs of the graph.
    Input  []*ValueInfoProto `protobuf:"bytes,11,rep,name=input" json:"input,omitempty"`
    Output []*ValueInfoProto `protobuf:"bytes,12,rep,name=output" 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" json:"value_info,omitempty"`
    XXX_NoUnkeyedLiteral struct{}          `json:"-"`
    XXX_unrecognized     []byte            `json:"-"`
    XXX_sizecache        int32             `json:"-"`
}

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 Uses

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

func (*GraphProto) GetDocString Uses

func (m *GraphProto) GetDocString() string

func (*GraphProto) GetInitializer Uses

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

func (*GraphProto) GetInput Uses

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

func (*GraphProto) GetName Uses

func (m *GraphProto) GetName() string

func (*GraphProto) GetNode Uses

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

func (*GraphProto) GetOutput Uses

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

func (*GraphProto) GetValueInfo Uses

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

func (*GraphProto) Marshal Uses

func (m *GraphProto) Marshal() (dAtA []byte, err error)

func (*GraphProto) MarshalTo Uses

func (m *GraphProto) MarshalTo(dAtA []byte) (int, error)

func (*GraphProto) ProtoMessage Uses

func (*GraphProto) ProtoMessage()

func (*GraphProto) Reset Uses

func (m *GraphProto) Reset()

func (*GraphProto) Size Uses

func (m *GraphProto) Size() (n int)

func (*GraphProto) String Uses

func (m *GraphProto) String() string

func (*GraphProto) Unmarshal Uses

func (m *GraphProto) Unmarshal(dAtA []byte) error

func (*GraphProto) XXX_DiscardUnknown Uses

func (m *GraphProto) XXX_DiscardUnknown()

func (*GraphProto) XXX_Marshal Uses

func (m *GraphProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GraphProto) XXX_Merge Uses

func (dst *GraphProto) XXX_Merge(src proto.Message)

func (*GraphProto) XXX_Size Uses

func (m *GraphProto) XXX_Size() int

func (*GraphProto) XXX_Unmarshal Uses

func (m *GraphProto) XXX_Unmarshal(b []byte) error

type InvalidUnmarshalError Uses

type InvalidUnmarshalError struct {
    Type reflect.Type
}

An InvalidUnmarshalError describes an invalid argument passed to Unmarshal. (The argument to Unmarshal must be a non-nil pointer.)

func (*InvalidUnmarshalError) Error Uses

func (e *InvalidUnmarshalError) Error() string

type ModelProto Uses

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" 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" 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" 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" 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" json:"domain,omitempty"`
    // The version of the graph encoded. See Version enum below.
    ModelVersion *int64 `protobuf:"varint,5,opt,name=model_version,json=modelVersion" 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" json:"doc_string,omitempty"`
    // The parameterized graph that is evaluated to execute the model.
    Graph *GraphProto `protobuf:"bytes,7,opt,name=graph" json:"graph,omitempty"`
    // Named metadata values; keys should be distinct.
    MetadataProps        []*StringStringEntryProto `protobuf:"bytes,14,rep,name=metadata_props,json=metadataProps" json:"metadata_props,omitempty"`
    XXX_NoUnkeyedLiteral struct{}                  `json:"-"`
    XXX_unrecognized     []byte                    `json:"-"`
    XXX_sizecache        int32                     `json:"-"`
}

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.

Code:

b, err := ioutil.ReadFile("/path/to/onnx/file.onnx")
if err != nil {
    log.Fatal(err)
}
model := new(onnx.ModelProto)
err = model.Unmarshal(b)
if err != nil {
    log.Fatal(err)
}
log.Println(model)

func (*ModelProto) Descriptor Uses

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

func (*ModelProto) GetDocString Uses

func (m *ModelProto) GetDocString() string

func (*ModelProto) GetDomain Uses

func (m *ModelProto) GetDomain() string

func (*ModelProto) GetGraph Uses

func (m *ModelProto) GetGraph() *GraphProto

func (*ModelProto) GetIrVersion Uses

func (m *ModelProto) GetIrVersion() int64

func (*ModelProto) GetMetadataProps Uses

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

func (*ModelProto) GetModelVersion Uses

func (m *ModelProto) GetModelVersion() int64

func (*ModelProto) GetOpsetImport Uses

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

func (*ModelProto) GetProducerName Uses

func (m *ModelProto) GetProducerName() string

func (*ModelProto) GetProducerVersion Uses

func (m *ModelProto) GetProducerVersion() string

func (*ModelProto) Marshal Uses

func (m *ModelProto) Marshal() (dAtA []byte, err error)

func (*ModelProto) MarshalTo Uses

func (m *ModelProto) MarshalTo(dAtA []byte) (int, error)

func (*ModelProto) ProtoMessage Uses

func (*ModelProto) ProtoMessage()

func (*ModelProto) Reset Uses

func (m *ModelProto) Reset()

func (*ModelProto) Size Uses

func (m *ModelProto) Size() (n int)

func (*ModelProto) String Uses

func (m *ModelProto) String() string

func (*ModelProto) Unmarshal Uses

func (m *ModelProto) Unmarshal(dAtA []byte) error

func (*ModelProto) XXX_DiscardUnknown Uses

func (m *ModelProto) XXX_DiscardUnknown()

func (*ModelProto) XXX_Marshal Uses

func (m *ModelProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ModelProto) XXX_Merge Uses

func (dst *ModelProto) XXX_Merge(src proto.Message)

func (*ModelProto) XXX_Size Uses

func (m *ModelProto) XXX_Size() int

func (*ModelProto) XXX_Unmarshal Uses

func (m *ModelProto) XXX_Unmarshal(b []byte) error

type NodeProto Uses

type NodeProto struct {
    Input  []string `protobuf:"bytes,1,rep,name=input" json:"input,omitempty"`
    Output []string `protobuf:"bytes,2,rep,name=output" json:"output,omitempty"`
    // An optional identifier for this node in a graph.
    // This field MAY be absent in ths version of the IR.
    Name *string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"`
    // The symbolic identifier of the Operator to execute.
    OpType *string `protobuf:"bytes,4,opt,name=op_type,json=opType" json:"op_type,omitempty"`
    // The domain of the OperatorSet that specifies the operator named by op_type.
    Domain *string `protobuf:"bytes,7,opt,name=domain" json:"domain,omitempty"`
    // Additional named attributes.
    Attribute []*AttributeProto `protobuf:"bytes,5,rep,name=attribute" json:"attribute,omitempty"`
    // A human-readable documentation for this node. Markdown is allowed.
    DocString            *string  `protobuf:"bytes,6,opt,name=doc_string,json=docString" json:"doc_string,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

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 Uses

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

func (*NodeProto) GetAttribute Uses

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

func (*NodeProto) GetDocString Uses

func (m *NodeProto) GetDocString() string

func (*NodeProto) GetDomain Uses

func (m *NodeProto) GetDomain() string

func (*NodeProto) GetInput Uses

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

func (*NodeProto) GetName Uses

func (m *NodeProto) GetName() string

func (*NodeProto) GetOpType Uses

func (m *NodeProto) GetOpType() string

func (*NodeProto) GetOutput Uses

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

func (*NodeProto) Marshal Uses

func (m *NodeProto) Marshal() (dAtA []byte, err error)

func (*NodeProto) MarshalTo Uses

func (m *NodeProto) MarshalTo(dAtA []byte) (int, error)

func (*NodeProto) ProtoMessage Uses

func (*NodeProto) ProtoMessage()

func (*NodeProto) Reset Uses

func (m *NodeProto) Reset()

func (*NodeProto) Size Uses

func (m *NodeProto) Size() (n int)

func (*NodeProto) String Uses

func (m *NodeProto) String() string

func (*NodeProto) Unmarshal Uses

func (m *NodeProto) Unmarshal(dAtA []byte) error

func (*NodeProto) XXX_DiscardUnknown Uses

func (m *NodeProto) XXX_DiscardUnknown()

func (*NodeProto) XXX_Marshal Uses

func (m *NodeProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*NodeProto) XXX_Merge Uses

func (dst *NodeProto) XXX_Merge(src proto.Message)

func (*NodeProto) XXX_Size Uses

func (m *NodeProto) XXX_Size() int

func (*NodeProto) XXX_Unmarshal Uses

func (m *NodeProto) XXX_Unmarshal(b []byte) error

type OperatorSetIdProto Uses

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" 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" json:"version,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

Operator Sets

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

func (*OperatorSetIdProto) Descriptor Uses

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

func (*OperatorSetIdProto) GetDomain Uses

func (m *OperatorSetIdProto) GetDomain() string

func (*OperatorSetIdProto) GetVersion Uses

func (m *OperatorSetIdProto) GetVersion() int64

func (*OperatorSetIdProto) Marshal Uses

func (m *OperatorSetIdProto) Marshal() (dAtA []byte, err error)

func (*OperatorSetIdProto) MarshalTo Uses

func (m *OperatorSetIdProto) MarshalTo(dAtA []byte) (int, error)

func (*OperatorSetIdProto) ProtoMessage Uses

func (*OperatorSetIdProto) ProtoMessage()

func (*OperatorSetIdProto) Reset Uses

func (m *OperatorSetIdProto) Reset()

func (*OperatorSetIdProto) Size Uses

func (m *OperatorSetIdProto) Size() (n int)

func (*OperatorSetIdProto) String Uses

func (m *OperatorSetIdProto) String() string

func (*OperatorSetIdProto) Unmarshal Uses

func (m *OperatorSetIdProto) Unmarshal(dAtA []byte) error

func (*OperatorSetIdProto) XXX_DiscardUnknown Uses

func (m *OperatorSetIdProto) XXX_DiscardUnknown()

func (*OperatorSetIdProto) XXX_Marshal Uses

func (m *OperatorSetIdProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*OperatorSetIdProto) XXX_Merge Uses

func (dst *OperatorSetIdProto) XXX_Merge(src proto.Message)

func (*OperatorSetIdProto) XXX_Size Uses

func (m *OperatorSetIdProto) XXX_Size() int

func (*OperatorSetIdProto) XXX_Unmarshal Uses

func (m *OperatorSetIdProto) XXX_Unmarshal(b []byte) error

type RequiredTagNotFound Uses

type RequiredTagNotFound struct {
    TagName string
}

A RequiredTagNotFound error is raised if a TagName is marked as required and is not found in the attribute list

func (*RequiredTagNotFound) Error Uses

func (e *RequiredTagNotFound) Error() string

type StringStringEntryProto Uses

type StringStringEntryProto struct {
    Key                  *string  `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"`
    Value                *string  `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

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

func (*StringStringEntryProto) Descriptor Uses

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

func (*StringStringEntryProto) GetKey Uses

func (m *StringStringEntryProto) GetKey() string

func (*StringStringEntryProto) GetValue Uses

func (m *StringStringEntryProto) GetValue() string

func (*StringStringEntryProto) Marshal Uses

func (m *StringStringEntryProto) Marshal() (dAtA []byte, err error)

func (*StringStringEntryProto) MarshalTo Uses

func (m *StringStringEntryProto) MarshalTo(dAtA []byte) (int, error)

func (*StringStringEntryProto) ProtoMessage Uses

func (*StringStringEntryProto) ProtoMessage()

func (*StringStringEntryProto) Reset Uses

func (m *StringStringEntryProto) Reset()

func (*StringStringEntryProto) Size Uses

func (m *StringStringEntryProto) Size() (n int)

func (*StringStringEntryProto) String Uses

func (m *StringStringEntryProto) String() string

func (*StringStringEntryProto) Unmarshal Uses

func (m *StringStringEntryProto) Unmarshal(dAtA []byte) error

func (*StringStringEntryProto) XXX_DiscardUnknown Uses

func (m *StringStringEntryProto) XXX_DiscardUnknown()

func (*StringStringEntryProto) XXX_Marshal Uses

func (m *StringStringEntryProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*StringStringEntryProto) XXX_Merge Uses

func (dst *StringStringEntryProto) XXX_Merge(src proto.Message)

func (*StringStringEntryProto) XXX_Size Uses

func (m *StringStringEntryProto) XXX_Size() int

func (*StringStringEntryProto) XXX_Unmarshal Uses

func (m *StringStringEntryProto) XXX_Unmarshal(b []byte) error

type TensorProto Uses

type TensorProto struct {
    // The shape of the tensor.
    Dims []int64 `protobuf:"varint,1,rep,name=dims" json:"dims,omitempty"`
    // The data type of the tensor.
    DataType *TensorProto_DataType `protobuf:"varint,2,opt,name=data_type,json=dataType,enum=onnx.TensorProto_DataType" json:"data_type,omitempty"`
    Segment  *TensorProto_Segment  `protobuf:"bytes,3,opt,name=segment" json:"segment,omitempty"`
    // For float and complex64 values
    // Complex64 tensors are encoded as a single array of floats,
    // with the real components appearing in odd numbered positions,
    // and the corresponding imaginary component apparing in the
    // subsequent even numbered position. (e.g., [1.0 + 2.0i, 3.0 + 4.0i]
    // is encoded as [1.0, 2.0 ,3.0 ,4.0]
    // When this field is present, the data_type field MUST be FLOAT or COMPLEX64.
    FloatData []float32 `protobuf:"fixed32,4,rep,packed,name=float_data,json=floatData" json:"float_data,omitempty"`
    // For int32, uint8, int8, uint16, int16, bool, and float16 values
    // float16 values must be bit-wise converted to an uint16_t prior
    // to writing to the buffer.
    // When this field is present, the data_type field MUST be
    // INT32, INT16, INT8, UINT16, INT8, BOOL, or FLOAT16
    Int32Data []int32 `protobuf:"varint,5,rep,packed,name=int32_data,json=int32Data" 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" 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" json:"int64_data,omitempty"`
    // Optionally, a name for the tensor.
    Name *string `protobuf:"bytes,8,opt,name=name" json:"name,omitempty"`
    // A human-readable documentation for this tensor. Markdown is allowed.
    DocString *string `protobuf:"bytes,12,opt,name=doc_string,json=docString" json:"doc_string,omitempty"`
    // Serializations can either use one of the fields above, or use this
    // raw bytes field. The only exception is the string case, where one is
    // required to store the content in the repeated bytes string_data field.
    //
    // When this raw_data field is used to store tensor value, elements MUST
    // be stored in as fixed-width, little-endian order.
    // Floating-point data types MUST be stored in IEEE 754 format.
    // Complex64 elements must be written as two consecutive FLOAT values, real component first.
    // Complex128 elements must be written as two consecutive DOUBLE values, real component first.
    // Boolean type MUST be written one byte per tensor element (00000001 for true, 00000000 for false).
    //
    // Note: the advantage of specific field rather than the raw_data field is
    // that in some cases (e.g. int data), protobuf does a better packing via
    // variable length storage, and may lead to smaller binary footprint.
    // When this field is present, the data_type field MUST NOT be STRING or UNDEFINED
    RawData []byte `protobuf:"bytes,9,opt,name=raw_data,json=rawData" json:"raw_data,omitempty"`
    // For double
    // Complex64 tensors are encoded as a single array of doubles,
    // with the real components appearing in odd numbered positions,
    // and the corresponding imaginary component apparing in the
    // subsequent even numbered position. (e.g., [1.0 + 2.0i, 3.0 + 4.0i]
    // is encoded as [1.0, 2.0 ,3.0 ,4.0]
    // When this field is present, the data_type field MUST be DOUBLE or COMPLEX128
    DoubleData []float64 `protobuf:"fixed64,10,rep,packed,name=double_data,json=doubleData" 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" json:"uint64_data,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

Tensors

A serialized tensor value.

func (*TensorProto) Descriptor Uses

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

func (*TensorProto) GetDataType Uses

func (m *TensorProto) GetDataType() TensorProto_DataType

func (*TensorProto) GetDims Uses

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

func (*TensorProto) GetDocString Uses

func (m *TensorProto) GetDocString() string

func (*TensorProto) GetDoubleData Uses

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

func (*TensorProto) GetFloatData Uses

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

func (*TensorProto) GetInt32Data Uses

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

func (*TensorProto) GetInt64Data Uses

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

func (*TensorProto) GetName Uses

func (m *TensorProto) GetName() string

func (*TensorProto) GetRawData Uses

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

func (*TensorProto) GetSegment Uses

func (m *TensorProto) GetSegment() *TensorProto_Segment

func (*TensorProto) GetStringData Uses

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

func (*TensorProto) GetUint64Data Uses

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

func (*TensorProto) Marshal Uses

func (m *TensorProto) Marshal() (dAtA []byte, err error)

func (*TensorProto) MarshalTo Uses

func (m *TensorProto) MarshalTo(dAtA []byte) (int, error)

func (*TensorProto) ProtoMessage Uses

func (*TensorProto) ProtoMessage()

func (*TensorProto) Reset Uses

func (m *TensorProto) Reset()

func (*TensorProto) Size Uses

func (m *TensorProto) Size() (n int)

func (*TensorProto) String Uses

func (m *TensorProto) String() string

func (*TensorProto) Tensor Uses

func (tx *TensorProto) Tensor() (tensor.Tensor, error)

Tensor returns a Gorgonia compatible tensor

func (*TensorProto) Unmarshal Uses

func (m *TensorProto) Unmarshal(dAtA []byte) error

func (*TensorProto) XXX_DiscardUnknown Uses

func (m *TensorProto) XXX_DiscardUnknown()

func (*TensorProto) XXX_Marshal Uses

func (m *TensorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TensorProto) XXX_Merge Uses

func (dst *TensorProto) XXX_Merge(src proto.Message)

func (*TensorProto) XXX_Size Uses

func (m *TensorProto) XXX_Size() int

func (*TensorProto) XXX_Unmarshal Uses

func (m *TensorProto) XXX_Unmarshal(b []byte) error

type TensorProto_DataType Uses

type TensorProto_DataType int32
const (
    TensorProto_UNDEFINED TensorProto_DataType = 0
    // Basic types.
    TensorProto_FLOAT  TensorProto_DataType = 1
    TensorProto_UINT8  TensorProto_DataType = 2
    TensorProto_INT8   TensorProto_DataType = 3
    TensorProto_UINT16 TensorProto_DataType = 4
    TensorProto_INT16  TensorProto_DataType = 5
    TensorProto_INT32  TensorProto_DataType = 6
    TensorProto_INT64  TensorProto_DataType = 7
    TensorProto_STRING TensorProto_DataType = 8
    TensorProto_BOOL   TensorProto_DataType = 9
    // Advanced types
    TensorProto_FLOAT16    TensorProto_DataType = 10
    TensorProto_DOUBLE     TensorProto_DataType = 11
    TensorProto_UINT32     TensorProto_DataType = 12
    TensorProto_UINT64     TensorProto_DataType = 13
    TensorProto_COMPLEX64  TensorProto_DataType = 14
    TensorProto_COMPLEX128 TensorProto_DataType = 15
)

func (*TensorProto_DataType) Dtype Uses

func (t *TensorProto_DataType) Dtype() (tensor.Dtype, error)

Dtype returns a compatible dtype from the source

func (TensorProto_DataType) Enum Uses

func (x TensorProto_DataType) Enum() *TensorProto_DataType

func (TensorProto_DataType) EnumDescriptor Uses

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

func (TensorProto_DataType) String Uses

func (x TensorProto_DataType) String() string

func (*TensorProto_DataType) UnmarshalJSON Uses

func (x *TensorProto_DataType) UnmarshalJSON(data []byte) error

type TensorProto_Segment Uses

type TensorProto_Segment struct {
    Begin                *int64   `protobuf:"varint,1,opt,name=begin" json:"begin,omitempty"`
    End                  *int64   `protobuf:"varint,2,opt,name=end" json:"end,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

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 Uses

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

func (*TensorProto_Segment) GetBegin Uses

func (m *TensorProto_Segment) GetBegin() int64

func (*TensorProto_Segment) GetEnd Uses

func (m *TensorProto_Segment) GetEnd() int64

func (*TensorProto_Segment) Marshal Uses

func (m *TensorProto_Segment) Marshal() (dAtA []byte, err error)

func (*TensorProto_Segment) MarshalTo Uses

func (m *TensorProto_Segment) MarshalTo(dAtA []byte) (int, error)

func (*TensorProto_Segment) ProtoMessage Uses

func (*TensorProto_Segment) ProtoMessage()

func (*TensorProto_Segment) Reset Uses

func (m *TensorProto_Segment) Reset()

func (*TensorProto_Segment) Size Uses

func (m *TensorProto_Segment) Size() (n int)

func (*TensorProto_Segment) String Uses

func (m *TensorProto_Segment) String() string

func (*TensorProto_Segment) Unmarshal Uses

func (m *TensorProto_Segment) Unmarshal(dAtA []byte) error

func (*TensorProto_Segment) XXX_DiscardUnknown Uses

func (m *TensorProto_Segment) XXX_DiscardUnknown()

func (*TensorProto_Segment) XXX_Marshal Uses

func (m *TensorProto_Segment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TensorProto_Segment) XXX_Merge Uses

func (dst *TensorProto_Segment) XXX_Merge(src proto.Message)

func (*TensorProto_Segment) XXX_Size Uses

func (m *TensorProto_Segment) XXX_Size() int

func (*TensorProto_Segment) XXX_Unmarshal Uses

func (m *TensorProto_Segment) XXX_Unmarshal(b []byte) error

type TensorShapeProto Uses

type TensorShapeProto struct {
    Dim                  []*TensorShapeProto_Dimension `protobuf:"bytes,1,rep,name=dim" json:"dim,omitempty"`
    XXX_NoUnkeyedLiteral struct{}                      `json:"-"`
    XXX_unrecognized     []byte                        `json:"-"`
    XXX_sizecache        int32                         `json:"-"`
}

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 Uses

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

func (*TensorShapeProto) GetDim Uses

func (m *TensorShapeProto) GetDim() []*TensorShapeProto_Dimension

func (*TensorShapeProto) Marshal Uses

func (m *TensorShapeProto) Marshal() (dAtA []byte, err error)

func (*TensorShapeProto) MarshalTo Uses

func (m *TensorShapeProto) MarshalTo(dAtA []byte) (int, error)

func (*TensorShapeProto) ProtoMessage Uses

func (*TensorShapeProto) ProtoMessage()

func (*TensorShapeProto) Reset Uses

func (m *TensorShapeProto) Reset()

func (*TensorShapeProto) Size Uses

func (m *TensorShapeProto) Size() (n int)

func (*TensorShapeProto) String Uses

func (m *TensorShapeProto) String() string

func (*TensorShapeProto) Unmarshal Uses

func (m *TensorShapeProto) Unmarshal(dAtA []byte) error

func (*TensorShapeProto) XXX_DiscardUnknown Uses

func (m *TensorShapeProto) XXX_DiscardUnknown()

func (*TensorShapeProto) XXX_Marshal Uses

func (m *TensorShapeProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TensorShapeProto) XXX_Merge Uses

func (dst *TensorShapeProto) XXX_Merge(src proto.Message)

func (*TensorShapeProto) XXX_Size Uses

func (m *TensorShapeProto) XXX_Size() int

func (*TensorShapeProto) XXX_Unmarshal Uses

func (m *TensorShapeProto) XXX_Unmarshal(b []byte) error

type TensorShapeProto_Dimension Uses

type TensorShapeProto_Dimension struct {
    // Types that are valid to be assigned 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/master/docs/DimensionDenotation.md#denotation-definition
    // for pre-defined dimension denotations.
    Denotation           *string  `protobuf:"bytes,3,opt,name=denotation" json:"denotation,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

func (*TensorShapeProto_Dimension) Descriptor Uses

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

func (*TensorShapeProto_Dimension) GetDenotation Uses

func (m *TensorShapeProto_Dimension) GetDenotation() string

func (*TensorShapeProto_Dimension) GetDimParam Uses

func (m *TensorShapeProto_Dimension) GetDimParam() string

func (*TensorShapeProto_Dimension) GetDimValue Uses

func (m *TensorShapeProto_Dimension) GetDimValue() int64

func (*TensorShapeProto_Dimension) GetValue Uses

func (m *TensorShapeProto_Dimension) GetValue() isTensorShapeProto_Dimension_Value

func (*TensorShapeProto_Dimension) Marshal Uses

func (m *TensorShapeProto_Dimension) Marshal() (dAtA []byte, err error)

func (*TensorShapeProto_Dimension) MarshalTo Uses

func (m *TensorShapeProto_Dimension) MarshalTo(dAtA []byte) (int, error)

func (*TensorShapeProto_Dimension) ProtoMessage Uses

func (*TensorShapeProto_Dimension) ProtoMessage()

func (*TensorShapeProto_Dimension) Reset Uses

func (m *TensorShapeProto_Dimension) Reset()

func (*TensorShapeProto_Dimension) Size Uses

func (m *TensorShapeProto_Dimension) Size() (n int)

func (*TensorShapeProto_Dimension) String Uses

func (m *TensorShapeProto_Dimension) String() string

func (*TensorShapeProto_Dimension) Unmarshal Uses

func (m *TensorShapeProto_Dimension) Unmarshal(dAtA []byte) error

func (*TensorShapeProto_Dimension) XXX_DiscardUnknown Uses

func (m *TensorShapeProto_Dimension) XXX_DiscardUnknown()

func (*TensorShapeProto_Dimension) XXX_Marshal Uses

func (m *TensorShapeProto_Dimension) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TensorShapeProto_Dimension) XXX_Merge Uses

func (dst *TensorShapeProto_Dimension) XXX_Merge(src proto.Message)

func (*TensorShapeProto_Dimension) XXX_OneofFuncs Uses

func (*TensorShapeProto_Dimension) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})

XXX_OneofFuncs is for the internal use of the proto package.

func (*TensorShapeProto_Dimension) XXX_Size Uses

func (m *TensorShapeProto_Dimension) XXX_Size() int

func (*TensorShapeProto_Dimension) XXX_Unmarshal Uses

func (m *TensorShapeProto_Dimension) XXX_Unmarshal(b []byte) error

type TensorShapeProto_Dimension_DimParam Uses

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

func (*TensorShapeProto_Dimension_DimParam) MarshalTo Uses

func (m *TensorShapeProto_Dimension_DimParam) MarshalTo(dAtA []byte) (int, error)

func (*TensorShapeProto_Dimension_DimParam) Size Uses

func (m *TensorShapeProto_Dimension_DimParam) Size() (n int)

type TensorShapeProto_Dimension_DimValue Uses

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

func (*TensorShapeProto_Dimension_DimValue) MarshalTo Uses

func (m *TensorShapeProto_Dimension_DimValue) MarshalTo(dAtA []byte) (int, error)

func (*TensorShapeProto_Dimension_DimValue) Size Uses

func (m *TensorShapeProto_Dimension_DimValue) Size() (n int)

type TypeProto Uses

type TypeProto struct {
    // Types that are valid to be assigned to Value:
    //	*TypeProto_TensorType
    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/master/docs/TypeDenotation.md#type-denotation-definition
    // for pre-defined type denotations.
    Denotation           *string  `protobuf:"bytes,6,opt,name=denotation" json:"denotation,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

Types

The standard ONNX data types.

func (*TypeProto) Descriptor Uses

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

func (*TypeProto) GetDenotation Uses

func (m *TypeProto) GetDenotation() string

func (*TypeProto) GetTensorType Uses

func (m *TypeProto) GetTensorType() *TypeProto_Tensor

func (*TypeProto) GetValue Uses

func (m *TypeProto) GetValue() isTypeProto_Value

func (*TypeProto) Marshal Uses

func (m *TypeProto) Marshal() (dAtA []byte, err error)

func (*TypeProto) MarshalTo Uses

func (m *TypeProto) MarshalTo(dAtA []byte) (int, error)

func (*TypeProto) ProtoMessage Uses

func (*TypeProto) ProtoMessage()

func (*TypeProto) Reset Uses

func (m *TypeProto) Reset()

func (*TypeProto) Size Uses

func (m *TypeProto) Size() (n int)

func (*TypeProto) String Uses

func (m *TypeProto) String() string

func (*TypeProto) Unmarshal Uses

func (m *TypeProto) Unmarshal(dAtA []byte) error

func (*TypeProto) XXX_DiscardUnknown Uses

func (m *TypeProto) XXX_DiscardUnknown()

func (*TypeProto) XXX_Marshal Uses

func (m *TypeProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TypeProto) XXX_Merge Uses

func (dst *TypeProto) XXX_Merge(src proto.Message)

func (*TypeProto) XXX_OneofFuncs Uses

func (*TypeProto) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})

XXX_OneofFuncs is for the internal use of the proto package.

func (*TypeProto) XXX_Size Uses

func (m *TypeProto) XXX_Size() int

func (*TypeProto) XXX_Unmarshal Uses

func (m *TypeProto) XXX_Unmarshal(b []byte) error

type TypeProto_Tensor Uses

type TypeProto_Tensor struct {
    // This field MUST NOT have the value of UNDEFINED
    // This field MUST be present for this version of the IR.
    ElemType             *TensorProto_DataType `protobuf:"varint,1,opt,name=elem_type,json=elemType,enum=onnx.TensorProto_DataType" json:"elem_type,omitempty"`
    Shape                *TensorShapeProto     `protobuf:"bytes,2,opt,name=shape" json:"shape,omitempty"`
    XXX_NoUnkeyedLiteral struct{}              `json:"-"`
    XXX_unrecognized     []byte                `json:"-"`
    XXX_sizecache        int32                 `json:"-"`
}

func (*TypeProto_Tensor) Descriptor Uses

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

func (*TypeProto_Tensor) GetElemType Uses

func (m *TypeProto_Tensor) GetElemType() TensorProto_DataType

func (*TypeProto_Tensor) GetShape Uses

func (m *TypeProto_Tensor) GetShape() *TensorShapeProto

func (*TypeProto_Tensor) Marshal Uses

func (m *TypeProto_Tensor) Marshal() (dAtA []byte, err error)

func (*TypeProto_Tensor) MarshalTo Uses

func (m *TypeProto_Tensor) MarshalTo(dAtA []byte) (int, error)

func (*TypeProto_Tensor) ProtoMessage Uses

func (*TypeProto_Tensor) ProtoMessage()

func (*TypeProto_Tensor) Reset Uses

func (m *TypeProto_Tensor) Reset()

func (*TypeProto_Tensor) Size Uses

func (m *TypeProto_Tensor) Size() (n int)

func (*TypeProto_Tensor) String Uses

func (m *TypeProto_Tensor) String() string

func (*TypeProto_Tensor) Unmarshal Uses

func (m *TypeProto_Tensor) Unmarshal(dAtA []byte) error

func (*TypeProto_Tensor) XXX_DiscardUnknown Uses

func (m *TypeProto_Tensor) XXX_DiscardUnknown()

func (*TypeProto_Tensor) XXX_Marshal Uses

func (m *TypeProto_Tensor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TypeProto_Tensor) XXX_Merge Uses

func (dst *TypeProto_Tensor) XXX_Merge(src proto.Message)

func (*TypeProto_Tensor) XXX_Size Uses

func (m *TypeProto_Tensor) XXX_Size() int

func (*TypeProto_Tensor) XXX_Unmarshal Uses

func (m *TypeProto_Tensor) XXX_Unmarshal(b []byte) error

type TypeProto_TensorType Uses

type TypeProto_TensorType struct {
    TensorType *TypeProto_Tensor `protobuf:"bytes,1,opt,name=tensor_type,json=tensorType,oneof"`
}

func (*TypeProto_TensorType) MarshalTo Uses

func (m *TypeProto_TensorType) MarshalTo(dAtA []byte) (int, error)

func (*TypeProto_TensorType) Size Uses

func (m *TypeProto_TensorType) Size() (n int)

type UnmarshalTypeError Uses

type UnmarshalTypeError struct {
    Value  string       // description of the ONNX attribute value - "bool", "array", "number -5"
    Type   reflect.Type // type of Go value it could not be assigned to
    Struct string       // name of the struct type containing the field
    Field  string       // name of the field holding the Go value
}

An UnmarshalTypeError describes an attribute value that was not appropriate for a value of a specific Go type.

func (*UnmarshalTypeError) Error Uses

func (e *UnmarshalTypeError) Error() string

type ValueInfoProto Uses

type ValueInfoProto struct {
    // This field MUST be present in this version of the IR.
    Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
    // This field MUST be present in this version of the IR.
    Type *TypeProto `protobuf:"bytes,2,opt,name=type" json:"type,omitempty"`
    // A human-readable documentation for this value. Markdown is allowed.
    DocString            *string  `protobuf:"bytes,3,opt,name=doc_string,json=docString" json:"doc_string,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

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

func (*ValueInfoProto) Descriptor Uses

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

func (*ValueInfoProto) GetDocString Uses

func (m *ValueInfoProto) GetDocString() string

func (*ValueInfoProto) GetName Uses

func (m *ValueInfoProto) GetName() string

func (*ValueInfoProto) GetType Uses

func (m *ValueInfoProto) GetType() *TypeProto

func (*ValueInfoProto) Marshal Uses

func (m *ValueInfoProto) Marshal() (dAtA []byte, err error)

func (*ValueInfoProto) MarshalTo Uses

func (m *ValueInfoProto) MarshalTo(dAtA []byte) (int, error)

func (*ValueInfoProto) ProtoMessage Uses

func (*ValueInfoProto) ProtoMessage()

func (*ValueInfoProto) Reset Uses

func (m *ValueInfoProto) Reset()

func (*ValueInfoProto) Size Uses

func (m *ValueInfoProto) Size() (n int)

func (*ValueInfoProto) String Uses

func (m *ValueInfoProto) String() string

func (*ValueInfoProto) Unmarshal Uses

func (m *ValueInfoProto) Unmarshal(dAtA []byte) error

func (*ValueInfoProto) XXX_DiscardUnknown Uses

func (m *ValueInfoProto) XXX_DiscardUnknown()

func (*ValueInfoProto) XXX_Marshal Uses

func (m *ValueInfoProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ValueInfoProto) XXX_Merge Uses

func (dst *ValueInfoProto) XXX_Merge(src proto.Message)

func (*ValueInfoProto) XXX_Size Uses

func (m *ValueInfoProto) XXX_Size() int

func (*ValueInfoProto) XXX_Unmarshal Uses

func (m *ValueInfoProto) XXX_Unmarshal(b []byte) error

type Version Uses

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 with 0x00000001,
    // which was the version we published on Oct 10, 2017.
    Version_IR_VERSION_2017_10_10 Version = 1
    // IR_VERSION 2 published on Oct 30, 2017
    // - Added type discriminator to AttributeProto to support proto3 users
    Version_IR_VERSION_2017_10_30 Version = 2
    // IR VERSION 3 published on Nov 3, 2017
    // - For operator versioning:
    //    - Added new message OperatorSetIdProto
    //    - Added opset_import in ModelProto
    // - For vendor extensions, added domain in NodeProto
    Version_IR_VERSION Version = 3
)

func (Version) Enum Uses

func (x Version) Enum() *Version

func (Version) EnumDescriptor Uses

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

func (Version) String Uses

func (x Version) String() string

func (*Version) UnmarshalJSON Uses

func (x *Version) UnmarshalJSON(data []byte) error

Package onnx imports 9 packages (graph) and is imported by 3 packages. Updated 2018-10-17. Refresh now. Tools for package owners.