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

paddle.linalg.det and paddle.linalg.slogdet support complex 易用性提升 #499

Merged
merged 2 commits into from
Oct 24, 2024

Conversation

NKNaN
Copy link
Contributor

@NKNaN NKNaN commented Oct 22, 2024

PR Docs

PaddlePaddle/Paddle#68772
PaddlePaddle/Paddle#68390

PR APIs

torch.det
torch.slogdet
torch.logdet
torch.Tensor.det
torch.Tensor.slogdet
torch.Tensor.logdet
torch.linalg.det
torch.linalg.slogdet

@@ -3434,7 +3434,7 @@ def generate_code(self, kwargs):
API_TEMPLATE = textwrap.dedent(
"""
res = paddle.linalg.slogdet({})
res[0], res[1]
res[0], res[1].astype('float32')
Copy link
Collaborator

Choose a reason for hiding this comment

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

res[0]、res[1]是切片同一个tensor,应该是相同类型吧,这里为何需要单独cast第二个

Copy link
Contributor Author

Choose a reason for hiding this comment

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

输入是复数的时候,torch 返回的第一个 sign 是 complex 类型,第二个 logabsdet 是 float 类型(本身 logabsdet 应该是个实数)。paddle 因为把 sign 和 logabsdet 合到一起了所以都是 complex 类型。

Copy link
Collaborator

Choose a reason for hiding this comment

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

输入是复数的时候,torch 返回的第一个 sign 是 complex 类型,第二个 logabsdet 是 float 类型(本身 logabsdet 应该是个实数)。paddle 因为把 sign 和 logabsdet 合到一起了所以都是 complex 类型。

明天再rerun一下GPU CI吧,可能paddle的安装库还没有更新

Copy link
Contributor Author

Choose a reason for hiding this comment

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

好的

Copy link

paddle-bot bot commented Oct 22, 2024

Thanks for your contribution!

@paddle-bot paddle-bot bot added the contributor External developers label Oct 22, 2024
@zhwesky2010 zhwesky2010 merged commit 6ef5a8d into PaddlePaddle:master Oct 24, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants