Stacks 1-D tensors as columns into a 2-D tensor. 2-D tensors are stacked as-is, like np.hstack.
tup (Union[Tensor, tuple, list]) – A sequence of 1-D or 2-D tensors. All of them must have the same shape except the axis to be concatenated.
2-D Tensor, formed by stacking the given tensors.
- Supported Platforms:
TypeError – If tup is not Tensor, list or tuple.
ValueError – If tup is empty.
>>> import mindspore.numpy as np >>> x1 = np.array([1, 2, 3]).astype('int32') >>> x2 = np.array([4, 5, 6]).astype('int32') >>> output = np.column_stack((x1, x2)) >>> print(output) [[1 4] [2 5] [3 6]]