Skip to content
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

[Cherry-Pick]Add paddle.linalg.solve OP (#35715) #36056

Merged

Conversation

veyron95
Copy link
Contributor

PR types

New features

PR changes

OPs

Describe

This PR supports linalg.solve calculation for linear algorithm module of Paddle. One may call paddle.linalg.solve to use it.

An example is listed below, which is a python3 script:

 import paddle
 import numpy as np
  
 np_x = np.array([[3, 1],[1, 2]])
 np_y = np.array([9, 8])
 x = paddle.to_tensor(np_x, dtype="float64")
 y = paddle.to_tensor(np_y, dtype="float64")
 out = paddle.linalg.solve(x, y)  
 print(out)
 # [2., 3.])  

* Add linalg.solve op, test=develop

* Fix a bug caused by accidental deletion

* updated description and fix a bug: missing a comma

* Add linalg.solve op, test=develop

* updated solve op backward logic

* updated solve op backward logic again

* Add linalg.solve Op, test=develop

* Updated and modified to fit CI requirements

* Fix a bug

* 1)Add more test cases; 2)Fix a wrong usage in reduces operation; 3)Remove redundant code

* Remove redundant comments

* 1)Removed redundant code; 2)Updated to enhance code robustness

* Removed redundant code

* Updated API documents
@paddle-bot-old
Copy link

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

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

Copy link
Contributor

@XieYunshen XieYunshen left a comment

Choose a reason for hiding this comment

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

LGTM for set_tests_properties(test_solve_op PROPERTIES TIMEOUT 120)

juncaipeng
juncaipeng approved these changes Sep 26, 2021
@lanxianghit lanxianghit merged commit 6b4f2fb into PaddlePaddle:release/2.2 Sep 26, 2021
@veyron95 veyron95 deleted the branch_add_linalg_solve_op branch November 12, 2021 03:49
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.

6 participants