You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* The goal of this op is to produce a new tensor with a subset of
5957
-
* the elements from the `n` dimensional `input` tensor. The subset is chosen using
5958
-
* a sequence of `m` sparse range specifications encoded into the arguments
5959
-
* of this function. Note, in some cases
5960
-
* `m` could be equal to `n`, but this need not be the case. Each
5961
-
* range specification entry can be one of the following:
5962
-
* <p>
5963
-
* - An ellipsis (...) using {@link Index#ellipses()}. Ellipses are used to imply zero or more
5964
-
* dimensions of full-dimension selection and are produced using
5965
-
* `ellipsis_mask`. For example, `foo[...]` is the identity slice.
5966
-
* <p>
5967
-
* - A new axis using {@link Index#newAxis()}. This is used to insert a new shape=1 dimension and is
5968
-
* produced using `new_axis_mask`. For example, `foo[:, ...]` where
5969
-
* `foo` is shape `(3, 4)` produces a `(1, 3, 4)` tensor.
5970
-
* <p>
5971
-
* - A range `begin:end:stride` using {@link Index#slice(Singular, Singular, int) Index.slice()} or {@link Index#all()}. This is used to specify how much to choose from
5972
-
* a given dimension. `stride` can be any integer but 0. `begin` is an integer
5973
-
* which represents the index of the first value to select while `end` represents
5974
-
* the index of the last value to select. The number of values selected in each
5975
-
* dimension is `end - begin` if `stride > 0` and `begin - end` if `stride < 0`.
5976
-
* `begin` and `end` can be negative where `-1` is the last element, `-2` is
5977
-
* the second to last. `begin_mask` controls whether to replace the explicitly
5978
-
* given `begin` with an implicit effective value of `0` if `stride > 0` and
5979
-
* `-1` if `stride < 0`. `end_mask` is analogous but produces the number
5980
-
* required to create the largest open interval. For example, given a shape
5981
-
* `(3,)` tensor `foo[:]`, the effective `begin` and `end` are `0` and `3`. Do
5982
-
* not assume this is equivalent to `foo[0:-1]` which has an effective `begin`
5983
-
* and `end` of `0` and `2`. Another example is `foo[-2::-1]` which reverses the
5984
-
* first dimension of a tensor while dropping the last two (in the original
5985
-
* order elements). For example `foo = [1,2,3,4]; foo[-2::-1]` is `[4,3]`.
5986
-
* <p>
5987
-
* - A single index using {@link Index#point(int)}. This is used to keep only elements that have a given
5988
-
* index. For example (`foo[2, :]` on a shape `(5,6)` tensor produces a
5989
-
* shape `(6,)` tensor. This is encoded in `begin` and `end` and
5990
-
* `shrink_axis_mask`.
5991
-
* <p>
5992
-
*
5993
-
* <i>Requirements</i>:
5994
-
* `0 != strides[i] for i in [0, m)`
5995
-
* Only one ellipsis.
5996
-
*
5997
-
* @param scope current scope
5998
-
* @param <T> data type for {@code output()} output
5999
-
* @param input
6000
-
* @param indices The indices to slice. See {@link Index}.
6001
-
* @return a new instance of StridedSlice
6002
-
* @see Index
6003
-
*/
6004
-
public <TextendsTType> StridedSlice<T> stridedSlice(Operand<T> input, Index... indices) {
0 commit comments