Class NDValidation


  • public class NDValidation
    extends Object
    • Method Detail

      • validateNumerical

        public static void validateNumerical​(String opName,
                                             INDArray v)
        Validate that the operation is being applied on a numerical INDArray (not boolean or utf8). Some operations (such as sum, norm2, add(Number) etc) don't make sense when applied to boolean/utf8 arrays
        Parameters:
        opName - Operation name to print in the exception
        v - Variable to perform operation on
      • validateNumerical

        public static void validateNumerical​(String opName,
                                             INDArray[] v)
        Validate that the operation is being applied on numerical INDArrays (not boolean or utf8). Some operations (such as sum, norm2, add(Number) etc) don't make sense when applied to boolean/utf8 arrays
        Parameters:
        opName - Operation name to print in the exception
        v - Variable to perform operation on
      • validateNumerical

        public static void validateNumerical​(String opName,
                                             String inputName,
                                             INDArray v)
        Validate that the operation is being applied on a numerical INDArray (not boolean or utf8). Some operations (such as sum, norm2, add(Number) etc) don't make sense when applied to boolean/utf8 arrays
        Parameters:
        opName - Operation name to print in the exception
        v - Variable to validate datatype for (input to operation)
      • validateNumerical

        public static void validateNumerical​(String opName,
                                             String inputName,
                                             INDArray[] v)
        Validate that the operation is being applied on numerical INDArrays (not boolean or utf8). Some operations (such as sum, norm2, add(Number) etc) don't make sense when applied to boolean/utf8 arrays
        Parameters:
        opName - Operation name to print in the exception
        v - Variable to perform operation on
      • validateNumerical

        public static void validateNumerical​(String opName,
                                             INDArray v1,
                                             INDArray v2)
        Validate that the operation is being applied on numerical INDArrays (not boolean or utf8). Some operations (such as sum, norm2, add(Number) etc don't make sense when applied to boolean/utf8 arrays
        Parameters:
        opName - Operation name to print in the exception
        v1 - Variable to validate datatype for (input to operation)
        v2 - Variable to validate datatype for (input to operation)
      • validateInteger

        public static void validateInteger​(String opName,
                                           INDArray v)
        Validate that the operation is being applied on an integer type INDArray
        Parameters:
        opName - Operation name to print in the exception
        v - Variable to validate datatype for (input to operation)
      • validateInteger

        public static void validateInteger​(String opName,
                                           String inputName,
                                           INDArray v)
        Validate that the operation is being applied on an integer type INDArray
        Parameters:
        opName - Operation name to print in the exception
        inputName - Name of the input to the op to validate
        v - Variable to validate datatype for (input to operation)
      • validateInteger

        public static void validateInteger​(String opName,
                                           String inputName,
                                           INDArray[] v)
        Validate that the operation is being applied on an integer type INDArray []
        Parameters:
        opName - Operation name to print in the exception
        inputName - Name of the input to the op to validate
        v - Variable to validate datatype for (input to operation)
      • validateFloatingPoint

        public static void validateFloatingPoint​(String opName,
                                                 INDArray v)
        Validate that the operation is being applied on an floating point type INDArray
        Parameters:
        opName - Operation name to print in the exception
        v - Variable to validate datatype for (input to operation)
      • validateFloatingPoint

        public static void validateFloatingPoint​(String opName,
                                                 String inputName,
                                                 INDArray v)
        Validate that the operation is being applied on a floating point type INDArray
        Parameters:
        opName - Operation name to print in the exception
        inputName - Name of the input to the op to validate
        v - Variable to validate datatype for (input to operation)
      • validateBool

        public static void validateBool​(String opName,
                                        INDArray v)
        Validate that the operation is being applied on a boolean type INDArray
        Parameters:
        opName - Operation name to print in the exception
        v - Variable to validate datatype for (input to operation)
      • validateBool

        public static void validateBool​(String opName,
                                        String inputName,
                                        INDArray v)
        Validate that the operation is being applied on a boolean type INDArray
        Parameters:
        opName - Operation name to print in the exception
        inputName - Name of the input to the op to validate
        v - Variable to validate datatype for (input to operation)
      • validateBool

        public static void validateBool​(String opName,
                                        INDArray v1,
                                        INDArray v2)
        Validate that the operation is being applied on boolean INDArrays
        Parameters:
        opName - Operation name to print in the exception
        v1 - Variable to validate datatype for (input to operation)
        v2 - Variable to validate datatype for (input to operation)
      • validateSameType

        public static void validateSameType​(String opName,
                                            boolean numericalOnly,
                                            INDArray... vars)
        Validate that the operation is being applied on array with the exact same datatypes (which may optionally be restricted to numerical INDArrays only (not boolean or utf8))
        Parameters:
        opName - Operation name to print in the exception
        numericalOnly - If true, the variables must all be the same type, and must be numerical (not boolean/utf8)
        vars - Variable to perform operation on
      • isSameType

        public static boolean isSameType​(INDArray[] x)