Package org.nd4j.linalg.string
Class NDArrayStrings
- java.lang.Object
-
- org.nd4j.linalg.string.NDArrayStrings
-
public class NDArrayStrings extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static longDEFAULT_MAX_PRINT_ELEMENTSThe default number of elements for printing INDArrays (via NDArrayStrings or INDArray.toString)static StringEMPTY_ARRAY_STR
-
Constructor Summary
Constructors Constructor Description NDArrayStrings()NDArrayStrings(boolean forceSummarize)NDArrayStrings(boolean forceSummarize, int precision)NDArrayStrings(int precision)Specify the number of digits after the decimal point to includeNDArrayStrings(long maxElements)NDArrayStrings(long maxElements, boolean forceSummarize, int precision)NDArrayStrings(long maxElements, int precision)NDArrayStrings(String colSep)NDArrayStrings(String colSep, int precision)Specify a delimiter for elements in columns for 2d arrays (or in the rank-1th dimension in higher order arrays) Separator in elements in remaining dimensions defaults to ",\n"NDArrayStrings(String colSep, String decFormat)Specify a col separator and a decimal format string
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringformat(INDArray arr)Stringformat(INDArray arr, boolean summarize)Format the given ndarray as a string
-
-
-
Field Detail
-
EMPTY_ARRAY_STR
public static final String EMPTY_ARRAY_STR
- See Also:
- Constant Field Values
-
DEFAULT_MAX_PRINT_ELEMENTS
public static final long DEFAULT_MAX_PRINT_ELEMENTS
The default number of elements for printing INDArrays (via NDArrayStrings or INDArray.toString)- See Also:
- Constant Field Values
-
-
Constructor Detail
-
NDArrayStrings
public NDArrayStrings()
-
NDArrayStrings
public NDArrayStrings(String colSep)
-
NDArrayStrings
public NDArrayStrings(int precision)
Specify the number of digits after the decimal point to include- Parameters:
precision-
-
NDArrayStrings
public NDArrayStrings(long maxElements, int precision)
-
NDArrayStrings
public NDArrayStrings(long maxElements)
-
NDArrayStrings
public NDArrayStrings(long maxElements, boolean forceSummarize, int precision)
-
NDArrayStrings
public NDArrayStrings(boolean forceSummarize, int precision)
-
NDArrayStrings
public NDArrayStrings(boolean forceSummarize)
-
NDArrayStrings
public NDArrayStrings(String colSep, int precision)
Specify a delimiter for elements in columns for 2d arrays (or in the rank-1th dimension in higher order arrays) Separator in elements in remaining dimensions defaults to ",\n"- Parameters:
colSep- field separating columns;precision- digits after decimal point
-
-
Method Detail
-
format
public String format(INDArray arr)
- Parameters:
arr-- Returns:
- String representation of the array adhering to options provided in the constructor
-
format
public String format(INDArray arr, boolean summarize)
Format the given ndarray as a string- Parameters:
arr- the array to formatsummarize- If true and the number of elements in the array is greater than > 1000 only the first three and last elements in any dimension will print- Returns:
- the formatted array
-
-