Skip to content

add API paddle.linalg.lu/lu_unpack #38419

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

add API paddle.linalg.lu/lu_unpack #38419

wants to merge 1 commit into from

Conversation

zhiboniu
Copy link
Contributor

@zhiboniu zhiboniu commented Dec 24, 2021

PR types

New features

PR changes

APIs

Describe

add API paddle.linalg.lu

拆成三个小的子pr合入:
lu_op正向:
#38559

lu_op反向:
#38616

lu API/lu_unpack op/API:
#38617

        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]]))
        '''

image
image

image

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@zhiboniu zhiboniu changed the title add API paddle.linalg.lu add API paddle.linalg.lu/lu_unpack Dec 27, 2021
Copy link
Contributor

@TCChenlong TCChenlong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@paddle-bot-old
Copy link

paddle-bot-old bot commented Jan 5, 2022

Sorry to inform you that 28309c9's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants