public static INDArrayIndex [ ] createFromStartAndEnd ( INDArray start , INDArray end ) { if ( start . length ( ) != end . length ( ) ) throw new IllegalArgumentException ( "Start length must be equal to end length" ) ; else { if ( start . length ( ) > Integer . MAX_VALUE ) throw new ND4JIllegalStateException ( "Can't proceed with INDArray with length > Integer.MAX_VALUE" ) ; INDArrayIndex [ ] indexes = new INDArrayIndex [ ( int ) start . length ( ) ] ; for ( int i = 0 ; i < indexes . length ; i ++ ) { indexes [ i ] = NDArrayIndex . interval ( start . getInt ( i ) , end . getInt ( i ) ) ; } return indexes ; } }
Create an n dimensional index based on the given interval indices . Start and end represent the begin and end of each interval