StructTypeProto#
Declares structures, arrays and bit-packed records, or references a declaration
in ModelProto.struct_types by type_ref. See
Quantizes tensors into encoded values for layout and catalogue semantics.
- class onnx_light.onnx.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.
- 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.
ParseFromString(self, data: bytes, options: object | None = None) -> None
Parses a sequence of bytes to fill this instance.
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_sizeis not empty, big weights are stored in this (depending onoptions.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.
- class BitPacking(*args, **kwargs)#
A tight repetition of a group of named bit fields.
- class Component(*args, **kwargs)#
One named bit field inside a bit-packing group.
- 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.
ParseFromString(self, data: bytes, options: object | None = None) -> None
Parses a sequence of bytes to fill this instance.
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_sizeis not empty, big weights are stored in this (depending onoptions.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.
- 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.
ParseFromString(self, data: bytes, options: object | None = None) -> None
Parses a sequence of bytes to fill this instance.
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_sizeis not empty, big weights are stored in this (depending onoptions.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.
- 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.
ParseFromString(self, data: bytes, options: object | None = None) -> None
Parses a sequence of bytes to fill this instance.
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_sizeis not empty, big weights are stored in this (depending onoptions.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.
- 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.
- 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.
ParseFromString(self, data: bytes, options: object | None = None) -> None
Parses a sequence of bytes to fill this instance.
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_sizeis not empty, big weights are stored in this (depending onoptions.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_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.
- 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.
ParseFromString(self, data: bytes, options: object | None = None) -> None
Parses a sequence of bytes to fill this instance.
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_sizeis not empty, big weights are stored in this (depending onoptions.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.
- 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.
- 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