nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/factory/BaseNDArrayFactory.java
@Override
    public INDArray reverse(INDArray reverse) {
        // FIXME: native method should be used instead
        INDArray rev = reverse.linearView();
        INDArray ret = Nd4j.create(rev.shape());
        int count = 0;
        for (long i = rev.length() - 1; i >= 0; i--) {
            ret.putScalar(count++, rev.getFloat(i));

        }

        return ret.reshape(reverse.shape());
    }
@Override
    public INDArray reverse(INDArray reverse) {
        // FIXME: native method should be used instead
        INDArray rev = reverse.linearView();
        INDArray ret = Nd4j.create(rev.shape());
        int count = 0;
        for (long i = rev.length() - 1; i >= 0; i--) {
            ret.putScalar(count++, rev.getFloat(i));

        }

        return ret.reshape(reverse.shape());
    }
@ Override public INDArray reverse ( INDArray reverse ) { // FIXME: native method should be used instead INDArray rev = reverse . linearView ( ) ; INDArray ret = Nd4j . create ( rev . shape ( ) ) ; int count = 0 ; for ( long i = rev . length ( ) - 1 ; i >= 0 ; i -- ) { ret . putScalar ( count ++ , rev . getFloat ( i ) ) ; } return ret . reshape ( reverse . shape ( ) ) ; }
Reverses the passed in matrix such that m[0] becomes m[m.length - 1] etc

@param reverse the matrix to reverse
@return the reversed matrix
Reverses the passed in matrix such that m [ 0 ] becomes m [ m . length - 1 ] etc