Package org.nd4j.linalg.util
Class ND4JTestUtils
- java.lang.Object
-
- org.nd4j.linalg.util.ND4JTestUtils
-
public class ND4JTestUtils extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ND4JTestUtils.ComparisonResult
static class
ND4JTestUtils.EqualsFn
A function for use withvalidateSerializedArrays(File, File, boolean, BiFunction)
usingINDArray#equals(Object)
static class
ND4JTestUtils.EqualsWithEpsFn
A function for use withvalidateSerializedArrays(File, File, boolean, BiFunction)
usingINDArray.equalsWithEps(Object, double)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ND4JTestUtils.ComparisonResult
validateSerializedArrays(File dir1, File dir2, boolean recursive)
Scan the specified directories for matching files (i.e., same path relative to their respective root directories) and compare the contents using INDArray.equals (viaND4JTestUtils.EqualsFn
Assumes the saved files represent INDArrays saved withNd4j.saveBinary(INDArray, File)
static ND4JTestUtils.ComparisonResult
validateSerializedArrays(File dir1, File dir2, boolean recursive, BiFunction<INDArray,INDArray,Boolean> evalFn)
Scan the specified directories for matching files (i.e., same path relative to their respective root directories) and compare the contents using a provided function.
Assumes the saved files represent INDArrays saved withNd4j.saveBinary(INDArray, File)
-
-
-
Method Detail
-
validateSerializedArrays
public static ND4JTestUtils.ComparisonResult validateSerializedArrays(File dir1, File dir2, boolean recursive) throws Exception
Scan the specified directories for matching files (i.e., same path relative to their respective root directories) and compare the contents using INDArray.equals (viaND4JTestUtils.EqualsFn
Assumes the saved files represent INDArrays saved withNd4j.saveBinary(INDArray, File)
- Parameters:
dir1
- First directorydir2
- Second directoryrecursive
- Whether to search recursively (i.e., include files in subdirectories- Returns:
- Comparison results
- Throws:
Exception
-
validateSerializedArrays
public static ND4JTestUtils.ComparisonResult validateSerializedArrays(File dir1, File dir2, boolean recursive, BiFunction<INDArray,INDArray,Boolean> evalFn) throws Exception
Scan the specified directories for matching files (i.e., same path relative to their respective root directories) and compare the contents using a provided function.
Assumes the saved files represent INDArrays saved withNd4j.saveBinary(INDArray, File)
- Parameters:
dir1
- First directorydir2
- Second directoryrecursive
- Whether to search recursively (i.e., include files in subdirectories- Returns:
- Comparison results
- Throws:
Exception
-
-