TypeProto#

class onnx_light.onnx.TypeProto(*args, **kwargs)#

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

ByteSize(self) int#

Returns the serialized size in bytes, following the protobuf API.

CopyFrom(self, arg: onnx_light.onnx_py._onnxpy.TypeProto, /) None#

Copies one instance into this one.

class Map(*args, **kwargs)#

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

ByteSize(self) int#

Returns the serialized size in bytes, following the protobuf API.

CopyFrom(self, arg: onnx_light.onnx_py._onnxpy.TypeProto.Map, /) None#

Copies one instance into this one.

ParseFromFile(self, name: str, options: object | None = None, external_data_file: str = '') None#

Parses a binary file to fill this instance.

ParseFromString(self, data: bytes, options: object | None = None) None#
ParseFromString(self, data: str, options: object | None = None) None

Overloaded function.

  1. ParseFromString(self, data: bytes, options: object | None = None) -> None

Parses a sequence of bytes to fill this instance.

  1. ParseFromString(self, data: str, options: object | None = None) -> None

Parses a string to fill this instance.

SerializeSize(self, options: object | None = None) onnx_light.onnx_py._onnxpy.SerializeSizeResult#

Returns the size once serialized without serializing.

SerializeToFile(self, name: str, options: object | None = None, external_data_file: str = '') None#

Serializes this instance into a file. If external_data_size is not empty, big weights are stored in this (depending on options.raw_data_threshold). When writing to two files, temporary external-data metadata is cleared so the in-memory model stays unchanged.

SerializeToString(self, options: object | None = None) bytes#

Serializes this instance into a sequence of bytes.

add_value_type(self) onnx_light.onnx_py._onnxpy.TypeProto#

Sets an empty value.

has_key_type(self) bool#

Tells if ‘key_type’ has a value.

has_value_type(self) 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(*args, **kwargs)#

Defines the type of an optional value.

ByteSize(self) int#

Returns the serialized size in bytes, following the protobuf API.

CopyFrom(self, arg: onnx_light.onnx_py._onnxpy.TypeProto.Optional, /) None#

Copies one instance into this one.

ParseFromFile(self, name: str, options: object | None = None, external_data_file: str = '') None#

Parses a binary file to fill this instance.

ParseFromString(self, data: bytes, options: object | None = None) None#
ParseFromString(self, data: str, options: object | None = None) None

Overloaded function.

  1. ParseFromString(self, data: bytes, options: object | None = None) -> None

Parses a sequence of bytes to fill this instance.

  1. ParseFromString(self, data: str, options: object | None = None) -> None

Parses a string to fill this instance.

SerializeSize(self, options: object | None = None) onnx_light.onnx_py._onnxpy.SerializeSizeResult#

Returns the size once serialized without serializing.

SerializeToFile(self, name: str, options: object | None = None, external_data_file: str = '') None#

Serializes this instance into a file. If external_data_size is not empty, big weights are stored in this (depending on options.raw_data_threshold). When writing to two files, temporary external-data metadata is cleared so the in-memory model stays unchanged.

SerializeToString(self, options: object | None = None) bytes#

Serializes this instance into a sequence of bytes.

add_elem_type(self) onnx_light.onnx_py._onnxpy.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) bool#

Tells if ‘elem_type’ has a value.

ParseFromFile(self, name: str, options: object | None = None, external_data_file: str = '') None#

Parses a binary file to fill this instance.

ParseFromString(self, data: bytes, options: object | None = None) None#
ParseFromString(self, data: str, options: object | None = None) None

Overloaded function.

  1. ParseFromString(self, data: bytes, options: object | None = None) -> None

Parses a sequence of bytes to fill this instance.

  1. ParseFromString(self, data: str, options: object | None = None) -> None

Parses a string to fill this instance.

class Sequence(*args, **kwargs)#

Defines the type of each element in a sequence.

ByteSize(self) int#

Returns the serialized size in bytes, following the protobuf API.

CopyFrom(self, arg: onnx_light.onnx_py._onnxpy.TypeProto.Sequence, /) None#

Copies one instance into this one.

ParseFromFile(self, name: str, options: object | None = None, external_data_file: str = '') None#

Parses a binary file to fill this instance.

ParseFromString(self, data: bytes, options: object | None = None) None#
ParseFromString(self, data: str, options: object | None = None) None

Overloaded function.

  1. ParseFromString(self, data: bytes, options: object | None = None) -> None

Parses a sequence of bytes to fill this instance.

  1. ParseFromString(self, data: str, options: object | None = None) -> None

Parses a string to fill this instance.

SerializeSize(self, options: object | None = None) onnx_light.onnx_py._onnxpy.SerializeSizeResult#

Returns the size once serialized without serializing.

SerializeToFile(self, name: str, options: object | None = None, external_data_file: str = '') None#

Serializes this instance into a file. If external_data_size is not empty, big weights are stored in this (depending on options.raw_data_threshold). When writing to two files, temporary external-data metadata is cleared so the in-memory model stays unchanged.

SerializeToString(self, options: object | None = None) bytes#

Serializes this instance into a sequence of bytes.

add_elem_type(self) onnx_light.onnx_py._onnxpy.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) bool#

Tells if ‘elem_type’ has a value.

SerializeSize(self, options: object | None = None) onnx_light.onnx_py._onnxpy.SerializeSizeResult#

Returns the size once serialized without serializing.

SerializeToFile(self, name: str, options: object | None = None, external_data_file: str = '') None#

Serializes this instance into a file. If external_data_size is not empty, big weights are stored in this (depending on options.raw_data_threshold). When writing to two files, temporary external-data metadata is cleared so the in-memory model stays unchanged.

SerializeToString(self, options: object | None = None) bytes#

Serializes this instance into a sequence of bytes.

class SparseTensor(*args, **kwargs)#

Defines a sparse tensor type (element type, shape)

ByteSize(self) int#
ByteSize(self) int

Returns the serialized size in bytes, following the protobuf API.

CopyFrom(self, arg: onnx_light.onnx_py._onnxpy.TypeProto.SparseTensor, /) None#
CopyFrom(self, arg: onnx_light.onnx_py._onnxpy.TypeProto.SparseTensor, /) None

Copies one instance into this one.

ParseFromFile(self, name: str, options: object | None = None, external_data_file: str = '') None#
ParseFromFile(self, name: str, options: object | None = None, external_data_file: str = '') None

Parses a binary file to fill this instance.

ParseFromString(self, data: bytes, options: object | None = None) None#
ParseFromString(self, data: str, options: object | None = None) None
ParseFromString(self, data: bytes, options: object | None = None) None
ParseFromString(self, data: str, options: object | None = None) None

Overloaded function.

  1. ParseFromString(self, data: bytes, options: object | None = None) -> None

Parses a sequence of bytes to fill this instance.

  1. ParseFromString(self, data: str, options: object | None = None) -> None

Parses a string to fill this instance.

  1. ParseFromString(self, data: bytes, options: object | None = None) -> None

Parses a sequence of bytes to fill this instance.

  1. ParseFromString(self, data: str, options: object | None = None) -> None

Parses a string to fill this instance.

SerializeSize(self, options: object | None = None) onnx_light.onnx_py._onnxpy.SerializeSizeResult#
SerializeSize(self, options: object | None = None) onnx_light.onnx_py._onnxpy.SerializeSizeResult

Returns the size once serialized without serializing.

SerializeToFile(self, name: str, options: object | None = None, external_data_file: str = '') None#
SerializeToFile(self, name: str, options: object | None = None, external_data_file: str = '') None

Serializes this instance into a file. If external_data_size is not empty, big weights are stored in this (depending on options.raw_data_threshold). When writing to two files, temporary external-data metadata is cleared so the in-memory model stays unchanged.

SerializeToString(self, options: object | None = None) bytes#
SerializeToString(self, options: object | None = None) bytes

Serializes this instance into a sequence of bytes.

add_shape(self) onnx_light.onnx_py._onnxpy.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_shape(self) bool#

Tells if ‘shape’ has a value.

property shape#

The shape.

class Tensor(*args, **kwargs)#

Defines a tensor type (element type, shape).

ByteSize(self) int#

Returns the serialized size in bytes, following the protobuf API.

CopyFrom(self, arg: onnx_light.onnx_py._onnxpy.TypeProto.Tensor, /) None#

Copies one instance into this one.

ParseFromFile(self, name: str, options: object | None = None, external_data_file: str = '') None#

Parses a binary file to fill this instance.

ParseFromString(self, data: bytes, options: object | None = None) None#
ParseFromString(self, data: str, options: object | None = None) None

Overloaded function.

  1. ParseFromString(self, data: bytes, options: object | None = None) -> None

Parses a sequence of bytes to fill this instance.

  1. ParseFromString(self, data: str, options: object | None = None) -> None

Parses a string to fill this instance.

SerializeSize(self, options: object | None = None) onnx_light.onnx_py._onnxpy.SerializeSizeResult#

Returns the size once serialized without serializing.

SerializeToFile(self, name: str, options: object | None = None, external_data_file: str = '') None#

Serializes this instance into a file. If external_data_size is not empty, big weights are stored in this (depending on options.raw_data_threshold). When writing to two files, temporary external-data metadata is cleared so the in-memory model stays unchanged.

SerializeToString(self, options: object | None = None) bytes#

Serializes this instance into a sequence of bytes.

add_shape(self) onnx_light.onnx_py._onnxpy.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_shape(self) bool#

Tells if ‘shape’ has a value.

property shape#

The shape.

add_map_type(self) onnx_light.onnx_py._onnxpy.TypeProto.Map#

Sets an empty value.

add_optional_type(self) onnx_light.onnx_py._onnxpy.TypeProto.Optional#

Sets an empty value.

add_sequence_type(self) onnx_light.onnx_py._onnxpy.TypeProto.Sequence#

Sets an empty value.

add_sparse_tensor_type(self) onnx_light.onnx_py._onnxpy.TypeProto.SparseTensor#

Sets an empty value.

add_tensor_type(self) onnx_light.onnx_py._onnxpy.TypeProto.Tensor#

Sets an empty value.

property denotation#

//github.com/onnx/onnx/blob/main/docs/TypeDenotation.md#type-denotation-definition for pre-defined type denotations.

Type:

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

has_denotation(self) bool#

Tells if ‘denotation’ has a value

has_map_type(self) bool#

Tells if ‘map_type’ has a value.

has_optional_type(self) bool#

Tells if ‘optional_type’ has a value.

has_sequence_type(self) bool#

Tells if ‘sequence_type’ has a value.

has_sparse_tensor_type(self) bool#

Tells if ‘sparse_tensor_type’ has a value.

has_tensor_type(self) 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.