def lu_unpack(x, y, unpack_ludata=True, unpack_pivots=True, name=None):
    "\n    Unpack L U and P to single matrix tensor . \n    unpack L and U matrix from LU, unpack permutation matrix P from Pivtos .\n\n    P mat can be get by pivots:\n    # ones = eye(rows) #eye matrix of rank rows\n    # for i in range(cols):\n    #     swap(ones[i], ones[pivots[i]])\n\n\n    Args:\n        x (Tensor): The LU tensor get from paddle.linalg.lu, which is combined by L and U.\n\n        y (Tensor): Pivots get from paddle.linalg.lu.\n\n        unpack_ludata (bool,optional): whether to unpack L and U from x. Default: True.\n\n        unpack_pivots (bool, optional): whether to unpack permutation matrix P from Pivtos. Default: True.\n\n        name (str, optional): Name for the operation (optional, default is None).\n            For more information, please refer to :ref:`api_guide_Name`.\n            \n    Returns:\n        P (Tensor): Permutation matrix P of lu factorization.\n\n        L (Tensor): The lower triangular matrix tensor of lu factorization.\n\n        U (Tensor): The upper triangular matrix tensor of lu factorization.\n\n        \n    Examples:            \n        .. code-block:: python\n\n            import paddle \n\n            x = paddle.to_tensor([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]]).astype('float64')\n            lu,p,info = paddle.linalg.lu(x, get_infos=True)\n\n            # >>> lu:\n            # Tensor(shape=[3, 2], dtype=float64, place=CUDAPlace(0), stop_gradient=True,\n            #    [[5.        , 6.        ],\n            #        [0.20000000, 0.80000000],\n            #        [0.60000000, 0.50000000]])\n            # >>> p\n            # Tensor(shape=[2], dtype=int32, place=CUDAPlace(0), stop_gradient=True,\n            #    [3, 3])\n            # >>> info\n            # Tensor(shape=[], dtype=int32, place=CUDAPlace(0), stop_gradient=True,\n            #    0)\n            \n            P,L,U = paddle.linalg.lu_unpack(lu,p)\n\n            # >>> P\n            # (Tensor(shape=[3, 3], dtype=float64, place=CUDAPlace(0), stop_gradient=True,\n            # [[0., 1., 0.],\n            # [0., 0., 1.],\n            # [1., 0., 0.]]), \n            # >>> L\n            # Tensor(shape=[3, 2], dtype=float64, place=CUDAPlace(0), stop_gradient=True,\n            # [[1.        , 0.        ],\n            # [0.20000000, 1.        ],\n            # [0.60000000, 0.50000000]]), \n            # >>> U\n            # Tensor(shape=[2, 2], dtype=float64, place=CUDAPlace(0), stop_gradient=True,\n            # [[5.        , 6.        ],\n            # [0.        , 0.80000000]]))\n\n            # one can verify : X = P @ L @ U ;   \n    "
    if paddle.in_dynamic_mode():
        (P, L, U) = _C_ops.lu_unpack(x, y, 'unpack_ludata', unpack_ludata, 'unpack_pivots', unpack_pivots)
        return (P, L, U)
    check_variable_and_dtype(x, 'dtype', ['float32', 'float64'], 'lu_unpack')
    helper = LayerHelper('lu_unpack', **locals())
    p = helper.create_variable_for_type_inference(dtype=x.dtype)
    l = helper.create_variable_for_type_inference(dtype=x.dtype)
    u = helper.create_variable_for_type_inference(dtype=x.dtype)
    attrs = dict()
    attrs['unpack_ludata'] = unpack_ludata
    attrs['unpack_pivots'] = unpack_pivots
    helper.append_op(type='lu_unpack', inputs={'X': x, 'Pivots': y}, outputs={'Pmat': p, 'L': l, 'U': u}, attrs=attrs)
    return (p, l, u)
Unpack L U and P to single matrix tensor . 
unpack L and U matrix from LU, unpack permutation matrix P from Pivtos .

P mat can be get by pivots:
# ones = eye(rows) #eye matrix of rank rows
# for i in range(cols):
#     swap(ones[i], ones[pivots[i]])


Args:
    x (Tensor): The LU tensor get from paddle.linalg.lu, which is combined by L and U.

    y (Tensor): Pivots get from paddle.linalg.lu.

    unpack_ludata (bool,optional): whether to unpack L and U from x. Default: True.

    unpack_pivots (bool, optional): whether to unpack permutation matrix P from Pivtos. Default: True.

    name (str, optional): Name for the operation (optional, default is None).
        For more information, please refer to :ref:`api_guide_Name`.
        
Returns:
    P (Tensor): Permutation matrix P of lu factorization.

    L (Tensor): The lower triangular matrix tensor of lu factorization.

    U (Tensor): The upper triangular matrix tensor of lu factorization.

    
Examples:            
    .. code-block:: python

        import paddle 

        x = paddle.to_tensor([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]]).astype('float64')
        lu,p,info = paddle.linalg.lu(x, get_infos=True)

        # >>> lu:
        # Tensor(shape=[3, 2], dtype=float64, place=CUDAPlace(0), stop_gradient=True,
        #    [[5.        , 6.        ],
        #        [0.20000000, 0.80000000],
        #        [0.60000000, 0.50000000]])
        # >>> p
        # Tensor(shape=[2], dtype=int32, place=CUDAPlace(0), stop_gradient=True,
        #    [3, 3])
        # >>> info
        # Tensor(shape=[], dtype=int32, place=CUDAPlace(0), stop_gradient=True,
        #    0)
        
        P,L,U = paddle.linalg.lu_unpack(lu,p)

        # >>> P
        # (Tensor(shape=[3, 3], dtype=float64, place=CUDAPlace(0), stop_gradient=True,
        # [[0., 1., 0.],
        # [0., 0., 1.],
        # [1., 0., 0.]]), 
        # >>> L
        # Tensor(shape=[3, 2], dtype=float64, place=CUDAPlace(0), stop_gradient=True,
        # [[1.        , 0.        ],
        # [0.20000000, 1.        ],
        # [0.60000000, 0.50000000]]), 
        # >>> U
        # Tensor(shape=[2, 2], dtype=float64, place=CUDAPlace(0), stop_gradient=True,
        # [[5.        , 6.        ],
        # [0.        , 0.80000000]]))

        # one can verify : X = P @ L @ U ;
def lu_unpack(x, y, unpack_ludata=True, unpack_pivots=True, name=None):
    "\n    Unpack L U and P to single matrix tensor . \n    unpack L and U matrix from LU, unpack permutation matrix P from Pivtos .\n\n    P mat can be get by pivots:\n    # ones = eye(rows) #eye matrix of rank rows\n    # for i in range(cols):\n    #     swap(ones[i], ones[pivots[i]])\n\n\n    Args:\n        x (Tensor): The LU tensor get from paddle.linalg.lu, which is combined by L and U.\n\n        y (Tensor): Pivots get from paddle.linalg.lu.\n\n        unpack_ludata (bool,optional): whether to unpack L and U from x. Default: True.\n\n        unpack_pivots (bool, optional): whether to unpack permutation matrix P from Pivtos. Default: True.\n\n        name (str, optional): Name for the operation (optional, default is None).\n            For more information, please refer to :ref:`api_guide_Name`.\n            \n    Returns:\n        P (Tensor): Permutation matrix P of lu factorization.\n\n        L (Tensor): The lower triangular matrix tensor of lu factorization.\n\n        U (Tensor): The upper triangular matrix tensor of lu factorization.\n\n        \n    Examples:            \n        .. code-block:: python\n\n            import paddle \n\n            x = paddle.to_tensor([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]]).astype('float64')\n            lu,p,info = paddle.linalg.lu(x, get_infos=True)\n\n            # >>> lu:\n            # Tensor(shape=[3, 2], dtype=float64, place=CUDAPlace(0), stop_gradient=True,\n            #    [[5.        , 6.        ],\n            #        [0.20000000, 0.80000000],\n            #        [0.60000000, 0.50000000]])\n            # >>> p\n            # Tensor(shape=[2], dtype=int32, place=CUDAPlace(0), stop_gradient=True,\n            #    [3, 3])\n            # >>> info\n            # Tensor(shape=[], dtype=int32, place=CUDAPlace(0), stop_gradient=True,\n            #    0)\n            \n            P,L,U = paddle.linalg.lu_unpack(lu,p)\n\n            # >>> P\n            # (Tensor(shape=[3, 3], dtype=float64, place=CUDAPlace(0), stop_gradient=True,\n            # [[0., 1., 0.],\n            # [0., 0., 1.],\n            # [1., 0., 0.]]), \n            # >>> L\n            # Tensor(shape=[3, 2], dtype=float64, place=CUDAPlace(0), stop_gradient=True,\n            # [[1.        , 0.        ],\n            # [0.20000000, 1.        ],\n            # [0.60000000, 0.50000000]]), \n            # >>> U\n            # Tensor(shape=[2, 2], dtype=float64, place=CUDAPlace(0), stop_gradient=True,\n            # [[5.        , 6.        ],\n            # [0.        , 0.80000000]]))\n\n            # one can verify : X = P @ L @ U ;   \n    "
    if paddle.in_dynamic_mode():
        (P, L, U) = _C_ops.lu_unpack(x, y, 'unpack_ludata', unpack_ludata, 'unpack_pivots', unpack_pivots)
        return (P, L, U)
    check_variable_and_dtype(x, 'dtype', ['float32', 'float64'], 'lu_unpack')
    helper = LayerHelper('lu_unpack', **locals())
    p = helper.create_variable_for_type_inference(dtype=x.dtype)
    l = helper.create_variable_for_type_inference(dtype=x.dtype)
    u = helper.create_variable_for_type_inference(dtype=x.dtype)
    attrs = dict()
    attrs['unpack_ludata'] = unpack_ludata
    attrs['unpack_pivots'] = unpack_pivots
    helper.append_op(type='lu_unpack', inputs={'X': x, 'Pivots': y}, outputs={'Pmat': p, 'L': l, 'U': u}, attrs=attrs)
    return (p, l, u)