DataTypeΒΆ
- class onnx_ir.DataType(value)ΒΆ
Enum for the data types of ONNX tensors, defined in
onnx.TensorProto
.- property bitwidth: intΒΆ
Returns the bit width of the data type.
Added in version 0.1.2.
- Raises:
TypeError β If the data type is not supported.
- short_name()[source]ΒΆ
Returns the short name of the data type.
The short name is a string that is used to represent the data type in a more compact form. For example, the short name for DataType.FLOAT is βf32β. To get the corresponding data type back, call
from_short_name
on a string.Naming reference: https://github.com/pytorch/pytorch/blob/4bead7b85ea4160243c74109e0ce9bb80686d016/torch/utils/_dtype_abbrs.py
- is_integer()[source]ΒΆ
Returns True if the data type is an integer.
Added in version 0.1.4.
- Return type:
- is_signed()[source]ΒΆ
Returns True if the data type is a signed type.
Added in version 0.1.4.
- Return type:
- UNDEFINED = 0ΒΆ
- FLOAT = 1ΒΆ
- UINT8 = 2ΒΆ
- INT8 = 3ΒΆ
- UINT16 = 4ΒΆ
- INT16 = 5ΒΆ
- INT32 = 6ΒΆ
- INT64 = 7ΒΆ
- STRING = 8ΒΆ
- BOOL = 9ΒΆ
- FLOAT16 = 10ΒΆ
- DOUBLE = 11ΒΆ
- UINT32 = 12ΒΆ
- UINT64 = 13ΒΆ
- COMPLEX64 = 14ΒΆ
- COMPLEX128 = 15ΒΆ
- BFLOAT16 = 16ΒΆ
- FLOAT8E4M3FN = 17ΒΆ
- FLOAT8E4M3FNUZ = 18ΒΆ
- FLOAT8E5M2 = 19ΒΆ
- FLOAT8E5M2FNUZ = 20ΒΆ
- UINT4 = 21ΒΆ
- INT4 = 22ΒΆ
- FLOAT4E2M1 = 23ΒΆ