Get desktop application:
View/edit binary Protocol Buffers messages
A named attribute containing either singular float, integer, string and tensor values, or repeated float, integer, string 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.
Used in:
The name field MUST be present for this version of the IR.
namespace Attribute
float
int
UTF-8 string
tensor value
graph
list of floats
list of ints
list of UTF-8 strings
list of tensors
list of graph
GraphProto defines a parameterized series of nodes to form a directed acyclic graph. This is the equivalent of the "network" and "graph" in many deep learning frameworks.
Used in: ,
The nodes in the graph.
The name of the graph.
namespace Graph
A list of named tensor values (constants), used to specify default values for some of the inputs of the graph. Each TensorProto entry must have a distinct name (within the list) that also appears in the input list. In an evaluation, the default value specified here is used if and only if user specifies no value for the corresponding input parameter. May be used to pass serialized parameters for networks.
A human-readable documentation for this graph. Markdown is allowed.
The inputs and outputs of the graph.
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.
ModelProto is a top-level file/container format for bundling a ML model. The semantics of the model are described by the GraphProto that represents a parameterized computation graph against a set of named operators that are defined independently from the graph.
The version of the IR this model targets. See Version enum above. This field MUST be present.
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.
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 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.
The version of the graph encoded. See Version enum below.
A human-readable documentation for this model. Markdown is allowed.
The parameterized graph that is evaluated to execute the model.
NodeProto stores a node that is similar to the notion of "layer" or "operator" in many deep 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.
Used in:
namespace Value
namespace Value
namespace Node
namespace Operator
Additional named attributes.
A human-readable documentation for this graph. Markdown is allowed.
A sparse tensor must be stored as three dense tensors: 1. dims: The shape of the original dense tensor. 2. indices: A 2-D tensor specifying the indices of the nonzero elements. 3. values: A 1-D tensor containing the values of the nonzero elements.
The dimensions in the tensor.
This field MUST be present this version of the IR.
This field MUST be present this version of the IR.
A message defined to store a tensor in its serialized format.
Used in: , ,
The shape of the tensor.
The data type of the tensor.
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.
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
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
For int64. When this field is present, the data_type field MUST be INT64
Optionally, a name for the tensor.
namespace Value
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
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
For uint64 and uint32 values When this field is present, the data_type field MUST be UINT32 or UINT64
Used in: , ,
Basic types.
float
uint8_t
int8_t
uint16_t
int16_t
int32_t
int64_t
string
bool
Advanced types
complex with float32 real and imaginary components
complex with float64 real and imaginary components
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.
Used in:
Define the types.
Used in:
The type of a tensor.
The type of a sparse tensor.
Used in:
This field MUST NOT have the value of UNDEFINED This field MUST be present for this version of the IR.
Defines a tensor shape. A dimension can be either an integer value or a symbolic variable. A symbolic variable represents an unknown dimension.
Used in: ,
Used in:
namespace Shape
Used in:
This field MUST NOT have the value of UNDEFINED This field MUST be present for this version of the IR.
Defines information on value, including the name, the type, and the shape of the value.
Used in:
This field MUST be present in this version of the IR.
namespace Value
This field MUST be present in this version of the IR.
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.
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. We should use version as xx(major) - xx(minor) - xxxx(bugfix) and we are starting with 00000001.