code: 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;
          }
      }
docs: Create an n dimensional index
  based on the given interval indices.
  Start and end represent the begin and
  end of each interval
  @param start the start indexes
  @param end the end indexes
  @return the interval index relative to the given
  start and end indices