GraphProto#
- class onnx_light.onnx.GraphProto(*args, **kwargs)#
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, arg: onnx_light.onnx_py._onnxpy.GraphProto, /) 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.
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._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_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.
- SerializeToString(self, options: object | None = None) bytes#
Serializes this instance into a sequence of bytes.
- property doc_string#
A human-readable documentation for this graph. Markdown is allowed.
- 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#
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.
- Type:
This field carries information to indicate the mapping among a tensor and its quantization parameter tensors. For example
- 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.