Package ai.djl.ndarray.index.dim
Class NDIndexSlice
- java.lang.Object
-
- ai.djl.ndarray.index.dim.NDIndexSlice
-
- All Implemented Interfaces:
NDIndexElement
public class NDIndexSlice extends java.lang.Object implements NDIndexElement
An NDIndexElement that returns a range of values in the specified dimension.
-
-
Constructor Summary
Constructors Constructor Description NDIndexSlice(java.lang.Long min, java.lang.Long max, java.lang.Long step)Constructs aNDIndexSliceinstance with specified range and step.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.LonggetMax()Returns the end of the range.java.lang.LonggetMin()Returns the start of the range.intgetRank()Returns the number of dimensions occupied by this index element.java.lang.LonggetStep()Returns the step between each slice.
-
-
-
Constructor Detail
-
NDIndexSlice
public NDIndexSlice(java.lang.Long min, java.lang.Long max, java.lang.Long step)Constructs aNDIndexSliceinstance with specified range and step.- Parameters:
min- the start of the rangemax- the end of the rangestep- the step between each slice- Throws:
java.lang.IllegalArgumentException- Thrown if the step is zero
-
-
Method Detail
-
getMin
public java.lang.Long getMin()
Returns the start of the range.- Returns:
- the start of the range
-
getMax
public java.lang.Long getMax()
Returns the end of the range.- Returns:
- the end of the range
-
getStep
public java.lang.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:
getRankin interfaceNDIndexElement- Returns:
- the number of dimensions occupied by this index element
-
-