Class OpTestCase


  • public class OpTestCase
    extends Object
    • Constructor Detail

    • Method Detail

      • expectedOutput

        public OpTestCase expectedOutput​(int outputNum,
                                         INDArray expected)
        Validate the op output using INDArray.equals(INDArray)
        Parameters:
        outputNum - Number of the output
        expected - Expected INDArray
      • expectedOutput

        public OpTestCase expectedOutput​(int outputNum,
                                         INDArray expected,
                                         double eps)
        Validate the op output using INDArray.equals(INDArray)
        Parameters:
        outputNum - Number of the output
        expected - Expected INDArray
      • expectedOutputRelError

        public OpTestCase expectedOutputRelError​(int outputNum,
                                                 @NonNull
                                                 @NonNull INDArray expected,
                                                 double maxRelError,
                                                 double minAbsError)
        Validate the output for a single variable using element-wise relative error: relError = abs(x-y)/(abs(x)+abs(y)), with x=y=0 case defined to be 0.0. Also has a minimum absolute error condition, which must be satisfied for the relative error failure to be considered legitimate
        Parameters:
        outputNum - output number
        expected - Expected INDArray
        maxRelError - Maximum allowable relative error
        minAbsError - Minimum absolute error for a failure to be considered legitimate
      • expectedOutput

        public OpTestCase expectedOutput​(int outputNum,
                                         @NonNull
                                         @NonNull LongShapeDescriptor expShape,
                                         @NonNull
                                         @NonNull Function<INDArray,​String> validationFn)
        Parameters:
        outputNum - Output number to check
        expShape - Expected shape for the output
        validationFn - Function to use to validate the correctness of the specific Op. Should return null if validation passes, or an error message if the op validation fails