protos

AttributeProto

class onnx_extended.onnx2.AttributeProto

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.

class AttributeType

Members:

UNDEFINED

FLOAT

INT

STRING

GRAPH

SPARSE_TENSOR

FLOATS

INTS

STRINGS

GRAPHS

SPARSE_TENSORS

static items() list[tuple[str, onnx_extended.onnx2.cpu._onnx2py.AttributeProto.AttributeType]]

Returns the list of (name, type).

static keys() list[str]

Returns the list of names.

property name
static values() list[onnx_extended.onnx2.cpu._onnx2py.AttributeProto.AttributeType]

Returns the list of types.

CopyFrom(self: onnx_extended.onnx2.cpu._onnx2py.AttributeProto, arg0: onnx_extended.onnx2.cpu._onnx2py.AttributeProto) None

Copies one instance into this one.

ParseFromFile(self: onnx_extended.onnx2.cpu._onnx2py.AttributeProto, name: str, options: object = None) None

Parses a binary file to fill this instance.

ParseFromString(self: onnx_extended.onnx2.cpu._onnx2py.AttributeProto, data: bytes, options: object = None) None

Parses a sequence of bytes to fill this instance.

SerializeSize(self: onnx_extended.onnx2.cpu._onnx2py.AttributeProto, options: object = None) int

Returns the size once serialized without serializing.

SerializeToFile(self: onnx_extended.onnx2.cpu._onnx2py.AttributeProto, name: str, options: object = None) None

Serializes this instance into a file.

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.AttributeProto, options: object = None) bytes

Serializes this instance into a sequence of bytes.

add_g(self: onnx_extended.onnx2.cpu._onnx2py.AttributeProto) onnx2::GraphProto

Sets an empty value.

add_sparse_tensor(self: onnx_extended.onnx2.cpu._onnx2py.AttributeProto) onnx_extended.onnx2.cpu._onnx2py.SparseTensorProto

Sets an empty value.

add_t(self: onnx_extended.onnx2.cpu._onnx2py.AttributeProto) onnx_extended.onnx2.cpu._onnx2py.TensorProto

Sets an empty value.

add_tp(self: onnx_extended.onnx2.cpu._onnx2py.AttributeProto) onnx_extended.onnx2.cpu._onnx2py.TypeProto

Sets an empty value.

property doc_string

A human-readable documentation for this tensor. Markdown is allowed.

property f

Optional float attribute.

property floats

Optional repeated float attribute.

property g

Optional graph attribute.

property graphs

Optional repeated graph attribute.

has_doc_string(self: onnx_extended.onnx2.cpu._onnx2py.AttributeProto) bool

Tells if ‘doc_string’ has a value

has_f(self: onnx_extended.onnx2.cpu._onnx2py.AttributeProto) bool

Tells if ‘f’ has a value.

has_floats(self: onnx_extended.onnx2.cpu._onnx2py.AttributeProto) bool

Tells if ‘floats’ has a value.

has_g(self: onnx_extended.onnx2.cpu._onnx2py.AttributeProto) bool

Tells if ‘g’ has a value.

has_graphs(self: onnx_extended.onnx2.cpu._onnx2py.AttributeProto) bool

Tells if ‘graphs’ has a value.

has_i(self: onnx_extended.onnx2.cpu._onnx2py.AttributeProto) bool

Tells if ‘i’ has a value.

has_ints(self: onnx_extended.onnx2.cpu._onnx2py.AttributeProto) bool

Tells if ‘ints’ has a value.

has_name(self: onnx_extended.onnx2.cpu._onnx2py.AttributeProto) bool

Tells if ‘name’ has a value

has_ref_attr_name(self: onnx_extended.onnx2.cpu._onnx2py.AttributeProto) bool

Tells if ‘ref_attr_name’ has a value

has_s(self: onnx_extended.onnx2.cpu._onnx2py.AttributeProto) bool

Tells if ‘s’ has a value

has_sparse_tensor(self: onnx_extended.onnx2.cpu._onnx2py.AttributeProto) bool

Tells if ‘sparse_tensor’ has a value.

has_sparse_tensors(self: onnx_extended.onnx2.cpu._onnx2py.AttributeProto) bool

Tells if ‘sparse_tensors’ has a value.

has_strings(self: onnx_extended.onnx2.cpu._onnx2py.AttributeProto) bool

Tells if ‘strings’ has a value.

has_t(self: onnx_extended.onnx2.cpu._onnx2py.AttributeProto) bool

Tells if ‘t’ has a value.

has_tensors(self: onnx_extended.onnx2.cpu._onnx2py.AttributeProto) bool

Tells if ‘tensors’ has a value.

has_tp(self: onnx_extended.onnx2.cpu._onnx2py.AttributeProto) bool

Tells if ‘tp’ has a value.

property i

Optional int64 attribute.

property ints

Optional repeated int64 attribute.

property name

Attribute name. This field MUST be present in this version of the IR.

property ref_attr_name

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.

property s

Optional string attribute.

property sparse_tensor

Optional sparse tensor attribute.

property sparse_tensors

Optional repeated tensor attribute.

property strings

Optional repeated string attribute.

property t

Optional tensor attribute.

property tensors

Optional repeated tensor attribute.

property tp

Type proto

property 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 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.

DeviceConfigurationProto

class onnx_extended.onnx2.DeviceConfigurationProto

Describes a multi-device configuration for a model.

CopyFrom(self: onnx_extended.onnx2.cpu._onnx2py.DeviceConfigurationProto, arg0: onnx_extended.onnx2.cpu._onnx2py.DeviceConfigurationProto) None

Copies one instance into this one.

ParseFromFile(self: onnx_extended.onnx2.cpu._onnx2py.DeviceConfigurationProto, name: str, options: object = None) None

Parses a binary file to fill this instance.

ParseFromString(self: onnx_extended.onnx2.cpu._onnx2py.DeviceConfigurationProto, data: bytes, options: object = None) None

Parses a sequence of bytes to fill this instance.

SerializeSize(self: onnx_extended.onnx2.cpu._onnx2py.DeviceConfigurationProto, options: object = None) int

Returns the size once serialized without serializing.

SerializeToFile(self: onnx_extended.onnx2.cpu._onnx2py.DeviceConfigurationProto, name: str, options: object = None) None

Serializes this instance into a file.

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.DeviceConfigurationProto, options: object = None) bytes

Serializes this instance into a sequence of bytes.

property device

Optional names of the devices. MUST be length of num_devices if provided.

has_device(self: onnx_extended.onnx2.cpu._onnx2py.DeviceConfigurationProto) bool

Tells if ‘device’ has a value.

has_name(self: onnx_extended.onnx2.cpu._onnx2py.DeviceConfigurationProto) bool

Tells if ‘name’ has a value

has_num_devices(self: onnx_extended.onnx2.cpu._onnx2py.DeviceConfigurationProto) bool

Tells if ‘num_devices’ has a value.

property name

This field MUST be present for this version of the IR. Name of the configuration.

property num_devices

This field MUST be present for this version of the IR. Number of devices inside this configuration.

FunctionProto

class onnx_extended.onnx2.FunctionProto

A function defines a sub-operator that can be used in a graph. It is similar to a function in C/C++ or Python, and can be used to define reusable sub-graphs.

CopyFrom(self: onnx_extended.onnx2.cpu._onnx2py.FunctionProto, arg0: onnx_extended.onnx2.cpu._onnx2py.FunctionProto) None

Copies one instance into this one.

ParseFromFile(self: onnx_extended.onnx2.cpu._onnx2py.FunctionProto, name: str, options: object = None) None

Parses a binary file to fill this instance.

ParseFromString(self: onnx_extended.onnx2.cpu._onnx2py.FunctionProto, data: bytes, options: object = None) None

Parses a sequence of bytes to fill this instance.

SerializeSize(self: onnx_extended.onnx2.cpu._onnx2py.FunctionProto, options: object = None) int

Returns the size once serialized without serializing.

SerializeToFile(self: onnx_extended.onnx2.cpu._onnx2py.FunctionProto, name: str, options: object = None) None

Serializes this instance into a file.

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.FunctionProto, options: object = None) bytes

Serializes this instance into a sequence of bytes.

property attribute

attribute names of the function

property attribute_proto

typed attributes

property doc_string

A human-readable documentation for this graph. Markdown is allowed.

has_attribute(self: onnx_extended.onnx2.cpu._onnx2py.FunctionProto) bool

Tells if ‘attribute’ has a value.

has_attribute_proto(self: onnx_extended.onnx2.cpu._onnx2py.FunctionProto) bool

Tells if ‘attribute_proto’ has a value.

has_doc_string(self: onnx_extended.onnx2.cpu._onnx2py.FunctionProto) bool

Tells if ‘doc_string’ has a value

has_input(self: onnx_extended.onnx2.cpu._onnx2py.FunctionProto) bool

Tells if ‘input’ has a value.

has_metadata_props(self: onnx_extended.onnx2.cpu._onnx2py.FunctionProto) bool

Tells if ‘metadata_props’ has a value.

has_name(self: onnx_extended.onnx2.cpu._onnx2py.FunctionProto) bool

Tells if ‘name’ has a value

has_node(self: onnx_extended.onnx2.cpu._onnx2py.FunctionProto) bool

Tells if ‘node’ has a value.

has_opset_import(self: onnx_extended.onnx2.cpu._onnx2py.FunctionProto) bool

Tells if ‘opset_import’ has a value.

has_output(self: onnx_extended.onnx2.cpu._onnx2py.FunctionProto) bool

Tells if ‘output’ has a value.

has_value_info(self: onnx_extended.onnx2.cpu._onnx2py.FunctionProto) bool

Tells if ‘value_info’ has a value.

property input

input names of the function

property metadata_props

Named metadata values; keys should be distinct.

property name

The name of the function. This field MUST be present in this version of the IR.

property node

The nodes in the graph, sorted topologically.

property opset_import

The OperatorSets this function body (graph) relies on. All nodes in the function body (graph) will bind against the operator with the same-domain/same-op_type operator with the HIGHEST version in the referenced operator sets. This means at most one version can be relied for one domain. The operator sets imported by FunctionProto should be compatible with the ones imported by ModelProto. Example, if same operator set say ‘A’ is imported by FunctionProto and ModelProto 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.

property output

output names of the function

property value_info

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.

GraphProto

class onnx_extended.onnx2.GraphProto

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.

CopyFrom(self: onnx_extended.onnx2.cpu._onnx2py.GraphProto, arg0: onnx_extended.onnx2.cpu._onnx2py.GraphProto) None

Copies one instance into this one.

ParseFromFile(self: onnx_extended.onnx2.cpu._onnx2py.GraphProto, name: str, options: object = None) None

Parses a binary file to fill this instance.

ParseFromString(self: onnx_extended.onnx2.cpu._onnx2py.GraphProto, data: bytes, options: object = None) None

Parses a sequence of bytes to fill this instance.

SerializeSize(self: onnx_extended.onnx2.cpu._onnx2py.GraphProto, options: object = None) int

Returns the size once serialized without serializing.

SerializeToFile(self: onnx_extended.onnx2.cpu._onnx2py.GraphProto, name: str, options: object = None) None

Serializes this instance into a file.

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.GraphProto, options: object = None) bytes

Serializes this instance into a sequence of bytes.

property doc_string

A human-readable documentation for this graph. Markdown is allowed.

has_doc_string(self: onnx_extended.onnx2.cpu._onnx2py.GraphProto) bool

Tells if ‘doc_string’ has a value

has_initializer(self: onnx_extended.onnx2.cpu._onnx2py.GraphProto) bool

Tells if ‘initializer’ has a value.

has_input(self: onnx_extended.onnx2.cpu._onnx2py.GraphProto) bool

Tells if ‘input’ has a value.

has_metadata_props(self: onnx_extended.onnx2.cpu._onnx2py.GraphProto) bool

Tells if ‘metadata_props’ has a value.

has_name(self: onnx_extended.onnx2.cpu._onnx2py.GraphProto) bool

Tells if ‘name’ has a value

has_node(self: onnx_extended.onnx2.cpu._onnx2py.GraphProto) bool

Tells if ‘node’ has a value.

has_output(self: onnx_extended.onnx2.cpu._onnx2py.GraphProto) bool

Tells if ‘output’ has a value.

has_quantization_annotation(self: onnx_extended.onnx2.cpu._onnx2py.GraphProto) bool

Tells if ‘quantization_annotation’ has a value.

has_sparse_initializer(self: onnx_extended.onnx2.cpu._onnx2py.GraphProto) bool

Tells if ‘sparse_initializer’ has a value.

has_value_info(self: onnx_extended.onnx2.cpu._onnx2py.GraphProto) bool

Tells if ‘value_info’ has a value.

property initializer

A list of named sparse 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.

property input

Inputs of the graph, shapes and types are optional in a subgraph and mandatory in the main graph.

property metadata_props

Named metadata values; keys should be distinct.

property name

The name of the graph.

property node

The nodes in the graph, sorted topologically.

property output

Outputs of the graph, shapes and types are optional in a subgraph and mandatory in the main graph.

property quantization_annotation

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.

property sparse_initializer

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.

property value_info

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.

IntIntListEntryProto

class onnx_extended.onnx2.IntIntListEntryProto

Defines a key value pair, key is an integer, value is a list of integers.

CopyFrom(self: onnx_extended.onnx2.cpu._onnx2py.IntIntListEntryProto, arg0: onnx_extended.onnx2.cpu._onnx2py.IntIntListEntryProto) None

Copies one instance into this one.

ParseFromFile(self: onnx_extended.onnx2.cpu._onnx2py.IntIntListEntryProto, name: str, options: object = None) None

Parses a binary file to fill this instance.

ParseFromString(self: onnx_extended.onnx2.cpu._onnx2py.IntIntListEntryProto, data: bytes, options: object = None) None

Parses a sequence of bytes to fill this instance.

SerializeSize(self: onnx_extended.onnx2.cpu._onnx2py.IntIntListEntryProto, options: object = None) int

Returns the size once serialized without serializing.

SerializeToFile(self: onnx_extended.onnx2.cpu._onnx2py.IntIntListEntryProto, name: str, options: object = None) None

Serializes this instance into a file.

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.IntIntListEntryProto, options: object = None) bytes

Serializes this instance into a sequence of bytes.

has_key(self: onnx_extended.onnx2.cpu._onnx2py.IntIntListEntryProto) bool

Tells if ‘key’ has a value.

has_value(self: onnx_extended.onnx2.cpu._onnx2py.IntIntListEntryProto) bool

Tells if ‘value’ has a value.

property key

the key

property value

the value is a list of integers

Message

class onnx_extended.onnx2.Message

Message, base class for all onnx2 classes

ModelProto

class onnx_extended.onnx2.ModelProto

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.

CopyFrom(self: onnx_extended.onnx2.cpu._onnx2py.ModelProto, arg0: onnx_extended.onnx2.cpu._onnx2py.ModelProto) None

Copies one instance into this one.

ParseFromFile(self: onnx_extended.onnx2.cpu._onnx2py.ModelProto, name: str, options: object = None) None

Parses a binary file to fill this instance.

ParseFromString(self: onnx_extended.onnx2.cpu._onnx2py.ModelProto, data: bytes, options: object = None) None

Parses a sequence of bytes to fill this instance.

SerializeSize(self: onnx_extended.onnx2.cpu._onnx2py.ModelProto, options: object = None) int

Returns the size once serialized without serializing.

SerializeToFile(self: onnx_extended.onnx2.cpu._onnx2py.ModelProto, name: str, options: object = None) None

Serializes this instance into a file.

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.ModelProto, options: object = None) bytes

Serializes this instance into a sequence of bytes.

add_graph(self: onnx_extended.onnx2.cpu._onnx2py.ModelProto) onnx_extended.onnx2.cpu._onnx2py.GraphProto

Sets an empty value.

property configuration

Describes different target configurations for a multi-device use case. A model MAY describe multiple multi-device configurations for execution.

property doc_string

A human-readable documentation for this graph. Markdown is allowed.

property domain

Domain name of the model. We use reverse domain names as name space indicators. For example: company.name. Together with model_version and GraphProto.name, this forms the unique identity of the graph.

property functions

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 priority 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.

property graph

The parameterized graph that is evaluated to execute the model.

has_configuration(self: onnx_extended.onnx2.cpu._onnx2py.ModelProto) bool

Tells if ‘configuration’ has a value.

has_doc_string(self: onnx_extended.onnx2.cpu._onnx2py.ModelProto) bool

Tells if ‘doc_string’ has a value

has_domain(self: onnx_extended.onnx2.cpu._onnx2py.ModelProto) bool

Tells if ‘domain’ has a value

has_functions(self: onnx_extended.onnx2.cpu._onnx2py.ModelProto) bool

Tells if ‘functions’ has a value.

has_graph(self: onnx_extended.onnx2.cpu._onnx2py.ModelProto) bool

Tells if ‘graph’ has a value.

has_ir_version(self: onnx_extended.onnx2.cpu._onnx2py.ModelProto) bool

Tells if ‘ir_version’ has a value.

has_metadata_props(self: onnx_extended.onnx2.cpu._onnx2py.ModelProto) bool

Tells if ‘metadata_props’ has a value.

has_model_version(self: onnx_extended.onnx2.cpu._onnx2py.ModelProto) bool

Tells if ‘model_version’ has a value.

has_opset_import(self: onnx_extended.onnx2.cpu._onnx2py.ModelProto) bool

Tells if ‘opset_import’ has a value.

has_producer_name(self: onnx_extended.onnx2.cpu._onnx2py.ModelProto) bool

Tells if ‘producer_name’ has a value

has_producer_version(self: onnx_extended.onnx2.cpu._onnx2py.ModelProto) bool

Tells if ‘producer_version’ has a value

property ir_version

The version of the IR this model targets. See Version enum above. This field MUST be present.

property metadata_props

Named metadata values; keys should be distinct.

property model_version

The version of the graph encoded. See Version enum below.

property opset_import

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.

property producer_name

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.

property producer_version

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.

NodeDeviceConfigurationProto

class onnx_extended.onnx2.NodeDeviceConfigurationProto

Defines a multi-device configuration proto for NodeProto.

CopyFrom(self: onnx_extended.onnx2.cpu._onnx2py.NodeDeviceConfigurationProto, arg0: onnx_extended.onnx2.cpu._onnx2py.NodeDeviceConfigurationProto) None

Copies one instance into this one.

ParseFromFile(self: onnx_extended.onnx2.cpu._onnx2py.NodeDeviceConfigurationProto, name: str, options: object = None) None

Parses a binary file to fill this instance.

ParseFromString(self: onnx_extended.onnx2.cpu._onnx2py.NodeDeviceConfigurationProto, data: bytes, options: object = None) None

Parses a sequence of bytes to fill this instance.

SerializeSize(self: onnx_extended.onnx2.cpu._onnx2py.NodeDeviceConfigurationProto, options: object = None) int

Returns the size once serialized without serializing.

SerializeToFile(self: onnx_extended.onnx2.cpu._onnx2py.NodeDeviceConfigurationProto, name: str, options: object = None) None

Serializes this instance into a file.

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.NodeDeviceConfigurationProto, options: object = None) bytes

Serializes this instance into a sequence of bytes.

property configuration_id

This field MUST be present for this version of the IR., ID of the configuration. MUST match the name of a DeviceConfigurationProto.

has_configuration_id(self: onnx_extended.onnx2.cpu._onnx2py.NodeDeviceConfigurationProto) bool

Tells if ‘configuration_id’ has a value

has_pipeline_stage(self: onnx_extended.onnx2.cpu._onnx2py.NodeDeviceConfigurationProto) bool

Tells if ‘pipeline_stage’ has a value.

has_sharding_spec(self: onnx_extended.onnx2.cpu._onnx2py.NodeDeviceConfigurationProto) bool

Tells if ‘sharding_spec’ has a value.

property pipeline_stage

Pipeline stage of this node.

property sharding_spec

Sharding spec for the node.

NodeProto

class onnx_extended.onnx2.NodeProto

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.

CopyFrom(self: onnx_extended.onnx2.cpu._onnx2py.NodeProto, arg0: onnx_extended.onnx2.cpu._onnx2py.NodeProto) None

Copies one instance into this one.

ParseFromFile(self: onnx_extended.onnx2.cpu._onnx2py.NodeProto, name: str, options: object = None) None

Parses a binary file to fill this instance.

ParseFromString(self: onnx_extended.onnx2.cpu._onnx2py.NodeProto, data: bytes, options: object = None) None

Parses a sequence of bytes to fill this instance.

SerializeSize(self: onnx_extended.onnx2.cpu._onnx2py.NodeProto, options: object = None) int

Returns the size once serialized without serializing.

SerializeToFile(self: onnx_extended.onnx2.cpu._onnx2py.NodeProto, name: str, options: object = None) None

Serializes this instance into a file.

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.NodeProto, options: object = None) bytes

Serializes this instance into a sequence of bytes.

property attribute

Attributes associated with this node.

property device_configurations

Configuration of multi-device annotations.

property doc_string

A human-readable documentation for this node. Markdown is allowed.

property domain

The domain of the OperatorSet that specifies the operator named by op_type.

has_attribute(self: onnx_extended.onnx2.cpu._onnx2py.NodeProto) bool

Tells if ‘attribute’ has a value.

has_device_configurations(self: onnx_extended.onnx2.cpu._onnx2py.NodeProto) bool

Tells if ‘device_configurations’ has a value.

has_doc_string(self: onnx_extended.onnx2.cpu._onnx2py.NodeProto) bool

Tells if ‘doc_string’ has a value

has_domain(self: onnx_extended.onnx2.cpu._onnx2py.NodeProto) bool

Tells if ‘domain’ has a value

has_input(self: onnx_extended.onnx2.cpu._onnx2py.NodeProto) bool

Tells if ‘input’ has a value.

has_metadata_props(self: onnx_extended.onnx2.cpu._onnx2py.NodeProto) bool

Tells if ‘metadata_props’ has a value.

has_name(self: onnx_extended.onnx2.cpu._onnx2py.NodeProto) bool

Tells if ‘name’ has a value

has_op_type(self: onnx_extended.onnx2.cpu._onnx2py.NodeProto) bool

Tells if ‘op_type’ has a value

has_output(self: onnx_extended.onnx2.cpu._onnx2py.NodeProto) bool

Tells if ‘output’ has a value.

has_overload(self: onnx_extended.onnx2.cpu._onnx2py.NodeProto) bool

Tells if ‘overload’ has a value

property input

inputs of the node

property metadata_props

Named metadata values; keys should be distinct.

property name

An optional identifier for this node in a graph. This field MAY be absent in this version of the IR.

property op_type

The symbolic identifier of the Operator to execute.

property output

outputs of the node

property overload

Overload identifier, used only to map this to a model-local function.

OperatorSetIdProto

class onnx_extended.onnx2.OperatorSetIdProto

Defines a unqiue pair domain, opset version for a set of operators.

CopyFrom(self: onnx_extended.onnx2.cpu._onnx2py.OperatorSetIdProto, arg0: onnx_extended.onnx2.cpu._onnx2py.OperatorSetIdProto) None

Copies one instance into this one.

ParseFromFile(self: onnx_extended.onnx2.cpu._onnx2py.OperatorSetIdProto, name: str, options: object = None) None

Parses a binary file to fill this instance.

ParseFromString(self: onnx_extended.onnx2.cpu._onnx2py.OperatorSetIdProto, data: bytes, options: object = None) None

Parses a sequence of bytes to fill this instance.

SerializeSize(self: onnx_extended.onnx2.cpu._onnx2py.OperatorSetIdProto, options: object = None) int

Returns the size once serialized without serializing.

SerializeToFile(self: onnx_extended.onnx2.cpu._onnx2py.OperatorSetIdProto, name: str, options: object = None) None

Serializes this instance into a file.

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.OperatorSetIdProto, options: object = None) bytes

Serializes this instance into a sequence of bytes.

property 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.

has_domain(self: onnx_extended.onnx2.cpu._onnx2py.OperatorSetIdProto) bool

Tells if ‘domain’ has a value

has_version(self: onnx_extended.onnx2.cpu._onnx2py.OperatorSetIdProto) bool

Tells if ‘version’ has a value.

property version

The version of the operator set being identified. This field MUST be present in this version of the IR.

OperatorStatus

class onnx_extended.onnx2.OperatorStatus

Members:

EXPERIMENTAL

STABLE

property name

ShardedDimProto

class onnx_extended.onnx2.ShardedDimProto

Describes the sharding spec for a single axis of a sharded tensor.

CopyFrom(self: onnx_extended.onnx2.cpu._onnx2py.ShardedDimProto, arg0: onnx_extended.onnx2.cpu._onnx2py.ShardedDimProto) None

Copies one instance into this one.

ParseFromFile(self: onnx_extended.onnx2.cpu._onnx2py.ShardedDimProto, name: str, options: object = None) None

Parses a binary file to fill this instance.

ParseFromString(self: onnx_extended.onnx2.cpu._onnx2py.ShardedDimProto, data: bytes, options: object = None) None

Parses a sequence of bytes to fill this instance.

SerializeSize(self: onnx_extended.onnx2.cpu._onnx2py.ShardedDimProto, options: object = None) int

Returns the size once serialized without serializing.

SerializeToFile(self: onnx_extended.onnx2.cpu._onnx2py.ShardedDimProto, name: str, options: object = None) None

Serializes this instance into a file.

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.ShardedDimProto, options: object = None) bytes

Serializes this instance into a sequence of bytes.

property axis

This field MUST be present for this version of the IR. The axis this sharding corresponds to. Must be in the range of [-r, r - 1], where r is the rank of the tensor. Negative axis values means counting from the back.

has_axis(self: onnx_extended.onnx2.cpu._onnx2py.ShardedDimProto) bool

Tells if ‘axis’ has a value.

has_simple_sharding(self: onnx_extended.onnx2.cpu._onnx2py.ShardedDimProto) bool

Tells if ‘simple_sharding’ has a value.

property simple_sharding

Describes how the tensor on the provided axis is sharded. The common-case is described by a single instance of SimpleShardedDimProto. Multiple instances can be used to handle cases where a sharded tensor is reshaped, fusing multiple axes into one.

ShardingSpecProto

class onnx_extended.onnx2.ShardingSpecProto

Describes the sharding spec for a specific, input or output tensor of a node.

CopyFrom(self: onnx_extended.onnx2.cpu._onnx2py.ShardingSpecProto, arg0: onnx_extended.onnx2.cpu._onnx2py.ShardingSpecProto) None

Copies one instance into this one.

ParseFromFile(self: onnx_extended.onnx2.cpu._onnx2py.ShardingSpecProto, name: str, options: object = None) None

Parses a binary file to fill this instance.

ParseFromString(self: onnx_extended.onnx2.cpu._onnx2py.ShardingSpecProto, data: bytes, options: object = None) None

Parses a sequence of bytes to fill this instance.

SerializeSize(self: onnx_extended.onnx2.cpu._onnx2py.ShardingSpecProto, options: object = None) int

Returns the size once serialized without serializing.

SerializeToFile(self: onnx_extended.onnx2.cpu._onnx2py.ShardingSpecProto, name: str, options: object = None) None

Serializes this instance into a file.

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.ShardingSpecProto, options: object = None) bytes

Serializes this instance into a sequence of bytes.

property device

The following is the list of devices across which the logical tensor is sharded or replicated.

has_device(self: onnx_extended.onnx2.cpu._onnx2py.ShardingSpecProto) bool

Tells if ‘device’ has a value.

has_index_to_device_group_map(self: onnx_extended.onnx2.cpu._onnx2py.ShardingSpecProto) bool

Tells if ‘index_to_device_group_map’ has a value.

has_sharded_dim(self: onnx_extended.onnx2.cpu._onnx2py.ShardingSpecProto) bool

Tells if ‘sharded_dim’ has a value.

has_tensor_name(self: onnx_extended.onnx2.cpu._onnx2py.ShardingSpecProto) bool

Tells if ‘tensor_name’ has a value

property index_to_device_group_map

Each element v in above field devices may represent either a device or a set of devices (when we want the same shard/tensor to be replicated across a subset of devices), as indicated by the following optional map. If the map contains an entry for v, then v represents a device group, and the map indicates the set of devices in that group.

property sharded_dim

The following is the sharded-shape of the tensor, consisting of the sharding-spec for each axis of the tensor.

property tensor_name

This field MUST be present for this version of the IR. Identifies the input or output of the node that is being sharded. Required to match a name specified in the node’s input or output list of ValueInfoProtos. It is called logical tensor in subsequent descriptions.

SimpleShardedDimProto

class onnx_extended.onnx2.SimpleShardedDimProto

Indicates that N blocks are divided into M shards. N is allowed to be symbolic where M is required to be a constant.

CopyFrom(self: onnx_extended.onnx2.cpu._onnx2py.SimpleShardedDimProto, arg0: onnx_extended.onnx2.cpu._onnx2py.SimpleShardedDimProto) None

Copies one instance into this one.

ParseFromFile(self: onnx_extended.onnx2.cpu._onnx2py.SimpleShardedDimProto, name: str, options: object = None) None

Parses a binary file to fill this instance.

ParseFromString(self: onnx_extended.onnx2.cpu._onnx2py.SimpleShardedDimProto, data: bytes, options: object = None) None

Parses a sequence of bytes to fill this instance.

SerializeSize(self: onnx_extended.onnx2.cpu._onnx2py.SimpleShardedDimProto, options: object = None) int

Returns the size once serialized without serializing.

SerializeToFile(self: onnx_extended.onnx2.cpu._onnx2py.SimpleShardedDimProto, name: str, options: object = None) None

Serializes this instance into a file.

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.SimpleShardedDimProto, options: object = None) bytes

Serializes this instance into a sequence of bytes.

property dim_param

Dimension name to be sharded if it is a dynamic value.

property dim_value

Dimension value to be sharded if it is a fixed value.

has_dim_param(self: onnx_extended.onnx2.cpu._onnx2py.SimpleShardedDimProto) bool

Tells if ‘dim_param’ has a value

has_dim_value(self: onnx_extended.onnx2.cpu._onnx2py.SimpleShardedDimProto) bool

Tells if ‘dim_value’ has a value.

has_num_shards(self: onnx_extended.onnx2.cpu._onnx2py.SimpleShardedDimProto) bool

Tells if ‘num_shards’ has a value.

property num_shards

This field MUST be present for this version of the IR. Number of shards to split dim into.

SparseTensorProto

class onnx_extended.onnx2.SparseTensorProto

A sparse tensor.

CopyFrom(self: onnx_extended.onnx2.cpu._onnx2py.SparseTensorProto, arg0: onnx_extended.onnx2.cpu._onnx2py.SparseTensorProto) None

Copies one instance into this one.

ParseFromFile(self: onnx_extended.onnx2.cpu._onnx2py.SparseTensorProto, name: str, options: object = None) None

Parses a binary file to fill this instance.

ParseFromString(self: onnx_extended.onnx2.cpu._onnx2py.SparseTensorProto, data: bytes, options: object = None) None

Parses a sequence of bytes to fill this instance.

SerializeSize(self: onnx_extended.onnx2.cpu._onnx2py.SparseTensorProto, options: object = None) int

Returns the size once serialized without serializing.

SerializeToFile(self: onnx_extended.onnx2.cpu._onnx2py.SparseTensorProto, name: str, options: object = None) None

Serializes this instance into a file.

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.SparseTensorProto, options: object = None) bytes

Serializes this instance into a sequence of bytes.

property dims

The shape.

has_dims(self: onnx_extended.onnx2.cpu._onnx2py.SparseTensorProto) bool

Tells if ‘dims’ has a value.

has_indices(self: onnx_extended.onnx2.cpu._onnx2py.SparseTensorProto) bool

Tells if ‘indices’ has a value.

has_values(self: onnx_extended.onnx2.cpu._onnx2py.SparseTensorProto) bool

Tells if ‘values’ has a value.

property indices

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].

property values

The sequence of non-default values are encoded as a tensor of shape [NNZ]. The default-value is zero for numeric tensors, and empty-TypeProto::Tensortring for string tensors. values must have a non-empty name present which serves as a name for SparseTensorProto when used in sparse_initializer list.

StringStringEntryProto

class onnx_extended.onnx2.StringStringEntryProto

Defines a key value pair, both defines a strings.

CopyFrom(self: onnx_extended.onnx2.cpu._onnx2py.StringStringEntryProto, arg0: onnx_extended.onnx2.cpu._onnx2py.StringStringEntryProto) None

Copies one instance into this one.

ParseFromFile(self: onnx_extended.onnx2.cpu._onnx2py.StringStringEntryProto, name: str, options: object = None) None

Parses a binary file to fill this instance.

ParseFromString(self: onnx_extended.onnx2.cpu._onnx2py.StringStringEntryProto, data: bytes, options: object = None) None

Parses a sequence of bytes to fill this instance.

SerializeSize(self: onnx_extended.onnx2.cpu._onnx2py.StringStringEntryProto, options: object = None) int

Returns the size once serialized without serializing.

SerializeToFile(self: onnx_extended.onnx2.cpu._onnx2py.StringStringEntryProto, name: str, options: object = None) None

Serializes this instance into a file.

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.StringStringEntryProto, options: object = None) bytes

Serializes this instance into a sequence of bytes.

has_key(self: onnx_extended.onnx2.cpu._onnx2py.StringStringEntryProto) bool

Tells if ‘key’ has a value

has_value(self: onnx_extended.onnx2.cpu._onnx2py.StringStringEntryProto) bool

Tells if ‘value’ has a value

property key

the key

property value

the value

TensorAnnotation

class onnx_extended.onnx2.TensorAnnotation

Defines a tensor annotation, useful for quantized tensors.

CopyFrom(self: onnx_extended.onnx2.cpu._onnx2py.TensorAnnotation, arg0: onnx_extended.onnx2.cpu._onnx2py.TensorAnnotation) None

Copies one instance into this one.

ParseFromFile(self: onnx_extended.onnx2.cpu._onnx2py.TensorAnnotation, name: str, options: object = None) None

Parses a binary file to fill this instance.

ParseFromString(self: onnx_extended.onnx2.cpu._onnx2py.TensorAnnotation, data: bytes, options: object = None) None

Parses a sequence of bytes to fill this instance.

SerializeSize(self: onnx_extended.onnx2.cpu._onnx2py.TensorAnnotation, options: object = None) int

Returns the size once serialized without serializing.

SerializeToFile(self: onnx_extended.onnx2.cpu._onnx2py.TensorAnnotation, name: str, options: object = None) None

Serializes this instance into a file.

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.TensorAnnotation, options: object = None) bytes

Serializes this instance into a sequence of bytes.

has_quant_parameter_tensor_names(self: onnx_extended.onnx2.cpu._onnx2py.TensorAnnotation) bool

Tells if ‘quant_parameter_tensor_names’ has a value.

has_tensor_name(self: onnx_extended.onnx2.cpu._onnx2py.TensorAnnotation) bool

Tells if ‘tensor_name’ has a value

property quant_parameter_tensor_names

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

property tensor_name

tensor name

TensorProto

class onnx_extended.onnx2.TensorProto

Defines a tensor and its content.

CopyFrom(self: onnx_extended.onnx2.cpu._onnx2py.TensorProto, arg0: onnx_extended.onnx2.cpu._onnx2py.TensorProto) None

Copies one instance into this one.

class DataLocation

Members:

DEFAULT

EXTERNAL

property name
class DataType

Members:

UNDEFINED

FLOAT

UINT8

INT8

UINT16

INT16

INT32

INT64

STRING

BOOL

FLOAT16

DOUBLE

UINT32

UINT64

COMPLEX64

COMPLEX128

BFLOAT16

FLOAT8E4M3FN

FLOAT8E4M3FNUZ

FLOAT8E5M2

FLOAT8E5M2FNUZ

UINT4

INT4

FLOAT4E2M1

FLOAT8E8M0

property name
ParseFromFile(self: onnx_extended.onnx2.cpu._onnx2py.TensorProto, name: str, options: object = None) None

Parses a binary file to fill this instance.

ParseFromString(self: onnx_extended.onnx2.cpu._onnx2py.TensorProto, data: bytes, options: object = None) None

Parses a sequence of bytes to fill this instance.

SerializeSize(self: onnx_extended.onnx2.cpu._onnx2py.TensorProto, options: object = None) int

Returns the size once serialized without serializing.

SerializeToFile(self: onnx_extended.onnx2.cpu._onnx2py.TensorProto, name: str, options: object = None) None

Serializes this instance into a file.

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.TensorProto, options: object = None) bytes

Serializes this instance into a sequence of bytes.

property data_location

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. If value not set, data is stored in raw_data (if set) otherwise in type-specified field.

property data_type

The data type of the tensor. This field MUST have a valid TensorProto.DataType value

property dims

The shape of the tensor.

property doc_string

A human-readable documentation for this tensor. Markdown is allowed.

property double_data

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.

property external_data

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.

property float_data

Tensor content must be organized in row-major order. Depending on the data_type field, exactly one of the fields below with name ending in _data is used to store the elements 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 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.

has_dims(*args, **kwargs)

Overloaded function.

  1. has_dims(self: onnx_extended.onnx2.cpu._onnx2py.TensorProto) -> bool

Tells if ‘dims’ has a value.

  1. has_dims(self: onnx_extended.onnx2.cpu._onnx2py.TensorProto) -> bool

Tells if ‘dims’ has a value.

has_doc_string(self: onnx_extended.onnx2.cpu._onnx2py.TensorProto) bool

Tells if ‘doc_string’ has a value

has_double_data(self: onnx_extended.onnx2.cpu._onnx2py.TensorProto) bool

Tells if ‘double_data’ has a value.

has_external_data(self: onnx_extended.onnx2.cpu._onnx2py.TensorProto) bool

Tells if ‘external_data’ has a value.

has_float_data(self: onnx_extended.onnx2.cpu._onnx2py.TensorProto) bool

Tells if ‘float_data’ has a value.

has_int32_data(self: onnx_extended.onnx2.cpu._onnx2py.TensorProto) bool

Tells if ‘int32_data’ has a value.

has_int64_data(self: onnx_extended.onnx2.cpu._onnx2py.TensorProto) bool

Tells if ‘int64_data’ has a value.

has_metadata_props(self: onnx_extended.onnx2.cpu._onnx2py.TensorProto) bool

Tells if ‘metadata_props’ has a value.

has_name(self: onnx_extended.onnx2.cpu._onnx2py.TensorProto) bool

Tells if ‘name’ has a value

has_uint64_data(self: onnx_extended.onnx2.cpu._onnx2py.TensorProto) bool

Tells if ‘uint64_data’ has a value.

property int32_data

For int32, uint8, int8, uint16, int16, uint4, int4, bool, (b)float16, float8, and float4: - (b)float16 and float8 values MUST be converted bit-wise into an unsigned integer representation before being written to the buffer. - Each pair of uint4, int4, and float4 values MUST be packed as two 4-bit elements into a single byte. The first element is stored in the 4 least significant bits (LSB), and the second element is stored in the 4 most significant bits (MSB). Consequently: - For data types with a bit-width of 8 or greater, each int32_data stores one element. - For 4-bit data types, each int32_data stores two elements. 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, FLOAT8E8M0, FLOAT4E2M1

property int64_data

For int64. When this field is present, the data_type field MUST be INT64

property metadata_props

Named metadata values; keys should be distinct.

property name

Optionally, a name for the tensor.

property raw_data

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.

property string_data

For strings. Each element of string_data is a UTF-8 encoded Unicode string. No trailing null, no leading BOM. The ‘string’ scalar type is not used to match ML community conventions. When this field is present, the data_type field MUST be STRING

property uint64_data

For uint64 and uint32 values. When this field is present, the data_type field MUST be UINT32 or UINT64.

TensorShapeProto

class onnx_extended.onnx2.TensorShapeProto

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

CopyFrom(self: onnx_extended.onnx2.cpu._onnx2py.TensorShapeProto, arg0: onnx_extended.onnx2.cpu._onnx2py.TensorShapeProto) None

Copies one instance into this one.

class Dimension

Defines a dimension, it can be fixed (an integer dim_value) or dynamic (a string dim_param). Only one of them can be set.

CopyFrom(self: onnx_extended.onnx2.cpu._onnx2py.TensorShapeProto.Dimension, arg0: onnx_extended.onnx2.cpu._onnx2py.TensorShapeProto.Dimension) None

Copies one instance into this one.

ParseFromFile(self: onnx_extended.onnx2.cpu._onnx2py.TensorShapeProto.Dimension, name: str, options: object = None) None

Parses a binary file to fill this instance.

ParseFromString(self: onnx_extended.onnx2.cpu._onnx2py.TensorShapeProto.Dimension, data: bytes, options: object = None) None

Parses a sequence of bytes to fill this instance.

SerializeSize(self: onnx_extended.onnx2.cpu._onnx2py.TensorShapeProto.Dimension, options: object = None) int

Returns the size once serialized without serializing.

SerializeToFile(self: onnx_extended.onnx2.cpu._onnx2py.TensorShapeProto.Dimension, name: str, options: object = None) None

Serializes this instance into a file.

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.TensorShapeProto.Dimension, options: object = None) bytes

Serializes this instance into a sequence of bytes.

property denotation

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]

property dim_param

Dimension name if it is a dynamic value.

property dim_value

Dimension value if it is a fixed value.

has_denotation(self: onnx_extended.onnx2.cpu._onnx2py.TensorShapeProto.Dimension) bool

Tells if ‘denotation’ has a value

has_dim_param(self: onnx_extended.onnx2.cpu._onnx2py.TensorShapeProto.Dimension) bool

Tells if ‘dim_param’ has a value

has_dim_value(self: onnx_extended.onnx2.cpu._onnx2py.TensorShapeProto.Dimension) bool

Tells if ‘dim_value’ has a value.

ParseFromFile(self: onnx_extended.onnx2.cpu._onnx2py.TensorShapeProto, name: str, options: object = None) None

Parses a binary file to fill this instance.

ParseFromString(self: onnx_extended.onnx2.cpu._onnx2py.TensorShapeProto, data: bytes, options: object = None) None

Parses a sequence of bytes to fill this instance.

SerializeSize(self: onnx_extended.onnx2.cpu._onnx2py.TensorShapeProto, options: object = None) int

Returns the size once serialized without serializing.

SerializeToFile(self: onnx_extended.onnx2.cpu._onnx2py.TensorShapeProto, name: str, options: object = None) None

Serializes this instance into a file.

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.TensorShapeProto, options: object = None) bytes

Serializes this instance into a sequence of bytes.

property dim

Shape as a list of Dimension.

has_dim(self: onnx_extended.onnx2.cpu._onnx2py.TensorShapeProto) bool

Tells if ‘dim’ has a value.

TypeProto

class onnx_extended.onnx2.TypeProto

Defines a type, it can be a tensor type (element type and shape), a sequence of the same element type, …

CopyFrom(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto, arg0: onnx_extended.onnx2.cpu._onnx2py.TypeProto) None

Copies one instance into this one.

class Map

Defines the type of the key and the type of each value in a dictionary.

CopyFrom(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Map, arg0: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Map) None

Copies one instance into this one.

ParseFromFile(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Map, name: str, options: object = None) None

Parses a binary file to fill this instance.

ParseFromString(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Map, data: bytes, options: object = None) None

Parses a sequence of bytes to fill this instance.

SerializeSize(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Map, options: object = None) int

Returns the size once serialized without serializing.

SerializeToFile(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Map, name: str, options: object = None) None

Serializes this instance into a file.

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Map, options: object = None) bytes

Serializes this instance into a sequence of bytes.

add_value_type(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Map) onnx_extended.onnx2.cpu._onnx2py.TypeProto

Sets an empty value.

has_key_type(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Map) bool

Tells if ‘key_type’ has a value.

has_value_type(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Map) bool

Tells if ‘value_type’ has a value.

property key_type

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 optional int32 key_type = 1;

property value_type

This field MUST be present for this version of the IR.

class Optional

Defines the type of an optional value.

CopyFrom(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Optional, arg0: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Optional) None

Copies one instance into this one.

ParseFromFile(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Optional, name: str, options: object = None) None

Parses a binary file to fill this instance.

ParseFromString(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Optional, data: bytes, options: object = None) None

Parses a sequence of bytes to fill this instance.

SerializeSize(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Optional, options: object = None) int

Returns the size once serialized without serializing.

SerializeToFile(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Optional, name: str, options: object = None) None

Serializes this instance into a file.

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Optional, options: object = None) bytes

Serializes this instance into a sequence of bytes.

add_elem_type(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Optional) onnx_extended.onnx2.cpu._onnx2py.TypeProto

Sets an empty value.

property elem_type

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

has_elem_type(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Optional) bool

Tells if ‘elem_type’ has a value.

ParseFromFile(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto, name: str, options: object = None) None

Parses a binary file to fill this instance.

ParseFromString(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto, data: bytes, options: object = None) None

Parses a sequence of bytes to fill this instance.

class Sequence

Defines the type of each element in a sequence.

CopyFrom(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Sequence, arg0: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Sequence) None

Copies one instance into this one.

ParseFromFile(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Sequence, name: str, options: object = None) None

Parses a binary file to fill this instance.

ParseFromString(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Sequence, data: bytes, options: object = None) None

Parses a sequence of bytes to fill this instance.

SerializeSize(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Sequence, options: object = None) int

Returns the size once serialized without serializing.

SerializeToFile(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Sequence, name: str, options: object = None) None

Serializes this instance into a file.

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Sequence, options: object = None) bytes

Serializes this instance into a sequence of bytes.

add_elem_type(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Sequence) onnx_extended.onnx2.cpu._onnx2py.TypeProto

Sets an empty value.

property elem_type

The type and optional shape of each element of the sequence. This field MUST be present for this version of the IR.

has_elem_type(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Sequence) bool

Tells if ‘elem_type’ has a value.

SerializeSize(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto, options: object = None) int

Returns the size once serialized without serializing.

SerializeToFile(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto, name: str, options: object = None) None

Serializes this instance into a file.

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto, options: object = None) bytes

Serializes this instance into a sequence of bytes.

class SparseTensor

Defines a sparse tensor type (element type, shape)

CopyFrom(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.SparseTensor, arg0: onnx_extended.onnx2.cpu._onnx2py.TypeProto.SparseTensor) None

Copies one instance into this one.

ParseFromFile(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.SparseTensor, name: str, options: object = None) None

Parses a binary file to fill this instance.

ParseFromString(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.SparseTensor, data: bytes, options: object = None) None

Parses a sequence of bytes to fill this instance.

SerializeSize(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.SparseTensor, options: object = None) int

Returns the size once serialized without serializing.

SerializeToFile(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.SparseTensor, name: str, options: object = None) None

Serializes this instance into a file.

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.SparseTensor, options: object = None) bytes

Serializes this instance into a sequence of bytes.

add_shape(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.SparseTensor) onnx_extended.onnx2.cpu._onnx2py.TensorShapeProto

Sets an empty value.

property elem_type

This field MUST NOT have the value of UNDEFINThis 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.ED. This field MUST have a valid TensorProto.DataType value. This field MUST be present for this version of the IR.

has_elem_type(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.SparseTensor) bool

Tells if ‘elem_type’ has a value.

has_shape(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.SparseTensor) bool

Tells if ‘shape’ has a value.

property shape

The shape.

class Tensor

Defines a tensor type (element type, shape).

CopyFrom(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Tensor, arg0: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Tensor) None

Copies one instance into this one.

ParseFromFile(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Tensor, name: str, options: object = None) None

Parses a binary file to fill this instance.

ParseFromString(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Tensor, data: bytes, options: object = None) None

Parses a sequence of bytes to fill this instance.

SerializeSize(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Tensor, options: object = None) int

Returns the size once serialized without serializing.

SerializeToFile(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Tensor, name: str, options: object = None) None

Serializes this instance into a file.

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Tensor, options: object = None) bytes

Serializes this instance into a sequence of bytes.

add_shape(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Tensor) onnx_extended.onnx2.cpu._onnx2py.TensorShapeProto

Sets an empty value.

property elem_type

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.

has_elem_type(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Tensor) bool

Tells if ‘elem_type’ has a value.

has_shape(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Tensor) bool

Tells if ‘shape’ has a value.

property shape

The shape.

add_map_type(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto) onnx_extended.onnx2.cpu._onnx2py.TypeProto.Map

Sets an empty value.

add_optional_type(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto) onnx_extended.onnx2.cpu._onnx2py.TypeProto.Optional

Sets an empty value.

add_sequence_type(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto) onnx_extended.onnx2.cpu._onnx2py.TypeProto.Sequence

Sets an empty value.

add_sparse_tensor_type(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto) onnx_extended.onnx2.cpu._onnx2py.TypeProto.SparseTensor

Sets an empty value.

add_tensor_type(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto) onnx_extended.onnx2.cpu._onnx2py.TypeProto.Tensor

Sets an empty value.

property denotation

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.

has_denotation(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto) bool

Tells if ‘denotation’ has a value

has_map_type(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto) bool

Tells if ‘map_type’ has a value.

has_optional_type(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto) bool

Tells if ‘optional_type’ has a value.

has_sequence_type(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto) bool

Tells if ‘sequence_type’ has a value.

has_sparse_tensor_type(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto) bool

Tells if ‘sparse_tensor_type’ has a value.

has_tensor_type(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto) bool

Tells if ‘tensor_type’ has a value.

property map_type

The type of a map.

property optional_type

The type of an optional.

property sequence_type

The type of a sequence.

property sparse_tensor_type

Type of the sparse tensor

property tensor_type

The type of a tensor.

ValueInfoProto

class onnx_extended.onnx2.ValueInfoProto

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

CopyFrom(self: onnx_extended.onnx2.cpu._onnx2py.ValueInfoProto, arg0: onnx_extended.onnx2.cpu._onnx2py.ValueInfoProto) None

Copies one instance into this one.

ParseFromFile(self: onnx_extended.onnx2.cpu._onnx2py.ValueInfoProto, name: str, options: object = None) None

Parses a binary file to fill this instance.

ParseFromString(self: onnx_extended.onnx2.cpu._onnx2py.ValueInfoProto, data: bytes, options: object = None) None

Parses a sequence of bytes to fill this instance.

SerializeSize(self: onnx_extended.onnx2.cpu._onnx2py.ValueInfoProto, options: object = None) int

Returns the size once serialized without serializing.

SerializeToFile(self: onnx_extended.onnx2.cpu._onnx2py.ValueInfoProto, name: str, options: object = None) None

Serializes this instance into a file.

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.ValueInfoProto, options: object = None) bytes

Serializes this instance into a sequence of bytes.

add_type(self: onnx_extended.onnx2.cpu._onnx2py.ValueInfoProto) onnx_extended.onnx2.cpu._onnx2py.TypeProto

Sets an empty value.

property doc_string

A human-readable documentation for this tensor. Markdown is allowed.

has_doc_string(self: onnx_extended.onnx2.cpu._onnx2py.ValueInfoProto) bool

Tells if ‘doc_string’ has a value

has_metadata_props(self: onnx_extended.onnx2.cpu._onnx2py.ValueInfoProto) bool

Tells if ‘metadata_props’ has a value.

has_name(self: onnx_extended.onnx2.cpu._onnx2py.ValueInfoProto) bool

Tells if ‘name’ has a value

has_type(self: onnx_extended.onnx2.cpu._onnx2py.ValueInfoProto) bool

Tells if ‘type’ has a value.

property metadata_props

Named metadata values; keys should be distinct.

property name

This field MUST be present in this version of the IR.

property type

This field MUST be present in this version of the IR for inputs and outputs of the top-level graph.