Represents an indexer object. Indexers are used to index tensors.
An indexer can be one of:
Ellipsis: Corresponds to a full slice over multiple dimensions of a tensor. Ellipses are used to represent
zero or more dimensions of a full-dimension indexer sequence.
NewAxis: Corresponds to the addition of a new dimension.
Slice: Corresponds to a slice over a single dimension of a tensor.
Examples of constructing and using indexers are provided in the Ellipsis and the Slice class documentation.
Here we provide examples of indexing over tensors using indexers:
// 't' is a tensor (i.e., Output) with shape [4, 2, 3, 8]
t(::, ::, 1, ::) // Tensor with shape [4, 2, 1, 8]
t(1 :: -2, ---, 2) // Tensor with shape [1, 2, 3, 1]
t(---) // Tensor with shape [4, 2, 3, 8]
t(1 :: -2, ---, NewAxis, 2) // Tensor with shape [1, 2, 3, 1, 1]
t(1 ::, ---, NewAxis, 2) // Tensor with shape [3, 2, 3, 1, 1]
where --- corresponds to an ellipsis.
Note that each indexing sequence is only allowed to contain at most one Ellipsis. Furthermore, if an ellipsis is
not provided, then one is implicitly appended at the end of indexing sequence. For example, foo(2 :: 4) is
equivalent to foo(2 :: 4, ---).
Represents an indexer object. Indexers are used to index tensors.
An indexer can be one of:
Examples of constructing and using indexers are provided in the Ellipsis and the Slice class documentation. Here we provide examples of indexing over tensors using indexers:
where
---
corresponds to an ellipsis.Note that each indexing sequence is only allowed to contain at most one Ellipsis. Furthermore, if an ellipsis is not provided, then one is implicitly appended at the end of indexing sequence. For example,
foo(2 :: 4)
is equivalent tofoo(2 :: 4, ---)
.TODO: Add more usage examples.