-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
【PaddlePaddle Hackathon 第四期】No.6:为 Paddle 新增 ldexp API #51395
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
请解决下冲突 |
Sorry to inform you that d182aa0's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
输出是float32或float64,不是只有float32,RFC也需要对应修改,放上例子 |
单测中需要加一下输出类型的检查 |
好的👌
好的👌 |
好的,建议对齐 |
已提交Issue:#54314 |
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
x = paddle.to_tensor([1, 2, 3], dtype='float32') | ||
y = paddle.to_tensor([2, 3, 4], dtype='int32') | ||
res = paddle.ldexp(x, y) | ||
print(res) |
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.
示例可以多举一个。比如 y = paddle.to_tensor([2],这样有broadcast的例子了
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.
已经添加好了~
python/paddle/tensor/math.py
Outdated
if x.dtype == paddle.float64 or y.dtype == paddle.float64: | ||
out_dtype = paddle.float64 | ||
else: | ||
out_dtype = paddle.float32 |
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.
it is better to use out_dtype = paddle.get_default_dtype()
?
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.
done
请解决下冲突 |
@luotao1 @jeff41404 已经修改好了,辛苦review下~ |
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
add note for code description Co-authored-by: zachary sun <70642955+sunzhongkai588@users.noreply.github.com>
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 for docs,请提供中文文档~
PR types
New features
PR changes
APIs
Description
为 Paddle 新增 ldexp API
Details
Tracking Issue: #51281
RFC: PaddlePaddle/community#407
CN-Docs: PaddlePaddle/docs#5925