Tensorflow.js tf.slice() Function
The tf.slice() function is used to extract a slice from tf.Tensor starting at coordinates ‘begin’ and is of size ‘size’.
tf.slice (x, begin, size?)
- x: the input tensor to slice form.
- begin: the coordinates to start the slice from.
- size: the size of the slice
Return Value: It returns tf.Tensor.
Tensor [1, 2, 3, 4]