Class NDIndexSlice

java.lang.Object
ai.djl.ndarray.index.dim.NDIndexSlice
All Implemented Interfaces:
NDIndexElement

public class NDIndexSlice extends Object implements NDIndexElement
An NDIndexElement that returns a range of values in the specified dimension.
  • Constructor Details

    • NDIndexSlice

      public NDIndexSlice(Long min, Long max, Long step)
      Constructs a NDIndexSlice instance with specified range and step.
      Parameters:
      min - the start of the range
      max - the end of the range
      step - the step between each slice
      Throws:
      IllegalArgumentException - Thrown if the step is zero
  • Method Details

    • getMin

      public Long getMin()
      Returns the start of the range.
      Returns:
      the start of the range
    • getMax

      public Long getMax()
      Returns the end of the range.
      Returns:
      the end of the range
    • getStep

      public Long getStep()
      Returns the step between each slice.
      Returns:
      the step between each slice
    • getRank

      public int getRank()
      Returns the number of dimensions occupied by this index element.
      Specified by:
      getRank in interface NDIndexElement
      Returns:
      the number of dimensions occupied by this index element