mindspore.ops.unbind
- mindspore.ops.unbind(input, dim=0)[source]
Remove a tensor dimension, return a tuple of all slices along a given dimension.
- Parameters
- Returns
tuple of tensors.
- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> import mindspore >>> x = mindspore.tensor([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) >>> output = mindspore.ops.unbind(x, dim=0) >>> print(output) (Tensor(shape=[3], dtype=Int64, value=[1, 2, 3]), Tensor(shape=[3], dtype=Int64, value=[4, 5, 6]), Tensor(shape=[3], dtype=Int64, value=[7, 8, 9]))