public static void assignIf(@NonNull INDArray to, @NonNull INDArray from, @NonNull Condition condition) {
        if (!(condition instanceof BaseCondition))
            throw new UnsupportedOperationException("Only static Conditions are supported");

        if (to.length() != from.length())
            throw new IllegalStateException("Mis matched length for to and from");

        Nd4j.getExecutioner().exec(new CompareAndSet(to, from, condition));
    }
public static void assignIf ( @ NonNull INDArray to , @ NonNull INDArray from , @ NonNull Condition condition ) { if ( ! ( condition instanceof BaseCondition ) ) throw new UnsupportedOperationException ( "Only static Conditions are supported" ) ; if ( to . length ( ) != from . length ( ) ) throw new IllegalStateException ( "Mis matched length for to and from" ) ; Nd4j . getExecutioner ( ) . exec ( new CompareAndSet ( to , from , condition ) ) ; }
This method does element-wise comparison
for 2 equal-sized matrices, for each element that matches Condition.
To is the array to apply the indexing to
from is a condition mask array (0 or 1).
This would come from the output of a bit masking method like:
{@link INDArray#gt(Number)},{@link INDArray#gte(Number)},
{@link INDArray#lt(Number)},..

@param to the array to apply the condition to
@param from the mask array
@param condition the condition to apply