mindspore.ops.chunk
- mindspore.ops.chunk(input, chunks, axis=0)[source]
Split the input tensor into multiple sub-tensors along the specified axis.
Note
This function may return less than the specified number of chunks!
- Parameters
- Returns
Tuple of tensors.
- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> import mindspore >>> input = mindspore.ops.arange(0, 9, dtype=mindspore.float32) >>> output = mindspore.ops.chunk(input, 3) >>> print(output) (Tensor(shape=[3], dtype=Float32, value= [ 0.00000000e+00, 1.00000000e+00, 2.00000000e+00]), Tensor(shape=[3], dtype=Float32, value= [ 3.00000000e+00, 4.00000000e+00, 5.00000000e+00]), Tensor(shape=[3], dtype=Float32, value= [ 6.00000000e+00, 7.00000000e+00, 8.00000000e+00]))