- All Implemented Interfaces:
Serializable,Comparable<DType>,Constable
DType relies on preview features of the Java platform:
DTyperefers to one or more preview APIs:ValueLayout.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
The
DType enum represents the various data types can be found in models.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionRepresents a boolean data type using 1 byte for true/false values.Represents a double-precision 64-bit IEEE floating-point data type using 8 bytes.Represents a single-precision 32-bit IEEE floating-point data type using 4 bytes.Represents a half-precision floating-point data type using 2 bytes.Represents a 16-bit signed integer data type using 2 bytes.Represents a 32-bit signed integer data type using 4 bytes.Represents a 64-bit signed integer data type using 8 bytes.Represents an 8-bit signed integer data type using 1 byte.Represents a quantized 8-bit signed integer used in specialized applications like machine learning, using 1 byte.Represents a quantized 8-bit unsigned integer used in specialized applications like machine learning, using 1 byte.Represents an 8-bit unsigned integer data type using 1 byte. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the size of the data type in bytes.Returns theValueLayoutPREVIEW of the data type, which describes how the data is laid out in memory.static DTypeReturns the enum constant of this class with the specified name.static DType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
HALF_FLOAT
Represents a half-precision floating-point data type using 2 bytes. -
FLOAT
Represents a single-precision 32-bit IEEE floating-point data type using 4 bytes. -
DOUBLE
Represents a double-precision 64-bit IEEE floating-point data type using 8 bytes. -
INT8
Represents an 8-bit signed integer data type using 1 byte. -
INT16
Represents a 16-bit signed integer data type using 2 bytes. -
INT32
Represents a 32-bit signed integer data type using 4 bytes. -
INT64
Represents a 64-bit signed integer data type using 8 bytes. -
UINT8
Represents an 8-bit unsigned integer data type using 1 byte. -
BOOL
Represents a boolean data type using 1 byte for true/false values. -
QINT8
Represents a quantized 8-bit signed integer used in specialized applications like machine learning, using 1 byte. -
QUINT8
Represents a quantized 8-bit unsigned integer used in specialized applications like machine learning, using 1 byte.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getByteSize
public int getByteSize()Returns the size of the data type in bytes.- Returns:
- The size of the data type.
-
getLayout
Returns theValueLayoutPREVIEW of the data type, which describes how the data is laid out in memory.- Returns:
- The memory layout of the data type.
-
DTypewhen preview features are enabled.