Class ND4JTestUtils


  • public class ND4JTestUtils
    extends Object
    • 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 (via ND4JTestUtils.EqualsFn Assumes the saved files represent INDArrays saved with Nd4j.saveBinary(INDArray, File)
        Parameters:
        dir1 - First directory
        dir2 - Second directory
        recursive - 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 with Nd4j.saveBinary(INDArray, File)
        Parameters:
        dir1 - First directory
        dir2 - Second directory
        recursive - Whether to search recursively (i.e., include files in subdirectories
        Returns:
        Comparison results
        Throws:
        Exception