package onnx
- Alphabetic
- Public
- All
Type Members
-
final
case class
AttributeProto(name: String = "", refAttrName: String = "", docString: String = "", type: AttributeType = ..., f: Float = 0.0f, i: Long = 0L, s: ByteString = ..., t: Option[TensorProto] = None, g: Option[GraphProto] = None, floats: Seq[Float] = _root_.scala.collection.Seq.empty, ints: Seq[Long] = _root_.scala.collection.Seq.empty, strings: Seq[ByteString] = _root_.scala.collection.Seq.empty, tensors: Seq[TensorProto] = _root_.scala.collection.Seq.empty, graphs: Seq[GraphProto] = _root_.scala.collection.Seq.empty) extends GeneratedMessage with Message[AttributeProto] with Updatable[AttributeProto] with Product with Serializable
Attributes
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.
- name
The name field MUST be present for this version of the IR. namespace Attribute
- refAttrName
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.
- docString
A human-readable documentation for this attribute. Markdown is allowed.
- type
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. discriminator that indicates which field below is in use
- f
Exactly ONE of the following fields must be present for this version of the IR float
- i
int
- s
UTF-8 string
- t
tensor value
- g
graph
- floats
list of floats
- ints
list of ints
- strings
list of UTF-8 strings
- tensors
list of tensors
- graphs
list of graph
- Annotations
- @SerialVersionUID()
-
final
case class
DenotationConstProto(dATABATCH: String = "", dATACHANNEL: String = "", dATATIME: String = "", dATAFEATURE: String = "", fILTERINCHANNEL: String = "", fILTEROUTCHANNEL: String = "", fILTERSPATIAL: String = "") extends GeneratedMessage with Message[DenotationConstProto] with Updatable[DenotationConstProto] with Product with Serializable
A set of pre-defined constants to be used as values for the standard denotation field in TensorShapeProto.Dimension for semantic description of the tensor dimension.
A set of pre-defined constants to be used as values for the standard denotation field in TensorShapeProto.Dimension for semantic description of the tensor dimension.
- dATABATCH
Describe a batch number dimension.
- dATACHANNEL
Describe a channel dimension.
- dATATIME
Describe a time dimension.
- dATAFEATURE
Describe a feature dimension. This is typically a feature dimension in RNN and/or spatial dimension in CNN.
- fILTERINCHANNEL
Describe a filter in-channel dimension. This is the dimension that is identical (in size) to the channel dimension of the input image feature maps.
- fILTEROUTCHANNEL
Describe a filter out channel dimension. This is the dimension that is identical (int size) to the channel dimension of the output image feature maps.
- fILTERSPATIAL
Describe a filter spatial dimension.
- Annotations
- @SerialVersionUID()
-
final
case class
GraphProto(node: Seq[NodeProto] = _root_.scala.collection.Seq.empty, name: String = "", initializer: Seq[TensorProto] = _root_.scala.collection.Seq.empty, docString: String = "", input: Seq[ValueInfoProto] = _root_.scala.collection.Seq.empty, output: Seq[ValueInfoProto] = _root_.scala.collection.Seq.empty, valueInfo: Seq[ValueInfoProto] = _root_.scala.collection.Seq.empty) extends GeneratedMessage with Message[GraphProto] with Updatable[GraphProto] with Product with Serializable
Graphs
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.
- node
The nodes in the graph, sorted topologically.
- name
The name of the graph. namespace Graph
- initializer
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.
- docString
A human-readable documentation for this graph. Markdown is allowed.
- input
The inputs and outputs of the graph.
- valueInfo
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.
- Annotations
- @SerialVersionUID()
-
final
case class
ModelProto(irVersion: Long = 0L, opsetImport: Seq[OperatorSetIdProto] = _root_.scala.collection.Seq.empty, producerName: String = "", producerVersion: String = "", domain: String = "", modelVersion: Long = 0L, docString: String = "", graph: Option[GraphProto] = None, metadataProps: Seq[StringStringEntryProto] = _root_.scala.collection.Seq.empty) extends GeneratedMessage with Message[ModelProto] with Updatable[ModelProto] with Product with Serializable
Models
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.
- irVersion
The version of the IR this model targets. See Version enum above. This field MUST be present.
- opsetImport
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.
- producerName
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.
- producerVersion
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.
- domain
Domain name of the model. We use reverse domain names as name space indicators. For example:
com.facebook.fairorcom.microsoft.cognitiveservicesTogether withmodel_versionand GraphProto.name, this forms the unique identity of the graph.- modelVersion
The version of the graph encoded. See Version enum below.
- docString
A human-readable documentation for this model. Markdown is allowed.
- graph
The parameterized graph that is evaluated to execute the model.
- metadataProps
Named metadata values; keys should be distinct.
- Annotations
- @SerialVersionUID()
-
final
case class
NodeProto(input: Seq[String] = _root_.scala.collection.Seq.empty, output: Seq[String] = _root_.scala.collection.Seq.empty, name: String = "", opType: String = "", domain: String = "", attribute: Seq[AttributeProto] = _root_.scala.collection.Seq.empty, docString: String = "") extends GeneratedMessage with Message[NodeProto] with Updatable[NodeProto] with Product with Serializable
Nodes
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.
- input
namespace Value
- output
namespace Value
- name
An optional identifier for this node in a graph. This field MAY be absent in ths version of the IR. namespace Node
- opType
The symbolic identifier of the Operator to execute. namespace Operator
- domain
The domain of the OperatorSet that specifies the operator named by op_type. namespace Domain
- attribute
Additional named attributes.
- docString
A human-readable documentation for this node. Markdown is allowed.
- Annotations
- @SerialVersionUID()
-
final
case class
OperatorSetIdProto(domain: String = "", version: Long = 0L) extends GeneratedMessage with Message[OperatorSetIdProto] with Updatable[OperatorSetIdProto] with Product with Serializable
Operator Sets
Operator Sets
OperatorSets are uniquely identified by a (domain, opset_version) pair.
- domain
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.
- version
The version of the operator set being identified. This field MUST be present in this version of the IR.
- Annotations
- @SerialVersionUID()
-
final
case class
StringStringEntryProto(key: String = "", value: String = "") extends GeneratedMessage with Message[StringStringEntryProto] with Updatable[StringStringEntryProto] with Product with Serializable
StringStringEntryProto follows the pattern for cross-proto-version maps.
StringStringEntryProto follows the pattern for cross-proto-version maps. See https://developers.google.com/protocol-buffers/docs/proto3#maps
- Annotations
- @SerialVersionUID()
-
final
case class
TensorProto(dims: Seq[Long] = _root_.scala.collection.Seq.empty, dataType: DataType = ..., segment: Option[Segment] = None, floatData: Seq[Float] = _root_.scala.collection.Seq.empty, int32Data: Seq[Int] = _root_.scala.collection.Seq.empty, stringData: Seq[ByteString] = _root_.scala.collection.Seq.empty, int64Data: Seq[Long] = _root_.scala.collection.Seq.empty, name: String = "", docString: String = "", rawData: ByteString = ..., doubleData: Seq[Double] = _root_.scala.collection.Seq.empty, uint64Data: Seq[Long] = _root_.scala.collection.Seq.empty) extends GeneratedMessage with Message[TensorProto] with Updatable[TensorProto] with Product with Serializable
Tensors
Tensors
A serialized tensor value.
- dims
The shape of the tensor.
- dataType
The data type of the tensor.
- floatData
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.
- int32Data
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 FLOAT32
- stringData
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
- int64Data
For int64. When this field is present, the data_type field MUST be INT64
- name
Optionally, a name for the tensor. namespace Value
- docString
A human-readable documentation for this tensor. Markdown is allowed.
- rawData
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
- doubleData
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
- uint64Data
For uint64 and uint32 values When this field is present, the data_type field MUST be UINT32 or UINT64
- Annotations
- @SerialVersionUID()
-
final
case class
TensorShapeProto(dim: Seq[Dimension] = _root_.scala.collection.Seq.empty) extends GeneratedMessage with Message[TensorShapeProto] with Updatable[TensorShapeProto] with Product with Serializable
Defines a tensor shape.
Defines a tensor shape. A dimension can be either an integer value or a symbolic variable. A symbolic variable represents an unknown dimension.
- Annotations
- @SerialVersionUID()
-
final
case class
TypeProto(value: Value = ...) extends GeneratedMessage with Message[TypeProto] with Updatable[TypeProto] with Product with Serializable
Types
Types
The standard ONNX data types.
- Annotations
- @SerialVersionUID()
-
final
case class
ValueInfoProto(name: String = "", type: Option[TypeProto] = None, docString: String = "") extends GeneratedMessage with Message[ValueInfoProto] with Updatable[ValueInfoProto] with Product with Serializable
Defines information on value, including the name, the type, and the shape of the value.
Defines information on value, including the name, the type, and the shape of the value.
- name
This field MUST be present in this version of the IR. namespace Value
- type
This field MUST be present in this version of the IR.
- docString
A human-readable documentation for this value. Markdown is allowed.
- Annotations
- @SerialVersionUID()
- sealed trait Version extends GeneratedEnum
Value Members
- object AttributeProto extends GeneratedMessageCompanion[AttributeProto] with Serializable
- object DenotationConstProto extends GeneratedMessageCompanion[DenotationConstProto] with Serializable
- object GraphProto extends GeneratedMessageCompanion[GraphProto] with Serializable
- object ModelProto extends GeneratedMessageCompanion[ModelProto] with Serializable
- object NodeProto extends GeneratedMessageCompanion[NodeProto] with Serializable
- object OnnxProto extends GeneratedFileObject
- object OperatorSetIdProto extends GeneratedMessageCompanion[OperatorSetIdProto] with Serializable
- object StringStringEntryProto extends GeneratedMessageCompanion[StringStringEntryProto] with Serializable
- object TensorProto extends GeneratedMessageCompanion[TensorProto] with Serializable
- object TensorShapeProto extends GeneratedMessageCompanion[TensorShapeProto] with Serializable
- object TypeProto extends GeneratedMessageCompanion[TypeProto] with Serializable
- object ValueInfoProto extends GeneratedMessageCompanion[ValueInfoProto] with Serializable
- object Version extends GeneratedEnumCompanion[Version] with Serializable