nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/indexing/BooleanIndexing.java
public static boolean[] or(final INDArray n, final Condition condition, int... dimension) {
        if (!(condition instanceof BaseCondition))
            throw new UnsupportedOperationException("Only static Conditions are supported");

        MatchCondition op = new MatchCondition(n, condition);
        INDArray arr = Nd4j.getExecutioner().exec(op, dimension);

        // FIXME: int cast

        boolean[] result = new boolean[(int) arr.length()];

        for (int i = 0; i < arr.length(); i++) {
            if (arr.getDouble(i) > 0)
                result[i] = true;
            else
                result[i] = false;
        }

        return result;
    }
public static boolean[] or(final INDArray n, final Condition condition, int... dimension) {
        if (!(condition instanceof BaseCondition))
            throw new UnsupportedOperationException("Only static Conditions are supported");

        MatchCondition op = new MatchCondition(n, condition);
        INDArray arr = Nd4j.getExecutioner().exec(op, dimension);

        // FIXME: int cast

        boolean[] result = new boolean[(int) arr.length()];

        for (int i = 0; i < arr.length(); i++) {
            if (arr.getDouble(i) > 0)
                result[i] = true;
            else
                result[i] = false;
        }

        return result;
    }
public static boolean [ ] or ( final INDArray n , final Condition condition , int ... dimension ) { if ( ! ( condition instanceof BaseCondition ) ) throw new UnsupportedOperationException ( "Only static Conditions are supported" ) ; MatchCondition op = new MatchCondition ( n , condition ) ; INDArray arr = Nd4j . getExecutioner ( ) . exec ( op , dimension ) ; // FIXME: int cast boolean [ ] result = new boolean [ ( int ) arr . length ( ) ] ; for ( int i = 0 ; i < arr . length ( ) ; i ++ ) { if ( arr . getDouble ( i ) > 0 ) result [ i ] = true ; else result [ i ] = false ; } return result ; }
Or over the whole ndarray given some condition, with respect to dimensions

@param n    the ndarray to test
@param condition the condition to test against
@return true if all of the elements meet the specified
condition false otherwise
Or over the whole ndarray given some condition with respect to dimensions