Package ai.djl.ndarray.types
Enum SparseFormat
- java.lang.Object
-
- java.lang.Enum<SparseFormat>
-
- ai.djl.ndarray.types.SparseFormat
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<SparseFormat>
public enum SparseFormat extends java.lang.Enum<SparseFormat>
An enum representing Sparse matrix storage formats.- DENSE: Stride format
- ROW_SPARSE: Row Sparse
- CSR: Compressed Sparse Row
- See Also:
- Sparse Matrix Storage Formats
-
-
Enum Constant Summary
Enum Constants Enum Constant Description COOCSRDENSEROW_SPARSE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SparseFormatfromValue(int value)Gets theSparseFormatfrom it's integer value.java.lang.StringgetType()Returns theSparseFormatname.intgetValue()Returns the integer value of thisSparseFormat.static SparseFormatvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static SparseFormat[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
DENSE
public static final SparseFormat DENSE
-
ROW_SPARSE
public static final SparseFormat ROW_SPARSE
-
CSR
public static final SparseFormat CSR
-
COO
public static final SparseFormat COO
-
-
Method Detail
-
values
public static SparseFormat[] 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 (SparseFormat c : SparseFormat.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static SparseFormat 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
-
fromValue
public static SparseFormat fromValue(int value)
Gets theSparseFormatfrom it's integer value.- Parameters:
value- the integer value of theSparseFormat- Returns:
- a
SparseFormat
-
getType
public java.lang.String getType()
Returns theSparseFormatname.- Returns:
- the
SparseFormatname
-
getValue
public int getValue()
Returns the integer value of thisSparseFormat.- Returns:
- the integer value of this
SparseFormat
-
-