Class NDIndexFullSlice

java.lang.Object
ai.djl.ndarray.index.full.NDIndexFullSlice

public final class NDIndexFullSlice extends Object
An index as a slice on all dimensions where some dimensions can be squeezed.
  • Method Details

    • fromIndex

      public static Optional<NDIndexFullSlice> fromIndex(NDIndex index, Shape target)
      Returns (if possible) the NDIndexFullSlice representation of an NDIndex.
      Parameters:
      index - the index to represent
      target - the shape of the array to index
      Returns:
      the full slice representation or nothing if it can't represent the index
    • getMin

      public long[] getMin()
      Returns the slice min for each axis.
      Returns:
      the slice min for each axis
    • getMax

      public long[] getMax()
      Returns the slice max for each axis.
      Returns:
      the slice max for each axis
    • getStep

      public long[] getStep()
      Returns the slice step for each axis.
      Returns:
      the slice step for each axis
    • getToSqueeze

      public int[] getToSqueeze()
      Returns the squeeze array of axis.
      Returns:
      the squeeze array of axis
    • getShape

      public Shape getShape()
      Returns the slice shape without squeezing.
      Returns:
      the slice shape without squeezing
    • getSqueezedShape

      public Shape getSqueezedShape()
      Returns the slice shape with squeezing.
      Returns:
      the slice shape with squeezing