ivy.split(x: ivy.NativeArray, num_or_size_splits: Optional[Union[int, List[int]]] = None, axis: int = 0, with_remainder: bool = False, f: Optional[ivy.Framework] = None) → ivy.NativeArray[source]

Splits an array into multiple sub-arrays.

  • x (array) – Tensor to be divided into sub-arrays.

  • num_or_size_splits (int, optional) – Number of equal arrays to divide the array into along the given axis if an integer. The size of each split element if a sequence of integers. Default is to divide into as many 1-dimensional arrays as the axis dimension.

  • axis (int, optional) – The axis along which to split, default is 0.

  • with_remainder (bool, optional) – If the tensor does not split evenly, then store the last remainder entry. Defaul is False.

  • f (ml_framework, optional) – Machine learning framework. Inferred from inputs if None.


A list of sub-arrays.

Supported Frameworks:

empty jax_logo empty tf_logo empty pytorch_logo empty mxnet_logo empty numpy_logo empty