TensorShapeProto#

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

Defines a tensor shape. A dimension can be either an integer value or a symbolic variable. A symbolic variable represents an unknown dimension.

ByteSize(self) int#

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

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

Copies one instance into this one.

class Dimension(*args, **kwargs)#

Defines a dimension, it can be fixed (an integer dim_value) or dynamic (a string dim_param). Only one of them can be set.

ByteSize(self) int#

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

CopyFrom(self, arg: onnx_light.onnx_py._onnxpy.TensorShapeProto.Dimension, /) 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.

property denotation#

//github.com/onnx/onnx/blob/main/docs/DimensionDenotation.md#axisdenotation-definition for pre-defined dimension denotations.

Type:

Standard denotation can optionally be used to denote tensor dimensions with standard semantic descriptions to ensure that operations are applied to the correct axis of a tensor. Refer to https

property dim_param#

Dimension name if it is a dynamic value.

property dim_value#

Dimension value if it is a fixed value.

has_denotation(self) bool#

Tells if ‘denotation’ has a value

has_dim_param(self) bool#

Tells if ‘dim_param’ has a value

has_dim_value(self) bool#

Tells if ‘dim_value’ 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.

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.

property dim#

Shape as a list of Dimension.

has_dim(self) bool#

Tells if ‘dim’ has a value.