-
Notifications
You must be signed in to change notification settings - Fork 5.9k
[0-size Tensor No.106、115] Add 0-size Tensor support for slogdet/det #73125
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
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
|
@DanielSun11 CI已完成请review |
DanielSun11
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议修改shape推导的部分。除此之外,单测还需要添加[*,M,M]中 M = 0的case。
| dev_ctx.template Alloc<T>(out); | ||
| return; | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不建议在kernel中重新进行shape推导和Resize操作。如果可以请修改到infermeta中以及同步修改到符号推导中。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| return; | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
和paddle/phi/kernels/gpu/slogdeterminant_kernel.cu中的修改同理。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
原kernel是在结尾做的Resize,如果修改到infermeta,需要kernel都修改,改动较多
已增加单测 |
DanielSun11
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM

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都有错误
