Interface Index
- All Superinterfaces:
Serializable
Immutable sequence used for indexing.
-
Method Summary
Modifier and TypeMethodDescriptionintapply(int i) Returns the index to underlying data.default IndexFlatten the index of index.static Indexof(boolean... mask) Returns the index of multiple elements in a dimension.static Indexof(int... indices) Returns the index of multiple elements in a dimension.static Indexrange(int start, int end) Returns the range index for [start, end) with incremental step 1.static IndexReturns the range index for [start, end) with the given incremental step.intsize()Returns the number of elements in the index.stream()Returns an integer stream of elements in the index.default int[]toArray()Returns an integer array of elements in the index.
-
Method Details
-
size
int size()Returns the number of elements in the index.- Returns:
- the number of elements in the index.
-
apply
int apply(int i) Returns the index to underlying data.- Parameters:
i- the index to data element.- Returns:
- the index to underlying data.
-
stream
IntStream stream()Returns an integer stream of elements in the index.- Returns:
- an integer stream of elements in the index.
-
toArray
default int[] toArray()Returns an integer array of elements in the index.- Returns:
- an integer array of elements in the index.
-
flatten
-
of
Returns the index of multiple elements in a dimension.- Parameters:
indices- the indices of multiple elements.- Returns:
- the index.
-
of
Returns the index of multiple elements in a dimension.- Parameters:
mask- the boolean flags to select multiple elements. The length of array should match that of the corresponding dimension of tensor.- Returns:
- the index.
-
range
Returns the range index for [start, end) with incremental step 1.- Parameters:
start- the inclusive start index.end- the exclusive end index.- Returns:
- the range index.
-
range
-