Package ai.djl.ndarray.types
Enum Class LayoutType
- All Implemented Interfaces:
Serializable,Comparable<LayoutType>,Constable
An enum to represent the meaning of a particular axis in an
NDArray.
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic LayoutTypefromValue(char value) Converts the character to the matching layout type.static LayoutType[]Converts each character to the matching layout type.chargetValue()Returns the character representation of the layout type.static StringtoString(LayoutType[] layouts) Converts a layout type array to a string of the character representations.static LayoutTypeReturns the enum constant of this class with the specified name.static LayoutType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
BATCH
-
CHANNEL
-
DEPTH
-
HEIGHT
-
WIDTH
-
TIME
-
UNKNOWN
-
-
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
-
getValue
public char getValue()Returns the character representation of the layout type.- Returns:
- the character representation of the layout type
-
fromValue
Converts the character to the matching layout type.- Parameters:
value- the character to convert- Returns:
- the matching layout type
- Throws:
IllegalArgumentException- thrown if the character does not match any layout type
-
fromValue
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:
IllegalArgumentException- thrown if the character does not match any layout type
-
toString
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
-