PackedTensor¶
- class onnx_ir.PackedTensor(value, dtype, *, shape, name=None, doc_string=None, metadata_props=None)¶
A tensor that stores 4bit datatypes in packed format.
Added in version 0.1.2.
- Parameters:
- display(*, page=False)¶
Pretty print the object.
- Parameters:
page (bool) – Whether to page the output.
- Return type:
None
- property meta: MetadataStore¶
The metadata store for intermediate analysis.
Write to the
metadata_propsif you would like the metadata to be serialized to the ONNX proto.
- property metadata_props: dict[str, str]¶
The metadata properties of the tensor.
The metadata properties are used to store additional information about the tensor. Unlike
meta, this property is serialized to the ONNX proto.
- numpy()[source]¶
Return the tensor as a numpy array.
When the data type is not supported by numpy, the dtypes from the
ml_dtypepackage are used. The values can be reinterpreted as bit representations using the.view()method.- Return type:
- property raw: TArrayCompatible¶
Backing data of the tensor. Immutable.