onnx2

This implements parsing and serialization of onnx classes without protobuf.

class onnx_extended.onnx2.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
class onnx_extended.onnx2.DeviceConfigurationProto

Describes a multi-device configuration for a model.

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

Parses a sequence of bytes to fill this instance

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.DeviceConfigurationProto) bytes

Serialize into a sequence of bytes.

property device
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
property num_devices
class onnx_extended.onnx2.IntIntListEntryProto

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

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

Parses a sequence of bytes to fill this instance

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.IntIntListEntryProto) bytes

Serialize 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
property value
class onnx_extended.onnx2.Message

Message, base class for all onnx2 classes

class onnx_extended.onnx2.NodeDeviceConfigurationProto

Defines a multi-device configuration proto for NodeProto.

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

Parses a sequence of bytes to fill this instance

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.NodeDeviceConfigurationProto) bytes

Serialize into a sequence of bytes.

property configuration_id
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
property sharding_spec
class onnx_extended.onnx2.OperatorSetIdProto

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

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

Parses a sequence of bytes to fill this instance

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.OperatorSetIdProto) bytes

Serialize into a sequence of bytes.

property domain
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
class onnx_extended.onnx2.OperatorStatus

Members:

EXPERIMENTAL

STABLE

property name
class onnx_extended.onnx2.ShardedDimProto

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

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

Parses a sequence of bytes to fill this instance

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.ShardedDimProto) bytes

Serialize into a sequence of bytes.

property axis
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
class onnx_extended.onnx2.ShardingSpecProto

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

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

Parses a sequence of bytes to fill this instance

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.ShardingSpecProto) bytes

Serialize into a sequence of bytes.

property device
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
property sharded_dim
property tensor_name
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.

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

Parses a sequence of bytes to fill this instance

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.SimpleShardedDimProto) bytes

Serialize into a sequence of bytes.

property dim_param
property dim_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
class onnx_extended.onnx2.SparseTensorProto

A sparse tensor.

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

Parses a sequence of bytes to fill this instance

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.SparseTensorProto) bytes

Serialize into a sequence of bytes.

property dims
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
property values
class onnx_extended.onnx2.StringStringEntryProto

Defines a key value pair, both defines a strings.

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

Parses a sequence of bytes to fill this instance

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.StringStringEntryProto) bytes

Serialize 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
property value
class onnx_extended.onnx2.TensorAnnotation

Defines a tensor annotation, useful for quantized tensors.

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

Parses a sequence of bytes to fill this instance

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.TensorAnnotation) bytes

Serialize 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
property tensor_name
class onnx_extended.onnx2.TensorProto

Defines a tensor and its content.

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

Parses a sequence of bytes to fill this instance

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.TensorProto) bytes

Serialize into a sequence of bytes.

property data_type
property dims
property doc_string
property double_data
property external_data
property float_data
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
property int64_data
property metadata_props
property name
property raw_data
property string_data
property uint64_data
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.

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.

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

Parses a sequence of bytes to fill this instance

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.TensorShapeProto.Dimension) bytes

Serialize into a sequence of bytes.

property denotation
property dim_param
property dim_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

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

Parses a sequence of bytes to fill this instance

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.TensorShapeProto) bytes

Serialize into a sequence of bytes.

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

Tells if ‘dim has a value

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, …

class Map

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

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

Parses a sequence of bytes to fill this instance

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Map) bytes

Serialize 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
property value_type
class Optional

Defines the type of an optional value.

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

Parses a sequence of bytes to fill this instance

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Optional) bytes

Serialize 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
has_elem_type(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Optional) bool

Tells if ‘elem_type’ has a value

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

Parses a sequence of bytes to fill this instance

class Sequence

Defines the type of each element in a sequence.

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

Parses a sequence of bytes to fill this instance

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Sequence) bytes

Serialize 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
has_elem_type(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Sequence) bool

Tells if ‘elem_type’ has a value

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto) bytes

Serialize into a sequence of bytes.

class SparseTensor

Defines a sparse tensor type (element type, shape)

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

Parses a sequence of bytes to fill this instance

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.SparseTensor) bytes

Serialize 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
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
class Tensor

Defines a tensor type (element type, shape)

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

Parses a sequence of bytes to fill this instance

SerializeToString(self: onnx_extended.onnx2.cpu._onnx2py.TypeProto.Tensor) bytes

Serialize 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
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
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
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
property optional_type
property sequence_type
property sparse_tensor_type
property tensor_type