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.
- 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_props
if you would like the metadata to be 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_dtype
package 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.