mindspore.ops.unstack

View Source On Gitee
mindspore.ops.unstack(input_x, axis=0)[source]

Unstack the input tensor along the specified axis.

Parameters
  • input_x (Tensor) – The input tensor.

  • axis (int) – The specified axis. Default 0 .

Returns

Tuple of tensors

Supported Platforms:

Ascend GPU CPU

Examples

>>> import mindspore
>>> input = mindspore.tensor([[1, 1, 1, 1], [2, 2, 2, 2]])
>>> mindspore.ops.unstack(input, 0)
(Tensor(shape=[4], dtype=Int64, value= [1, 1, 1, 1]),
 Tensor(shape=[4], dtype=Int64, value= [2, 2, 2, 2]))