megengine.functional.concat#
- concat(inps, axis=0, device=None)[源代码]#
拼接一些张量
- 参数:
- 返回类型:
- 返回:
输出张量。
实际案例
>>> import numpy as np >>> data1 = Tensor(np.arange(0, 6, dtype=np.float32).reshape((2, 3))) >>> data2 = Tensor(np.arange(6, 12, dtype=np.float32).reshape((2, 3))) >>> out = F.concat([data1, data2]) >>> out.numpy() array([[ 0., 1., 2.], [ 3., 4., 5.], [ 6., 7., 8.], [ 9., 10., 11.]], dtype=float32)