Package org.nd4j.autodiff.samediff.ops
Class SDValidation
- java.lang.Object
-
- org.nd4j.autodiff.samediff.ops.SDValidation
-
public class SDValidation extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isSameType(SDVariable[] x)
static boolean
isSameType(SDVariable x, SDVariable y)
protected static void
validateBool(String opName, String inputName, SDVariable v)
Validate that the operation is being applied on a boolean type SDVariableprotected static void
validateBool(String opName, SDVariable v)
Validate that the operation is being applied on a boolean type SDVariableprotected static void
validateBool(String opName, SDVariable v1, SDVariable v2)
Validate that the operation is being applied on boolean SDVariablesprotected static void
validateFloatingPoint(String opName, String inputName, SDVariable v)
Validate that the operation is being applied on a floating point type SDVariableprotected static void
validateFloatingPoint(String opName, SDVariable v)
Validate that the operation is being applied on an floating point type SDVariableprotected static void
validateInteger(String opName, String inputName, SDVariable v)
Validate that the operation is being applied on an integer type SDVariableprotected static void
validateInteger(String opName, String inputName, SDVariable[] vars)
protected static void
validateInteger(String opName, SDVariable v)
Validate that the operation is being applied on an integer type SDVariableprotected static void
validateNumerical(String opName, String inputName, SDVariable v)
Validate that the operation is being applied on a numerical SDVariable (not boolean or utf8).protected static void
validateNumerical(String opName, String inputName, SDVariable[] vars)
protected static void
validateNumerical(String opName, SDVariable v)
Validate that the operation is being applied on a numerical SDVariable (not boolean or utf8).protected static void
validateNumerical(String opName, SDVariable v1, SDVariable v2)
Validate that the operation is being applied on numerical SDVariables (not boolean or utf8).protected static void
validateSameType(String opName, boolean numericalOnly, SDVariable... vars)
Validate that the operation is being applied on array with the exact same datatypes (which may optionally be restricted to numerical SDVariables only (not boolean or utf8))
-
-
-
Method Detail
-
validateNumerical
protected static void validateNumerical(String opName, SDVariable v)
Validate that the operation is being applied on a numerical SDVariable (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 exceptionv
- Variable to perform operation on
-
validateNumerical
protected static void validateNumerical(String opName, String inputName, SDVariable v)
Validate that the operation is being applied on a numerical SDVariable (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 exceptionv
- Variable to validate datatype for (input to operation)
-
validateNumerical
protected static void validateNumerical(String opName, String inputName, SDVariable[] vars)
-
validateNumerical
protected static void validateNumerical(String opName, SDVariable v1, SDVariable v2)
Validate that the operation is being applied on numerical SDVariables (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 exceptionv1
- Variable to validate datatype for (input to operation)v2
- Variable to validate datatype for (input to operation)
-
validateInteger
protected static void validateInteger(String opName, SDVariable v)
Validate that the operation is being applied on an integer type SDVariable- Parameters:
opName
- Operation name to print in the exceptionv
- Variable to validate datatype for (input to operation)
-
validateInteger
protected static void validateInteger(String opName, String inputName, SDVariable v)
Validate that the operation is being applied on an integer type SDVariable- Parameters:
opName
- Operation name to print in the exceptioninputName
- Name of the input to the op to validatev
- Variable to validate datatype for (input to operation)
-
validateInteger
protected static void validateInteger(String opName, String inputName, SDVariable[] vars)
-
validateFloatingPoint
protected static void validateFloatingPoint(String opName, SDVariable v)
Validate that the operation is being applied on an floating point type SDVariable- Parameters:
opName
- Operation name to print in the exceptionv
- Variable to validate datatype for (input to operation)
-
validateFloatingPoint
protected static void validateFloatingPoint(String opName, String inputName, SDVariable v)
Validate that the operation is being applied on a floating point type SDVariable- Parameters:
opName
- Operation name to print in the exceptioninputName
- Name of the input to the op to validatev
- Variable to validate datatype for (input to operation)
-
validateBool
protected static void validateBool(String opName, SDVariable v)
Validate that the operation is being applied on a boolean type SDVariable- Parameters:
opName
- Operation name to print in the exceptionv
- Variable to validate datatype for (input to operation)
-
validateBool
protected static void validateBool(String opName, String inputName, SDVariable v)
Validate that the operation is being applied on a boolean type SDVariable- Parameters:
opName
- Operation name to print in the exceptioninputName
- Name of the input to the op to validatev
- Variable to validate datatype for (input to operation)
-
validateBool
protected static void validateBool(String opName, SDVariable v1, SDVariable v2)
Validate that the operation is being applied on boolean SDVariables- Parameters:
opName
- Operation name to print in the exceptionv1
- Variable to validate datatype for (input to operation)v2
- Variable to validate datatype for (input to operation)
-
validateSameType
protected static void validateSameType(String opName, boolean numericalOnly, SDVariable... vars)
Validate that the operation is being applied on array with the exact same datatypes (which may optionally be restricted to numerical SDVariables only (not boolean or utf8))- Parameters:
opName
- Operation name to print in the exceptionnumericalOnly
- 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(SDVariable x, SDVariable y)
-
isSameType
public static boolean isSameType(SDVariable[] x)
-
-