Enum LayoutType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<LayoutType>

    public enum LayoutType
    extends java.lang.Enum<LayoutType>
    An enum to represent the meaning of a particular axis in an NDArray.

    The options are:

    • BATCH - Different elements in a batch, usually from a StackBatchifier.
    • CHANNEL - Each channel represents a different aspect of the data such as RGB showing different color channels.
    • DEPTH - The depth of a 3-D input
    • HEIGHT - The width of a multi-dimensional input, usually an image.
    • WIDTH - The height of a multi-dimensional input, usually an image.
    • TIME - The time within a sequence such as text or video.
    • UNKNOWN - A unknown or otherwise unrepresentable layout type.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static LayoutType fromValue​(char value)
      Converts the character to the matching layout type.
      static LayoutType[] fromValue​(java.lang.String layout)
      Converts each character to the matching layout type.
      char getValue()
      Returns the character representation of the layout type.
      static java.lang.String toString​(LayoutType[] layouts)
      Converts a layout type array to a string of the character representations.
      static LayoutType valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static LayoutType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • values

        public static LayoutType[] 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 (LayoutType c : LayoutType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static LayoutType valueOf​(java.lang.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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getValue

        public char getValue()
        Returns the character representation of the layout type.
        Returns:
        the character representation of the layout type
      • fromValue

        public static LayoutType fromValue​(char value)
        Converts the character to the matching layout type.
        Parameters:
        value - the character to convert
        Returns:
        the matching layout type
        Throws:
        java.lang.IllegalArgumentException - thrown if the character does not match any layout type
      • fromValue

        public static LayoutType[] fromValue​(java.lang.String layout)
        Converts each character to the matching layout type.
        Parameters:
        layout - the character string to convert
        Returns:
        the list of layout types for each character in the string
        Throws:
        java.lang.IllegalArgumentException - thrown if the character does not match any layout type
      • toString

        public static java.lang.String toString​(LayoutType[] layouts)
        Converts a layout type array to a string of the character representations.
        Parameters:
        layouts - the layout type to convert
        Returns:
        the string of the character representations