Repository navigation
[0-size Tensor No.106、115] Add 0-size Tensor support for slogdet/det - #73125
Merged
Merged
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
Contributor
Author
|
@DanielSun11 CI已完成请review |
DanielSun11
reviewed
Jun 10, 2025
DanielSun11
left a comment
Contributor
There was a problem hiding this comment.
建议修改shape推导的部分。除此之外,单测还需要添加[*,M,M]中 M = 0的case。
| dev_ctx.template Alloc<T>(out); | ||
| return; | ||
| } | ||
| } |
Contributor
There was a problem hiding this comment.
不建议在kernel中重新进行shape推导和Resize操作。如果可以请修改到infermeta中以及同步修改到符号推导中。
Contributor
Author
| return; | ||
| } | ||
| } | ||
|
|
Contributor
There was a problem hiding this comment.
和paddle/phi/kernels/gpu/slogdeterminant_kernel.cu中的修改同理。
Contributor
Author
There was a problem hiding this comment.
原kernel是在结尾做的Resize,如果修改到infermeta,需要kernel都修改,改动较多
Contributor
Author
已增加单测 |
wanghuancoder
approved these changes
Jun 11, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

PR Category
Execute Infrastructure
PR Types
Improvements
Description
[0-size Tensor No.106、115] Add 0-size Tensor support for slogdet/det
paddle.linalg.slogdet
slogdet前向返回维度是输入去掉结尾两个维度,然后在开头增加一个2,比如输入是[*, M, M] ,返回是[2, *],所以是判断*中是否包含0,并且输入的结尾两个维度需要相同,paddle和torch都有检查
反向是Alloc后return
前向GPU单独文件,其他在impl实现
infermeta没有修改
增加单测
PaddleAPITest测试,已修复cuda error问题,结尾两个维度需要相同,如果不同paddle和torch都有错误

paddle.linalg.det
前向和反向维度已设置,判断numel后Alloc返回
前向GPU单独文件,其他在impl实现
infermeta没有修改
增加单测
PaddleAPITest测试,已修复cuda error问题,结尾两个维度需要相同,如果不同paddle和torch都有错误
