tensor.slice
Produces a slice of the input tensor along multiple axes.
Args
self
(@Tensor<T>
) - Tensor of data to extract slices from.starts
(Span) - 1-D tensor of starting indices of corresponding axis inaxes
ends
(Span) - 1-D tensor of ending indices (exclusive) of corresponding axis inaxes
axes
(Option<Span>) - 1-D tensor of axes thatstarts
andends
apply to.steps
(Option<Span>) - 1-D tensor of slice step of corresponding axis inaxes
.
Panics
Panics if the length of starts is not equal to the length of ends.
Panics if the length of starts is not equal to the length of axes.
Panics if the length of starts is not equal to the length of steps.
Returns
A new Tensor<T>
slice of the input tensor.
Example
Last updated