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

        INDArray ret =  choose.getOutputArgument(0).get(NDArrayIndex.interval(0,secondOutput));
        ret = ret.reshape(ret.length());
        return ret;
    }
public static INDArray chooseFrom(@NonNull  INDArray[] input, @NonNull  List<Double> tArgs, @NonNull List<Integer> iArgs, @NonNull Condition condition) {
        Choose choose = new Choose(input,iArgs,tArgs,condition);
        Nd4j.getExecutioner().exec(choose);
        int secondOutput = choose.getOutputArgument(1).getInt(0);
        if(secondOutput < 1) {
            return null;
        }

        INDArray ret =  choose.getOutputArgument(0).get(NDArrayIndex.interval(0,secondOutput));
        ret = ret.reshape(ret.length());
        return ret;
    }
public static INDArray chooseFrom ( @ NonNull INDArray [ ] input , @ NonNull List < Double > tArgs , @ NonNull List < Integer > iArgs , @ NonNull Condition condition ) { Choose choose = new Choose ( input , iArgs , tArgs , condition ) ; Nd4j . getExecutioner ( ) . exec ( choose ) ; int secondOutput = choose . getOutputArgument ( 1 ) . getInt ( 0 ) ; if ( secondOutput < 1 ) { return null ; } INDArray ret = choose . getOutputArgument ( 0 ) . get ( NDArrayIndex . interval ( 0 , secondOutput ) ) ; ret = ret . reshape ( ret . length ( ) ) ; return ret ; }
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.
The double and integer arguments are only relevant
for scalar operations (like when you have a scalar
you are trying to compare each element in your input against)

@param input the input to filter
@param tArgs the double args
@param iArgs the integer args
@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 . The double and integer arguments are only relevant for scalar operations ( like when you have a scalar you are trying to compare each element in your input against )