Package ai.djl.ndarray.index.full
Class NDIndexFullSlice
- java.lang.Object
-
- ai.djl.ndarray.index.full.NDIndexFullSlice
-
public final class NDIndexFullSlice extends java.lang.Object
An index as a slice on all dimensions where some dimensions can be squeezed.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.util.Optional<NDIndexFullSlice>
fromIndex(NDIndex index, Shape target)
Returns (if possible) theNDIndexFullSlice
representation of anNDIndex
.long[]
getMax()
Returns the slice max for each axis.long[]
getMin()
Returns the slice min for each axis.Shape
getShape()
Returns the slice shape without squeezing.Shape
getSqueezedShape()
Returns the slice shape with squeezing.long[]
getStep()
Returns the slice step for each axis.int[]
getToSqueeze()
Returns the squeeze array of axis.
-
-
-
Method Detail
-
fromIndex
public static java.util.Optional<NDIndexFullSlice> fromIndex(NDIndex index, Shape target)
Returns (if possible) theNDIndexFullSlice
representation 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
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
-
-