public static INDArray lastIndex ( INDArray array , Condition condition ) { if ( ! ( condition instanceof BaseCondition ) ) throw new UnsupportedOperationException ( "Only static Conditions are supported" ) ; LastIndex idx = new LastIndex ( array , condition ) ; Nd4j . getExecutioner ( ) . exec ( idx ) ; return Nd4j . scalar ( DataType . LONG , idx . getFinalResult ( ) . longValue ( ) ) ; }
This method returns last index matching given condition