Class Nd4jValidator


  • public class Nd4jValidator
    extends Object
    • Method Detail

      • validateINDArrayFile

        public static ValidationResult validateINDArrayFile​(@NonNull
                                                            @NonNull File f)
        Validate whether the file represents a valid INDArray (of any data type) saved previously with Nd4j.saveBinary(INDArray, File) to be read with Nd4j.readBinary(File)
        Parameters:
        f - File that should represent an INDArray saved with Nd4j.saveBinary
        Returns:
        Result of validation
      • validateINDArrayFile

        public static ValidationResult validateINDArrayFile​(@NonNull
                                                            @NonNull File f,
                                                            DataType... allowableDataTypes)
        Validate whether the file represents a valid INDArray (of one of the allowed/specified data types) saved previously with Nd4j.saveBinary(INDArray, File) to be read with Nd4j.readBinary(File)
        Parameters:
        f - File that should represent an INDArray saved with Nd4j.saveBinary
        allowableDataTypes - May be null. If non-null, the file must represent one of the specified data types
        Returns:
        Result of validation
      • validateINDArrayTextFile

        public static ValidationResult validateINDArrayTextFile​(@NonNull
                                                                @NonNull File f)
        Validate whether the file represents a valid INDArray text file (of any data type) saved previously with Nd4j.writeTxt(INDArray, String) to be read with Nd4j.readTxt(String) }
        Parameters:
        f - File that should represent an INDArray saved with Nd4j.writeTxt
        Returns:
        Result of validation
      • validateNpyFile

        public static ValidationResult validateNpyFile​(@NonNull
                                                       @NonNull File f)
        Validate whether the file represents a valid Numpy .npy file to be read with Nd4j.createFromNpyFile(File) }
        Parameters:
        f - File that should represent a Numpy .npy file written with Numpy save method
        Returns:
        Result of validation
      • validateNpzFile

        public static ValidationResult validateNpzFile​(@NonNull
                                                       @NonNull File f)
        Validate whether the file represents a valid Numpy .npz file to be read with Nd4j.createFromNpyFile(File) }
        Parameters:
        f - File that should represent a Numpy .npz file written with Numpy savez method
        Returns:
        Result of validation
      • validateNumpyTxtFile

        public static ValidationResult validateNumpyTxtFile​(@NonNull
                                                            @NonNull File f,
                                                            @NonNull
                                                            @NonNull String delimiter,
                                                            @NonNull
                                                            @NonNull Charset charset)
        Validate whether the file represents a valid Numpy text file (written using numpy.savetxt) to be read with Nd4j.readNumpy(String) }
        Parameters:
        f - File that should represent a Numpy text file written with Numpy savetxt method
        Returns:
        Result of validation
      • validateSameDiffFlatBuffers

        public static ValidationResult validateSameDiffFlatBuffers​(@NonNull
                                                                   @NonNull File f)
        Validate whether the file represents a valid SameDiff FlatBuffers file, previously saved with SameDiff.asFlatFile(File) ) to be read with SameDiff.fromFlatFile(File) }
        Parameters:
        f - File that should represent a SameDiff FlatBuffers file
        Returns:
        Result of validation