Package ai.djl.ndarray.index.dim
Class NDIndexSlice
java.lang.Object
ai.djl.ndarray.index.dim.NDIndexSlice
- All Implemented Interfaces:
NDIndexElement
An NDIndexElement that returns a range of values in the specified dimension.
-
Constructor Summary
ConstructorsConstructorDescriptionNDIndexSlice
(Long min, Long max, Long step) Constructs aNDIndexSlice
instance with specified range and step. -
Method Summary
-
Constructor Details
-
NDIndexSlice
Constructs aNDIndexSlice
instance with specified range and step.- Parameters:
min
- the start of the rangemax
- the end of the rangestep
- the step between each slice- Throws:
IllegalArgumentException
- Thrown if the step is zero
-
-
Method Details
-
getMin
Returns the start of the range.- Returns:
- the start of the range
-
getMax
Returns the end of the range.- Returns:
- the end of the range
-
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 interfaceNDIndexElement
- Returns:
- the number of dimensions occupied by this index element
-