public static boolean checkAdd ( INDArray first , INDArray second , double maxRelativeDifference , double minAbsDifference ) { RealMatrix rmFirst = convertToApacheMatrix ( first ) ; RealMatrix rmSecond = convertToApacheMatrix ( second ) ; INDArray result = first . add ( second ) ; RealMatrix rmResult = rmFirst . add ( rmSecond ) ; if ( ! checkShape ( rmResult , result ) ) return false ; boolean ok = checkEntries ( rmResult , result , maxRelativeDifference , minAbsDifference ) ; if ( ! ok ) { INDArray onCopies = Shape . toOffsetZeroCopy ( first ) . add ( Shape . toOffsetZeroCopy ( second ) ) ; printFailureDetails ( first , second , rmResult , result , onCopies , "add" ) ; } return ok ; }
Same as checkMmul but for matrix addition