Package ai.djl.ndarray.types
Enum LayoutType
- java.lang.Object
-
- java.lang.Enum<LayoutType>
-
- ai.djl.ndarray.types.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 anNDArray
.The options are:
BATCH
- Different elements in a batch, usually from aStackBatchifier
.CHANNEL
- Each channel represents a different aspect of the data such as RGB showing different color channels.DEPTH
- The depth of a 3-D inputHEIGHT
- 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.
-
-
-
Enum Constant Detail
-
BATCH
public static final LayoutType BATCH
-
CHANNEL
public static final LayoutType CHANNEL
-
DEPTH
public static final LayoutType DEPTH
-
HEIGHT
public static final LayoutType HEIGHT
-
WIDTH
public static final LayoutType WIDTH
-
TIME
public static final LayoutType TIME
-
UNKNOWN
public static final LayoutType UNKNOWN
-
-
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 namejava.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
-
-