paddle.fluid.contrib.layers.nn. partial_concat ( input, start_index=0, length=- 1 ) [source]

Partial Concat This OP concatenates the inputs according to the start index and length. This OP exists in contrib, which means that it is not shown to the public. Only 2-D Tensor or LodTensor input is supported. Slice and concat can only be performed along the second dimension.

    x = [[0, 1, 2],
         [3, 4, 5]]
    y = [[6, 7 ,8],
         [9, 10, 11]]
    output = partial_concat([x, y], start_index=0, length=2)

  we get:

    output = [[0, 1, 6, 7],
              [3, 4, 9, 10]]
  • input (list) – List of input Tensors with data type float32, float64, int32, int64.

  • start_index (int32) – The start index of each instance for partial concatenation. Default is 0.

  • length (int32) – The length of each instance for partial concatenation. Default is -1. Negative values for all elements after start_index.


A Tensor with the same data type as input’s.

Return type



System Message: ERROR/3 (/usr/local/lib/python3.8/site-packages/paddle/fluid/contrib/layers/ of paddle.fluid.contrib.layers.nn.partial_concat, line 36)

Error in “code-block” directive: maximum 1 argument(s) allowed, 22 supplied.

.. code-block:: python
    import paddle.fluid as fluid
    x ="x", shape=[None,3], dtype="float32")
    y ="y", shape=[None,3], dtype="float32")
    concat = fluid.contrib.layers.partial_concat(
        [x, y], start_index=0, length=2)