Tensorflow.js tf.split() Function
The tf.split() function is used to split a tf.tensors into sub tensors.
tf.split (x, numOrSizeSplits, axis?)
- x: The input tensor to split.
- numOrSizeSplits: It can be a number indicating the number of splits or can be the array in which sizes are provided for each output tensor
- axis: It is an axis of the dimension along which to split.
Return Value: It returns tf.Tensor.
Tensor [[10, 20], [30, 40]] Tensor [[50, 60], [70, 80]]
Example 2: In this example, making the split with axis as the 2nd parameter as an array.
Tensor [, ] Tensor [[30, 50], [40, 60]] Tensor [, ]