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