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 booleanisSameType(SDVariable[] x)static booleanisSameType(SDVariable x, SDVariable y)protected static voidvalidateBool(String opName, String inputName, SDVariable v)Validate that the operation is being applied on a boolean type SDVariableprotected static voidvalidateBool(String opName, SDVariable v)Validate that the operation is being applied on a boolean type SDVariableprotected static voidvalidateBool(String opName, SDVariable v1, SDVariable v2)Validate that the operation is being applied on boolean SDVariablesprotected static voidvalidateFloatingPoint(String opName, String inputName, SDVariable v)Validate that the operation is being applied on a floating point type SDVariableprotected static voidvalidateFloatingPoint(String opName, SDVariable v)Validate that the operation is being applied on an floating point type SDVariableprotected static voidvalidateInteger(String opName, String inputName, SDVariable v)Validate that the operation is being applied on an integer type SDVariableprotected static voidvalidateInteger(String opName, String inputName, SDVariable[] vars)protected static voidvalidateInteger(String opName, SDVariable v)Validate that the operation is being applied on an integer type SDVariableprotected static voidvalidateNumerical(String opName, String inputName, SDVariable v)Validate that the operation is being applied on a numerical SDVariable (not boolean or utf8).protected static voidvalidateNumerical(String opName, String inputName, SDVariable[] vars)protected static voidvalidateNumerical(String opName, SDVariable v)Validate that the operation is being applied on a numerical SDVariable (not boolean or utf8).protected static voidvalidateNumerical(String opName, SDVariable v1, SDVariable v2)Validate that the operation is being applied on numerical SDVariables (not boolean or utf8).protected static voidvalidateSameType(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)
-
-