FunctionProto#
- class onnx_light.onnx.FunctionProto(*args, **kwargs)#
A function defines a sub-operator that can be used in a graph. It is similar to a function in C/C++ or Python, and can be used to define reusable sub-graphs.
- CopyFrom(self, arg: onnx_light.onnx_py._onnxpy.FunctionProto, /) 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 attribute#
attribute names of the function
- property attribute_proto#
typed attributes
- property doc_string#
A human-readable documentation for this graph. Markdown is allowed.
- property domain#
The domain which this function belongs to. This is part of the unique-id (domain, name, overload) of FunctionProtos in a model.
- property input#
input names of the function
- property metadata_props#
Named metadata values; keys should be distinct.
- property name#
The name of the function. This field MUST be present in this version of the IR.
- property node#
The nodes in the graph, sorted topologically.
- property opset_import#
The OperatorSets this function body (graph) relies on. All nodes in the function body (graph) will bind against the operator with the same-domain/same-op_type operator with the HIGHEST version in the referenced operator sets. This means at most one version can be relied for one domain. The operator sets imported by FunctionProto should be compatible with the ones imported by ModelProto. Example, if same operator set say ‘A’ is imported by FunctionProto and ModelProto then versions for the operator set may be different but, the operator schema returned for op_type, domain, version combination for both the versions should be same.
- property output#
output names of the function
- property overload#
The overload identifier of the function. This is part of the unique-id (domain, name, overload) of FunctionProtos in a model.
- 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.