Mojo struct
DType
@register_passable(trivial)
struct DType
Represents DType and provides methods for working with it.
Aliases
type = dtype
:invalid
: Represents an invalid or unknown data type.bool
: Represents a boolean data type.int8
: Represents a signed integer type whose bitwidth is 8.uint8
: Represents an unsigned integer type whose bitwidth is 8.int16
: Represents a signed integer type whose bitwidth is 16.uint16
: Represents an unsigned integer type whose bitwidth is 16.int32
: Represents a signed integer type whose bitwidth is 32.uint32
: Represents an unsigned integer type whose bitwidth is 32.int64
: Represents a signed integer type whose bitwidth is 64.uint64
: Represents an unsigned integer type whose bitwidth is 64.float8e5m2
: Represents a FP8E5M2 floating point format from the OFP8 standard.float8e5m2fnuz
: Represents a FP8E5M2FNUZ floating point format.float8e4m3
: Represents a FP8E4M3 floating point format from the OFP8 standard.float8e4m3fnuz
: Represents a FP8E4M3FNUZ floating point format.bfloat16
: Represents a brain floating point value whose bitwidth is 16.float16
: Represents an IEEE754-2008binary16
floating point value.float32
: Represents an IEEE754-2008binary32
floating point value.tensor_float32
: Represents a special floating point format supported by NVIDIA Tensor Cores, with the same range as float32 and reduced precision (>=10 bits). Note that this type is only available on NVIDIA GPUs.float64
: Represents an IEEE754-2008binary64
floating point value.index
: Represents an integral type whose bitwidth is the maximum integral value on the system.
Fields
- value (
dtype
): The underlying storage for the DType value.