mindspore.numpy.concatenate
- mindspore.numpy.concatenate(arrays, axis=0)[源代码]
Joins a sequence of tensors along an existing axis.
Note
To match Numpy behaviour, \(axis >= 32\) will not cause value error, the axis will be treated as
None
instead.- Parameters
- Returns
A tensor concatenated from a tensor or a list of tensors.
- Raises
TypeError – If input arguments have types not specified above.
ValueError – If axis is not in the range of \([-ndim, ndim-1]\), and less than 32.
- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> import mindspore.numpy as np >>> x1 = np.ones((1,2,3)) >>> x2 = np.ones((1,2,1)) >>> x = np.concatenate((x1, x2), axis=-1) >>> print(x.shape) (1, 2, 4)