Enum DataType

    • Method Detail

      • values

        public static DataType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (DataType c : DataType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static DataType valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
        NullPointerException - if the argument is null
      • fromInt

        public static DataType fromInt​(int type)
        Values inherited from https://github.com/eclipse/deeplearning4j/blob/master/libnd4j/include/array/DataType.h
        Parameters:
        type - the input int type
        Returns:
        the appropriate data type
      • toInt

        public int toInt()
      • isFPType

        public boolean isFPType()
        Returns:
        Returns true if the datatype is a floating point type (double, float or half precision)
      • isIntType

        public boolean isIntType()
        Returns:
        Returns true if the datatype is an integer type (long, integer, short, ubyte or byte)
      • isNumerical

        public boolean isNumerical()
        Return true if the value is numerical.
        Equivalent to this != UTF8 && this != COMPRESSED && this != UNKNOWN
        Note: Boolean values are considered numerical (0/1)
      • isSigned

        public boolean isSigned()
        Returns:
        True if the datatype is a numerical type and is signed (supports negative values)
      • precision

        public int precision()
        Returns:
        the max number of significant decimal digits
      • width

        public int width()
        Returns:
        For fixed-width types, this returns the number of bytes per array element
      • fromNumpy

        public static DataType fromNumpy​(String numpyDtypeName)