nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/indexing/BooleanIndexing.java
public static boolean[] and(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);
        boolean[] result = new boolean[(int) arr.length()];

        long tadLength = Shape.getTADLength(n.shape(), dimension);

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

        return result;
    }
public static boolean[] and(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);
        boolean[] result = new boolean[(int) arr.length()];

        long tadLength = Shape.getTADLength(n.shape(), dimension);

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

        return result;
    }
public static boolean [ ] and ( 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 ) ; boolean [ ] result = new boolean [ ( int ) arr . length ( ) ] ; long tadLength = Shape . getTADLength ( n . shape ( ) , dimension ) ; for ( int i = 0 ; i < arr . length ( ) ; i ++ ) { if ( arr . getDouble ( i ) == tadLength ) result [ i ] = true ; else result [ i ] = false ; } return result ; }
And 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
And over the whole ndarray given some condition with respect to dimensions