mindspore.ops.cat
- mindspore.ops.cat(tensors, axis=0)[source]
Connect input tensors along with the given axis.
- Parameters
- Returns
Tensor
- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> import mindspore >>> input_x1 = mindspore.tensor([[0, 1], [2, 1]], mindspore.float32) >>> input_x2 = mindspore.tensor([[0, 1], [2, 1]], mindspore.float32) >>> output = mindspore.ops.cat((input_x1, input_x2)) >>> print(output) [[0. 1.] [2. 1.] [0. 1.] [2. 1.]] >>> output = mindspore.ops.cat((input_x1, input_x2), 1) >>> print(output) [[0. 1. 0. 1.] [2. 1. 2. 1.]]