pub enum Dtype {
Show 13 variants
F32,
F64,
F16,
BF16,
U8,
U16,
U32,
U64,
I8,
I16,
I32,
I64,
Bool,
}Expand description
Runtime dtype tag for AnyTensor and any caller that needs to
dispatch over the framework’s known tensor dtypes.
Variants§
F32
32-bit IEEE 754 float — corresponds to TYPE_TENSOR_F32.
F64
64-bit IEEE 754 float — corresponds to TYPE_TENSOR_F64.
F16
16-bit IEEE 754 half — corresponds to TYPE_TENSOR_F16. Stored as half::f16.
BF16
16-bit bfloat (Google’s brain-float) — corresponds to TYPE_TENSOR_BF16. Stored as half::bf16.
U8
8-bit unsigned — corresponds to TYPE_TENSOR_U8.
U16
16-bit unsigned — corresponds to TYPE_TENSOR_U16.
U32
32-bit unsigned — corresponds to TYPE_TENSOR_U32.
U64
64-bit unsigned — corresponds to TYPE_TENSOR_U64.
I8
8-bit signed — corresponds to TYPE_TENSOR_I8 (edge quantization).
I16
16-bit signed — corresponds to TYPE_TENSOR_I16.
I32
32-bit signed — corresponds to TYPE_TENSOR_I32.
I64
64-bit signed — corresponds to TYPE_TENSOR_I64 (indices, embeddings).
Bool
1-bit boolean — corresponds to TYPE_TENSOR_BOOL (masks, predicates).