nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/indexing/BooleanIndexing.java
public static INDArray chooseFrom(@NonNull  INDArray[] input,@NonNull  Condition condition) {
        Choose choose = new Choose(input,condition);
        Nd4j.getExecutioner().exec(choose);
        int secondOutput = choose.getOutputArgument(1).getInt(0);
        if(secondOutput < 1) {
            return null;
        }

        return choose.getOutputArgument(0);
    }
public static INDArray chooseFrom(@NonNull  INDArray[] input,@NonNull  Condition condition) {
        Choose choose = new Choose(input,condition);
        Nd4j.getExecutioner().exec(choose);
        int secondOutput = choose.getOutputArgument(1).getInt(0);
        if(secondOutput < 1) {
            return null;
        }

        return choose.getOutputArgument(0);
    }
public static INDArray chooseFrom ( @ NonNull INDArray [ ] input , @ NonNull Condition condition ) { Choose choose = new Choose ( input , condition ) ; Nd4j . getExecutioner ( ) . exec ( choose ) ; int secondOutput = choose . getOutputArgument ( 1 ) . getInt ( 0 ) ; if ( secondOutput < 1 ) { return null ; } return choose . getOutputArgument ( 0 ) ; }
Choose from the inputs based on the given condition.
This returns a row vector of all elements fulfilling the
condition listed within the array for input
@param input the input to filter
@param condition the condition to filter based on
@return a row vector of the input elements that are true
ffor the given conditions
Choose from the inputs based on the given condition . This returns a row vector of all elements fulfilling the condition listed within the array for input