onnx_light.onnx.onnx_pb#

Compatibility shim for onnx.onnx_pb.

Re-exports all protobuf message types from the top-level onnx_light.onnx package so that from onnx_light.onnx.onnx_pb import ModelProto works.

class onnx_light.onnx.onnx_pb.AffineLayoutProto(*args, **kwargs)#

Describes the built-in affine (linear) quantization layout of an EncodedValueProto. The branch is deliberately closed: other affine forms use a structured layout instead of extending this message.

ByteSize(self) → int#

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

Clear(self) → None#

Clears the object.

ClearField(self, field_name: str) → None#

Clears the field field_name, following the protobuf API.

CopyFrom(self, arg: onnx_light.onnx_py._onnxpyprotoop.AffineLayoutProto, /) → None#

Copies one instance into this one.

HasField(self, field_name: str) → bool#

Checks if a field is set, following the protobuf HasField API.

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

SerializeToFileDescriptor(self, fd: int, options: object | None = None) → None#

Serializes this instance into an open file descriptor without closing it.

SerializeToOStream(self, output: object) → None#

Alias for SerializeToOstream (capital S) for protobuf API compatibility. Serializes this instance to a Python file-like object that has a write() method.

SerializeToOstream(self, output: object) → None#

Serializes this instance to a Python file-like object that has a write() method.

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

Serializes this instance into a sequence of bytes.

add_scale(self) → onnx_light.onnx_py._onnxpyprotoop.TensorProto#

Sets an empty value.

add_zero_point(self) → onnx_light.onnx_py._onnxpyprotoop.TensorProto#

Sets an empty value.

property axis#

Omitting axis selects per-tensor quantization; setting it selects per-axis parameters.

property block_size#

Blocked quantization along axis. It is valid only together with axis.

has_axis(self) → bool#

Tells if ‘axis’ has a value.

has_block_size(self) → bool#

Tells if ‘block_size’ has a value.

has_scale(self) → bool#

Tells if ‘scale’ has a value.

has_signed_storage(self) → bool#

Tells if ‘signed_storage’ has a value.

has_storage_type(self) → bool#
has_zero_point(self) → bool#

Tells if ‘zero_point’ has a value.

property scale#

Scalar or parameter tensor with a floating element type. This field MUST be present for a valid affine layout.

property signed_storage#

0 is unsigned and 1 is signed. The code width is inferred from the logical shape and payload size and must identify exactly one supported width.

Type:

Signedness of stored integer codes when storage_type is absent

property storage_type#

Element type of the stored codes. It MUST be one of INT8, UINT8, INT4, UINT4, INT2 or UINT2 and the payload holds only row-major codes packed like TensorProto.raw_data. Exactly one of storage_type and signed_storage MUST be present. When storage_type is absent, signed_storage determines signedness and the code width is inferred from the logical element count and payload byte length; the payload MUST identify exactly one of the supported 2-bit, 4-bit or 8-bit widths. N is the product of the concrete dimensions in EncodedValueProto.logical_type.tensor_type.shape. B is either EncodedValueProto.raw_data.size() for an inline payload or the numeric ‘length’ entry in EncodedValueProto.external_data when data_location is EXTERNAL. Two-bit storage matches when B == ceil(N / 4) == N / 4 + (N % 4 != 0), 4-bit storage matches when B == ceil(N / 2) == N / 2 + N % 2, and 8-bit storage matches when B == N. Exactly one equality MUST hold; signed_storage then selects the signed INT2, INT4 or INT8 type when equal to 1, and the corresponding unsigned type otherwise.

property zero_point#

Optional zero point with element type storage_type. It defaults to zero.

class onnx_light.onnx.onnx_pb.EncodedValueProto(*args, **kwargs)#

One value container with an optional logical tensor type and shape, a layout choice and an owned or external payload with a known byte extent. Payload byte length and the resolved element size determine the record count; no physical shape or redundant count is serialized.

ByteSize(self) → int#

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

Clear(self) → None#

Clears the object.

ClearField(self, field_name: str) → None#

Clears the field field_name, following the protobuf API.

CopyFrom(self, arg: onnx_light.onnx_py._onnxpyprotoop.EncodedValueProto, /) → None#

Copies one instance into this one.

HasField(self, field_name: str) → bool#

Checks if a field is set, following the protobuf HasField API.

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

SerializeToFileDescriptor(self, fd: int, options: object | None = None) → None#

Serializes this instance into an open file descriptor without closing it.

SerializeToOStream(self, output: object) → None#

Alias for SerializeToOstream (capital S) for protobuf API compatibility. Serializes this instance to a Python file-like object that has a write() method.

SerializeToOstream(self, output: object) → None#

Serializes this instance to a Python file-like object that has a write() method.

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

Serializes this instance into a sequence of bytes.

WhichOneof(self, oneof_name: str) → object#
add_affine(self) → onnx_light.onnx_py._onnxpyprotoop.AffineLayoutProto#

Sets an empty value.

add_logical_type(self) → onnx_light.onnx_py._onnxpyprotoop.TypeProto#

Sets an empty value.

add_struct_type(self) → onnx_light.onnx_py._onnxpyprotoop.StructTypeProto#

Sets an empty value.

property affine#

Built-in affine layout.

property data_location#

DEFAULT reads raw_data, EXTERNAL reads the external payload.

property doc_string#

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

property external_data#

External payload description. data_location == EXTERNAL requires a ‘location’ entry and an explicit ‘length’; ‘offset’ is optional.

has_affine(self) → bool#

Tells if ‘affine’ has a value.

has_data_location(self) → bool#
has_doc_string(self) → bool#

Tells if ‘doc_string’ has a value

has_external_data(self) → bool#

Tells if ‘external_data’ has a value.

has_layout(self) → bool#
has_logical_type(self) → bool#

Tells if ‘logical_type’ has a value.

has_name(self) → bool#

Tells if ‘name’ has a value

has_parameter_ref(self) → bool#

Tells if ‘parameter_ref’ has a value

has_raw_data(self) → bool#
has_struct_type(self) → bool#

Tells if ‘struct_type’ has a value.

property logical_type#

Decoded type and shape when the value denotes a tensor. It is required, with concrete dimensions, for the affine branch.

property name#

Name of the value; graph-scoped and unique across all initializers.

property parameter_ref#

Model-level shared numerical quantization parameter set.

property raw_data#

Inline payload holding a flat sequence of encoded records. It is mutually exclusive with external_data, and an empty inline payload represents zero records.

property struct_type#

an exact type_ref or a concrete inline declaration eligible for byte encoding.

Type:

Structured layout

class onnx_light.onnx.onnx_pb.PagedCacheBlockProto(*args, **kwargs)#

One immutable KV page with a contiguous logical token range.

ByteSize(self) → int#

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

Clear(self) → None#

Clears the object.

ClearField(self, field_name: str) → None#

Clears the field field_name, following the protobuf API.

CopyFrom(self, arg: onnx_light.onnx_py._onnxpyprotoop.PagedCacheBlockProto, /) → None#

Copies one instance into this one.

HasField(self, field_name: str) → bool#

Checks if a field is set, following the protobuf HasField API.

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

SerializeToFileDescriptor(self, fd: int, options: object | None = None) → None#

Serializes this instance into an open file descriptor without closing it.

SerializeToOStream(self, output: object) → None#

Alias for SerializeToOstream (capital S) for protobuf API compatibility. Serializes this instance to a Python file-like object that has a write() method.

SerializeToOstream(self, output: object) → None#

Serializes this instance to a Python file-like object that has a write() method.

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

Serializes this instance into a sequence of bytes.

WhichOneof(self, arg: str, /) → object#
add_encoded_key(self) → onnx_light.onnx_py._onnxpyprotoop.EncodedValueProto#

Sets an empty value.

add_encoded_value(self) → onnx_light.onnx_py._onnxpyprotoop.EncodedValueProto#

Sets an empty value.

add_key(self) → onnx_light.onnx_py._onnxpyprotoop.TensorProto#

Sets an empty value.

add_value(self) → onnx_light.onnx_py._onnxpyprotoop.TensorProto#

Sets an empty value.

property encoded_key#

Inline encoded key tensor.

property encoded_value#

Inline encoded value tensor.

has_encoded_key(self) → bool#

Tells if ‘encoded_key’ has a value.

has_encoded_value(self) → bool#

Tells if ‘encoded_value’ has a value.

has_key(self) → bool#

Tells if ‘key’ has a value.

has_length(self) → bool#

Tells if ‘length’ has a value.

has_start(self) → bool#

Tells if ‘start’ has a value.

has_value(self) → bool#

Tells if ‘value’ has a value.

property key#

Inline dense key tensor.

property length#

Number of valid tokens, positive and no greater than capacity.

property start#

Logical offset of the first token.

property value#

Inline dense value tensor.

class onnx_light.onnx.onnx_pb.PagedCacheProto(*args, **kwargs)#

A serializable KV cache. Pages have contiguous token ranges and independently dense or encoded FLOAT [batch,heads,capacity,width] key/value payloads. Model-local type and quantization parameter references are resolved against the containing model.

ByteSize(self) → int#

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

Clear(self) → None#

Clears the object.

ClearField(self, field_name: str) → None#

Clears the field field_name, following the protobuf API.

CopyFrom(self, arg: onnx_light.onnx_py._onnxpyprotoop.PagedCacheProto, /) → None#

Copies one instance into this one.

HasField(self, field_name: str) → bool#

Checks if a field is set, following the protobuf HasField API.

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

SerializeToFileDescriptor(self, fd: int, options: object | None = None) → None#

Serializes this instance into an open file descriptor without closing it.

SerializeToOStream(self, output: object) → None#

Alias for SerializeToOstream (capital S) for protobuf API compatibility. Serializes this instance to a Python file-like object that has a write() method.

SerializeToOstream(self, output: object) → None#

Serializes this instance to a Python file-like object that has a write() method.

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

Serializes this instance into a sequence of bytes.

property blocks#

Ordered immutable KV pages.

property doc_string#

Human-readable documentation.

has_blocks(self) → bool#

Tells if ‘blocks’ has a value.

has_doc_string(self) → bool#

Tells if ‘doc_string’ has a value

has_name(self) → bool#

Tells if ‘name’ has a value

property name#

Graph-scoped initializer name, unique across initializer categories.

class onnx_light.onnx.onnx_pb.PersistentBindingProto(*args, **kwargs)#

Declares a whole-output to whole-input persistent binding.

ByteSize(self) → int#

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

Clear(self) → None#

Clears the object.

ClearField(self, field_name: str) → None#

Clears the field field_name, following the protobuf API.

CopyFrom(self, arg: onnx_light.onnx_py._onnxpyprotoop.PersistentBindingProto, /) → 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._onnxpyprotoop.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.

SerializeToFileDescriptor(self, fd: int, options: object | None = None) → None#

Serializes this instance into an open file descriptor without closing it.

SerializeToOStream(self, output: object) → None#

Alias for SerializeToOstream (capital S) for protobuf API compatibility. Serializes this instance to a Python file-like object that has a write() method.

SerializeToOstream(self, output: object) → None#

Serializes this instance to a Python file-like object that has a write() method.

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

Serializes this instance into a sequence of bytes.

has_input_name(self) → bool#

Tells if ‘input_name’ has a value

has_output_name(self) → bool#

Tells if ‘output_name’ has a value

property input_name#

Names the whole destination graph input, literally.

property output_name#

Names the whole source graph output, literally.

class onnx_light.onnx.onnx_pb.StructTypeProto(*args, **kwargs)#

Describes a struct’s fields and types: a concrete declaration selects array, bit_packing or structure, and each field selects either a value type or a tensor constant. A fixed physical size is an eligibility condition for byte encoding, not a requirement on every struct.

class Array(*args, **kwargs)#

A tight repetition of a single element type.

ByteSize(self) → int#

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

Clear(self) → None#

Clears the object.

ClearField(self, field_name: str) → None#

Clears the field field_name, following the protobuf API.

CopyFrom(self, arg: onnx_light.onnx_py._onnxpyprotoop.StructTypeProto.Array, /) → None#

Copies one instance into this one.

HasField(self, field_name: str) → bool#

Checks if a field is set, following the protobuf HasField API.

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

SerializeToFileDescriptor(self, fd: int, options: object | None = None) → None#

Serializes this instance into an open file descriptor without closing it.

SerializeToOStream(self, output: object) → None#

Alias for SerializeToOstream (capital S) for protobuf API compatibility. Serializes this instance to a Python file-like object that has a write() method.

SerializeToOstream(self, output: object) → None#

Serializes this instance to a Python file-like object that has a write() method.

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

Serializes this instance into a sequence of bytes.

add_element_type(self) → onnx_light.onnx_py._onnxpyprotoop.TypeProto#

Sets an empty value.

property dimension#

Number of elements, an explicit concrete count.

property element_type#

Type of one element.

has_dimension(self) → bool#

Tells if ‘dimension’ has a value.

has_element_type(self) → bool#

Tells if ‘element_type’ has a value.

class BitPacking(*args, **kwargs)#

A tight repetition of a group of named bit fields.

ByteSize(self) → int#

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

Clear(self) → None#

Clears the object.

ClearField(self, field_name: str) → None#

Clears the field field_name, following the protobuf API.

class Component(*args, **kwargs)#

One named bit field inside a bit-packing group.

ByteSize(self) → int#

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

Clear(self) → None#

Clears the object.

ClearField(self, field_name: str) → None#

Clears the field field_name, following the protobuf API.

CopyFrom(self, arg: onnx_light.onnx_py._onnxpyprotoop.StructTypeProto.BitPacking.Component, /) → None#

Copies one instance into this one.

HasField(self, field_name: str) → bool#

Checks if a field is set, following the protobuf HasField API.

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

SerializeToFileDescriptor(self, fd: int, options: object | None = None) → None#

Serializes this instance into an open file descriptor without closing it.

SerializeToOStream(self, output: object) → None#

Alias for SerializeToOstream (capital S) for protobuf API compatibility. Serializes this instance to a Python file-like object that has a write() method.

SerializeToOstream(self, output: object) → None#

Serializes this instance to a Python file-like object that has a write() method.

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

Serializes this instance into a sequence of bytes.

property bit_width#

Width of the component in bits, strictly positive.

has_bit_width(self) → bool#

Tells if ‘bit_width’ has a value.

has_name(self) → bool#

Tells if ‘name’ has a value

property name#

Component name, unique within the enclosing bit packing.

CopyFrom(self, arg: onnx_light.onnx_py._onnxpyprotoop.StructTypeProto.BitPacking, /) → None#

Copies one instance into this one.

HasField(self, field_name: str) → bool#

Checks if a field is set, following the protobuf HasField API.

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

SerializeToFileDescriptor(self, fd: int, options: object | None = None) → None#

Serializes this instance into an open file descriptor without closing it.

SerializeToOStream(self, output: object) → None#

Alias for SerializeToOstream (capital S) for protobuf API compatibility. Serializes this instance to a Python file-like object that has a write() method.

SerializeToOstream(self, output: object) → None#

Serializes this instance to a Python file-like object that has a write() method.

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

Serializes this instance into a sequence of bytes.

property component#

Components of one group, laid out from the least significant bit.

property dimension#

Number of repeated groups, an explicit concrete count.

has_component(self) → bool#

Tells if ‘component’ has a value.

has_dimension(self) → bool#

Tells if ‘dimension’ has a value.

ByteSize(self) → int#

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

Clear(self) → None#

Clears the object.

ClearField(self, field_name: str) → None#

Clears the field field_name, following the protobuf API.

CopyFrom(self, arg: onnx_light.onnx_py._onnxpyprotoop.StructTypeProto, /) → None#

Copies one instance into this one.

HasField(self, field_name: str) → bool#

Checks if a field is set, following the protobuf HasField API.

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

SerializeToFileDescriptor(self, fd: int, options: object | None = None) → None#

Serializes this instance into an open file descriptor without closing it.

SerializeToOStream(self, output: object) → None#

Alias for SerializeToOstream (capital S) for protobuf API compatibility. Serializes this instance to a Python file-like object that has a write() method.

SerializeToOstream(self, output: object) → None#

Serializes this instance to a Python file-like object that has a write() method.

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

Serializes this instance into a sequence of bytes.

class Structure(*args, **kwargs)#

An ordered list of named fields.

ByteSize(self) → int#

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

Clear(self) → None#

Clears the object.

ClearField(self, field_name: str) → None#

Clears the field field_name, following the protobuf API.

CopyFrom(self, arg: onnx_light.onnx_py._onnxpyprotoop.StructTypeProto.Structure, /) → None#

Copies one instance into this one.

class Field(*args, **kwargs)#

One named field holding either a value type or a shared format constant.

ByteSize(self) → int#

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

Clear(self) → None#

Clears the object.

ClearField(self, field_name: str) → None#

Clears the field field_name, following the protobuf API.

CopyFrom(self, arg: onnx_light.onnx_py._onnxpyprotoop.StructTypeProto.Structure.Field, /) → None#

Copies one instance into this one.

HasField(self, field_name: str) → bool#

Checks if a field is set, following the protobuf HasField API.

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

SerializeToFileDescriptor(self, fd: int, options: object | None = None) → None#

Serializes this instance into an open file descriptor without closing it.

SerializeToOStream(self, output: object) → None#

Alias for SerializeToOstream (capital S) for protobuf API compatibility. Serializes this instance to a Python file-like object that has a write() method.

SerializeToOstream(self, output: object) → None#

Serializes this instance to a Python file-like object that has a write() method.

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

Serializes this instance into a sequence of bytes.

WhichOneof(self, oneof_name: str) → object#
add_constant(self) → onnx_light.onnx_py._onnxpyprotoop.TensorProto#

Sets an empty value.

add_type(self) → onnx_light.onnx_py._onnxpyprotoop.TypeProto#

Sets an empty value.

property constant#

The actual shared format constant, not a graph input. It must have concrete dimensions and matching data, and contributes zero payload bytes.

property doc_string#

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

has_constant(self) → bool#

Tells if ‘constant’ has a value.

has_content(self) → bool#
has_doc_string(self) → bool#

Tells if ‘doc_string’ has a value

has_name(self) → bool#

Tells if ‘name’ has a value

has_type(self) → bool#

Tells if ‘type’ has a value.

property name#

Field name, unique within the enclosing structure.

property type#

Type of the field value. It follows the existing TypeProto validation rules for tensors, nested structs, sequences, maps and optional values.

HasField(self, field_name: str) → bool#

Checks if a field is set, following the protobuf HasField API.

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

SerializeToFileDescriptor(self, fd: int, options: object | None = None) → None#

Serializes this instance into an open file descriptor without closing it.

SerializeToOStream(self, output: object) → None#

Alias for SerializeToOstream (capital S) for protobuf API compatibility. Serializes this instance to a Python file-like object that has a write() method.

SerializeToOstream(self, output: object) → None#

Serializes this instance to a Python file-like object that has a write() method.

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

Serializes this instance into a sequence of bytes.

property field#

Fields in declaration order.

has_field(self) → bool#

Tells if ‘field’ has a value.

WhichOneof(self, oneof_name: str) → object#
add_array(self) → onnx_light.onnx_py._onnxpyprotoop.StructTypeProto.Array#

Sets an empty value.

add_bit_packing(self) → onnx_light.onnx_py._onnxpyprotoop.StructTypeProto.BitPacking#

Sets an empty value.

add_decoder(self) → onnx_light.onnx_py._onnxpyprotoop.FunctionProto#

Sets an empty value.

add_encoder(self) → onnx_light.onnx_py._onnxpyprotoop.FunctionProto#

Sets an empty value.

add_structure(self) → onnx_light.onnx_py._onnxpyprotoop.StructTypeProto.Structure#

Sets an empty value.

property array#

Array declaration.

property bit_packing#

Bit-packing declaration.

property decoder#

Optional decoder. Only the concrete root’s codec is invoked; a nested type_ref contributes layout and constants but not its own decoder or encoder.

property doc_string#

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

property encoder#

Optional encoder, mirroring decoder.

has_array(self) → bool#

Tells if ‘array’ has a value.

has_bit_packing(self) → bool#

Tells if ‘bit_packing’ has a value.

has_decoder(self) → bool#

Tells if ‘decoder’ has a value.

has_doc_string(self) → bool#

Tells if ‘doc_string’ has a value

has_encoder(self) → bool#

Tells if ‘encoder’ has a value.

has_kind(self) → bool#
has_metadata_props(self) → bool#

Tells if ‘metadata_props’ has a value.

has_name(self) → bool#

Tells if ‘name’ has a value

has_structure(self) → bool#

Tells if ‘structure’ has a value.

has_type_id(self) → bool#

Tells if ‘type_id’ has a value.

has_type_ref(self) → bool#

Tells if ‘type_ref’ has a value.

property metadata_props#

Named metadata values; keys should be distinct.

property name#

A human-readable name for this declaration.

property structure#

Structure declaration.

property type_id#

Nonzero, model-scoped stable format identity. Each ID has exactly one declaration in ModelProto.struct_types; an inline declaration has no type_id and cannot be referenced.

property type_ref#

declaration fields, metadata, codecs and another kind must be absent.

Type:

Reference to a declaration in ModelProto.struct_types. A type_ref carries only the referenced ID