Package org.nd4j.linalg.util
Class Nd4jValidator
- java.lang.Object
-
- org.nd4j.linalg.util.Nd4jValidator
-
public class Nd4jValidator extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ValidationResultvalidateINDArrayFile(@NonNull File f)Validate whether the file represents a valid INDArray (of any data type) saved previously withNd4j.saveBinary(INDArray, File)to be read withNd4j.readBinary(File)static ValidationResultvalidateINDArrayFile(@NonNull File f, DataType... allowableDataTypes)Validate whether the file represents a valid INDArray (of one of the allowed/specified data types) saved previously withNd4j.saveBinary(INDArray, File)to be read withNd4j.readBinary(File)static ValidationResultvalidateINDArrayTextFile(@NonNull File f)Validate whether the file represents a valid INDArray text file (of any data type) saved previously withNd4j.writeTxt(INDArray, String)to be read withNd4j.readTxt(String)}static ValidationResultvalidateNpyFile(@NonNull File f)Validate whether the file represents a valid Numpy .npy file to be read withNd4j.createFromNpyFile(File)}static ValidationResultvalidateNpzFile(@NonNull File f)Validate whether the file represents a valid Numpy .npz file to be read withNd4j.createFromNpyFile(File)}static ValidationResultvalidateNumpyTxtFile(@NonNull File f, @NonNull String delimiter, @NonNull Charset charset)Validate whether the file represents a valid Numpy text file (written using numpy.savetxt) to be read withNd4j.readNumpy(String)}static ValidationResultvalidateSameDiffFlatBuffers(@NonNull File f)Validate whether the file represents a valid SameDiff FlatBuffers file, previously saved withSameDiff.asFlatFile(File)) to be read withSameDiff.fromFlatFile(File)}
-
-
-
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 withNd4j.saveBinary(INDArray, File)to be read withNd4j.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 withNd4j.saveBinary(INDArray, File)to be read withNd4j.readBinary(File)- Parameters:
f- File that should represent an INDArray saved with Nd4j.saveBinaryallowableDataTypes- 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 withNd4j.writeTxt(INDArray, String)to be read withNd4j.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 withNd4j.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 withNd4j.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 withNd4j.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 withSameDiff.asFlatFile(File)) to be read withSameDiff.fromFlatFile(File)}- Parameters:
f- File that should represent a SameDiff FlatBuffers file- Returns:
- Result of validation
-
-