Skip to content

Conversation

@zhiboniu
Copy link
Contributor

@zhiboniu zhiboniu commented Dec 15, 2021

PR types

New features

PR changes

APIs

Describe

Add new API cholesky_solve

import paddle import numpy as np u = paddle.to_tensor([[1, 1, 1], ​ [0, 2, 1], ​ [0, 0,-1]], dtype="float64") b = paddle.to_tensor([[0], [-9], [5]], dtype="float64") out = paddle.linalg.cholesky_solve(b, u, upper=True) Tensor(shape=[3, 1], dtype=float64, place=CUDAPlace(0), stop_gradient=True, ​ [[-2.50000000], ​ [-7. ], ​ [ 9.50000000]]) 

备注:
修改op 反向测试精度原因:
线性代数相关API,反向实现通常由各种矩阵操作组合,这些操作依赖paddle底层Tensor操作,通常与numpy实现误差达不到1e-5的要求,这是线性代数共性问题。

@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

@jeff41404 jeff41404 Dec 21, 2021

Choose a reason for hiding this comment

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

shall we also support cusolver_potrs<platform::complex<float>> and cusolver_potrs<platform::complex<double>>?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

用于boardcast 输入Tensor的TensorExpand操作暂不支持复数,所以先不注册复数类型。底层代码逻辑实现考虑了复数情况。

Comment on lines +164 to +165
Copy link
Contributor

@jeff41404 jeff41404 Dec 21, 2021

Choose a reason for hiding this comment

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

register kernel of platform::complex<float> and platform::complex<double> ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

用于boardcast 输入Tensor的TensorExpand操作暂不支持复数,所以先不注册复数类型。底层代码逻辑实现考虑了复数情况。

Comment on lines +169 to +170
Copy link
Contributor

Choose a reason for hiding this comment

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

register kernel of platform::complex<float> and platform::complex<double> ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

用于boardcast 输入Tensor的TensorExpand操作暂不支持复数,所以先不注册复数类型。底层代码逻辑实现考虑了复数情况。

lanxianghit
lanxianghit previously approved these changes Dec 21, 2021
jeff41404
jeff41404 previously approved these changes Dec 21, 2021
Copy link
Contributor

@jeff41404 jeff41404 left a comment

Choose a reason for hiding this comment

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

LGTM

XiaoguangHu01
XiaoguangHu01 previously approved these changes Dec 22, 2021
Copy link
Contributor

@XiaoguangHu01 XiaoguangHu01 left a comment

Choose a reason for hiding this comment

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

LG API

Copy link
Contributor

Choose a reason for hiding this comment

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

numpy 没用到。

Copy link
Contributor

Choose a reason for hiding this comment

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

should be不对吧?这是返回的tensor。

Copy link
Contributor

@jzhang533 jzhang533 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

@XiaoguangHu01 XiaoguangHu01 left a comment

Choose a reason for hiding this comment

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

LG API

Copy link
Contributor

@Xreki Xreki 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 the change of max_relative_error

@jeff41404 jeff41404 merged commit 39f7c41 into PaddlePaddle:develop Dec 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

7 participants