Package org.nd4j.linalg.api.buffer.util
Class DataTypeUtil
- java.lang.Object
-
- org.nd4j.linalg.api.buffer.util.DataTypeUtil
-
public class DataTypeUtil extends Object
-
-
Constructor Summary
Constructors Constructor Description DataTypeUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetDTypeForName(DataType allocationMode)Gets the name of the allocation modestatic DataTypegetDtypeFromContext()get the allocation mode from the contextstatic DataTypegetDtypeFromContext(String dType)Get the allocation mode from the contextstatic intlengthForDtype(DataType type)Returns the length for the given data opTypestatic voidsetDTypeForContext(String allocationModeForContext)Set the allocation mode for the nd4j context The value must be one of: heap, java cpp, or direct or an @link{IllegalArgumentException} is thrownstatic voidsetDTypeForContext(DataType allocationModeForContext)Set the allocation mode for the nd4j context The value must be one of: heap, java cpp, or direct or an @link{IllegalArgumentException} is thrown
-
-
-
Method Detail
-
lengthForDtype
public static int lengthForDtype(DataType type)
Returns the length for the given data opType- Parameters:
type-- Returns:
-
getDtypeFromContext
public static DataType getDtypeFromContext(String dType)
Get the allocation mode from the context- Returns:
-
getDTypeForName
public static String getDTypeForName(DataType allocationMode)
Gets the name of the allocation mode- Parameters:
allocationMode-- Returns:
-
getDtypeFromContext
public static DataType getDtypeFromContext()
get the allocation mode from the context- Returns:
-
setDTypeForContext
public static void setDTypeForContext(DataType allocationModeForContext)
Set the allocation mode for the nd4j context The value must be one of: heap, java cpp, or direct or an @link{IllegalArgumentException} is thrown- Parameters:
allocationModeForContext-
-
setDTypeForContext
public static void setDTypeForContext(String allocationModeForContext)
Set the allocation mode for the nd4j context The value must be one of: heap, java cpp, or direct or an @link{IllegalArgumentException} is thrown- Parameters:
allocationModeForContext-
-
-