Notes: The Op only receives LoDTensor as input. If your input is Tensor, please use concat Op.(fluid.layers. concat ).
This operator only supports LoDTensor as input. It concatenates the multiple LoDTensor from input by the LoD information, and outputs the concatenated LoDTensor.
input is a list of LoDTensor: input = [x1, x2] where: x1.lod = [[0, 3, 5]] x1.data = [, , , , ] x1.shape = [5, 1] x2.lod = [[0, 2, 4]] x2.data = [, , , ] x2.shape = [4, 1] and should satisfy: len(x1.lod) == len(x2.lod) output is LoDTensor: out.lod = [[0, 3+2, 5+4]] out.data = [, , , , , , , , ] out.shape = [9, 1]
input (list of Variable) – List of LoDTensor to be concatenated. The length of each LoDTensor should be same. The data type can be float32, float64 or int64.
name (str, optional) – The default value is None. Normally there is no need for user to set this property. For more information, please refer to Name .
Output the concatenated LoDTensor. The data type is same as input.
- Return type
import paddle.fluid as fluid x = fluid.data(name='x', shape=[-1, 10], dtype='float32', lod_level=1) y = fluid.data(name='y', shape=[-1, 10], dtype='float32', lod_level=1) out = fluid.layers.sequence_concat(input=[x, y])