class mindspore.ops.ParallelConcat[source]

Concats tensor in the first dimension.

Concats input tensors along with the first dimension.

The difference between Concat and ParallelConcat is that Concat requires all of the inputs be computed before the operation will begin but doesn’t require that the input shapes be known during graph construction. Parallel concat will copy pieces of the input into the output as they become available, in some situations this can provide a performance benefit.


The input tensors are all required to have size 1 in the first dimension.

  • values (tuple, list) - A tuple or a list of input tensors. The data type and shape of these tensors must be the same. The data type is Number except float64.


Tensor, data type is the same as values.

  • ValueError – If length of shape of values is less than 1.

  • ValueError – The data type and shape of these tensors are not the same.

Supported Platforms:



>>> data1 = Tensor(np.array([[0, 1]]).astype(np.int32))
>>> data2 = Tensor(np.array([[2, 1]]).astype(np.int32))
>>> op = ops.ParallelConcat()
>>> output = op((data1, data2))
>>> print(output)
[[0 1]
 [2 1]]