Module tornado.api

Enum Class DType

java.lang.Object
java.lang.Enum<DType>
uk.ac.manchester.tornado.api.types.tensors.DType
All Implemented Interfaces:
Serializable, Comparable<DType>, Constable

public enum DType extends Enum<DType>
DType relies on preview features of the Java platform:
  • DType refers to one or more preview APIs: ValueLayout.
Programs can only use DType when preview features are enabled.
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 Constants
    Enum Constant
    Description
    Represents 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 Type
    Method
    Description
    int
    Returns the size of the data type in bytes.
    Returns the ValueLayoutPREVIEW of the data type, which describes how the data is laid out in memory.
    static DType
    Returns the enum constant of this class with the specified name.
    static DType[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • HALF_FLOAT

      public static final DType HALF_FLOAT
      Represents a half-precision floating-point data type using 2 bytes.
    • FLOAT

      public static final DType FLOAT
      Represents a single-precision 32-bit IEEE floating-point data type using 4 bytes.
    • DOUBLE

      public static final DType DOUBLE
      Represents a double-precision 64-bit IEEE floating-point data type using 8 bytes.
    • INT8

      public static final DType INT8
      Represents an 8-bit signed integer data type using 1 byte.
    • INT16

      public static final DType INT16
      Represents a 16-bit signed integer data type using 2 bytes.
    • INT32

      public static final DType INT32
      Represents a 32-bit signed integer data type using 4 bytes.
    • INT64

      public static final DType INT64
      Represents a 64-bit signed integer data type using 8 bytes.
    • UINT8

      public static final DType UINT8
      Represents an 8-bit unsigned integer data type using 1 byte.
    • BOOL

      public static final DType BOOL
      Represents a boolean data type using 1 byte for true/false values.
    • QINT8

      public static final DType QINT8
      Represents a quantized 8-bit signed integer used in specialized applications like machine learning, using 1 byte.
    • QUINT8

      public static final DType QUINT8
      Represents a quantized 8-bit unsigned integer used in specialized applications like machine learning, using 1 byte.
  • Method Details

    • values

      public static DType[] 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

      public static DType valueOf(String name)
      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 name
      NullPointerException - 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

      public ValueLayoutPREVIEW getLayout()
      Returns the ValueLayoutPREVIEW of the data type, which describes how the data is laid out in memory.
      Returns:
      The memory layout of the data type.