next up previous contents
Next: Size Up: Tensor operations Previous: Merge   Contents

Slice

\includegraphics[height=10mm]{images/slice}% WIDTH=48 HEIGHT=45

The operator can be placed on the canvas in two ways:

Slice will cut off a tensor along a given axis by the argument, as configured in the operation edit dialog. For example $\mathrm{slice}(\{x_{1},x_{2},\ldots x_{n}\},3)=\{x_{1},x_{2},x_{3}\}$% WIDTH=536 HEIGHT=34 . If the tensor is rank one (ie a vector), it is not necessary to specify the axis.

If the slice argument is negative, then it refers to the number of elements from the end of that axis. For example $\mathrm{slice}(\{x_{1},x_{2},\ldots x_{n}\},-3)=\{x_{n-2},x_{n-1},x_{n}\}$% WIDTH=639 HEIGHT=34 .