Package ai.djl.ndarray.index.full
Class NDIndexFullSlice
java.lang.Object
ai.djl.ndarray.index.full.NDIndexFullSlice
An index as a slice on all dimensions where some dimensions can be squeezed.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<NDIndexFullSlice>Returns (if possible) theNDIndexFullSlicerepresentation of anNDIndex.long[]getMax()Returns the slice max for each axis.long[]getMin()Returns the slice min for each axis.getShape()Returns the slice shape without squeezing.Returns the slice shape with squeezing.long[]getStep()Returns the slice step for each axis.int[]Returns the squeeze array of axis.
-
Method Details
-
fromIndex
Returns (if possible) theNDIndexFullSlicerepresentation of anNDIndex.- Parameters:
index- the index to representtarget- 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
Returns the slice shape without squeezing.- Returns:
- the slice shape without squeezing
-
getSqueezedShape
Returns the slice shape with squeezing.- Returns:
- the slice shape with squeezing
-