ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/AbstractSparseNdArray.java [154:168]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  @Override
  public NdArraySequence<U> elements(int dimensionIdx) {
    if (dimensionIdx >= shape().numDimensions()) {
      throw new IllegalArgumentException(
          "Cannot iterate elements in dimension '"
              + dimensionIdx
              + "' of array with shape "
              + shape());
    }
    if (rank() == 0 && dimensionIdx < 0) {
      return new SingleElementSequence<>(this);
    }
    DimensionalSpace elemDims = dimensions().from(dimensionIdx + 1);

    return new SlicingElementSequence<>(this, dimensionIdx, elemDims);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/slice/SparseSlice.java [111:124]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  @Override
  public NdArraySequence<U> elements(int dimensionIdx) {
    if (dimensionIdx >= shape().numDimensions()) {
      throw new IllegalArgumentException(
          "Cannot iterate elements in dimension '"
              + dimensionIdx
              + "' of array with shape "
              + shape());
    }
    if (rank() == 0 && dimensionIdx < 0) {
      return new SingleElementSequence<>(this);
    }
    DimensionalSpace elemDims = dimensions().from(dimensionIdx + 1);
    return new SlicingElementSequence<>(this, dimensionIdx, elemDims);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



