Package ai.djl.ndarray.types
Class DataDesc
- java.lang.Object
-
- ai.djl.ndarray.types.DataDesc
-
public class DataDesc extends java.lang.Object
A data descriptor class that encapsulates information of aNDArray
.The information includes:
- Optional name of the NDArray
Device
Shape
DataType
SparseFormat
-
-
Constructor Summary
Constructors Constructor Description DataDesc(Shape shape)
Constructs and initializes aDataDesc
with specifiedShape
.DataDesc(Shape shape, DataType dataType)
DataDesc(Shape shape, DataType dataType, java.lang.String name)
Constructs and initializes aDataDesc
with specifiedShape
,DataType
, name,Device
andSparseFormat
.DataDesc(Shape shape, java.lang.String name)
Constructs and initializes aDataDesc
with specifiedShape
and name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DataType
getDataType()
java.lang.String
getName()
Returns the name of theNDArray
.Shape
getShape()
void
setDataType(DataType dataType)
void
setName(java.lang.String name)
Sets the name of theNDArray
.void
setShape(Shape shape)
java.lang.String
toString()
-
-
-
Constructor Detail
-
DataDesc
public DataDesc(Shape shape, java.lang.String name)
Constructs and initializes aDataDesc
with specifiedShape
and name.
-
-
Method Detail
-
getName
public java.lang.String getName()
Returns the name of theNDArray
.- Returns:
- the name of the
NDArray
-
setName
public void setName(java.lang.String name)
Sets the name of theNDArray
.- Parameters:
name
- the name of theNDArray
-
setDataType
public void setDataType(DataType dataType)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-