StringTensor¶
- class onnx_ir.StringTensor(value, *, shape=None, name=None, doc_string=None, metadata_props=None)¶
Multidimensional array of strings (as binary data to match the string_data field in TensorProto).
- 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.
- tobytes()[source]¶
Return the tensor as a byte string conformed to the ONNX specification, in little endian.
- Return type:
- tofile(file)¶
Write the tensor to a binary file.
This method writes the raw bytes of the tensor to a file-like object. The file-like object must have a
writemethod that accepts bytes.Added in version 0.1.11.
- Parameters:
file – A file-like object with a
writemethod that accepts bytes.- Return type:
None