-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
【Hackathon 4 No.14】Add Polar to paddle #50901
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
我观察 CI 发现 paddle.multiply API 在计算 float64 和 complex128 做乘法的时候报错了,CI 中是编译的 develop 版本,但是我用 release 的 windows 版本的 paddlepaddle 2.3.2 在本地是可以执行这个操作的,这个报错是正常的么? @iclementine |
在静态图运行模式下,有这样严格的类型限制,应该是设计如此的。所以还是加一个 cast 吧。 |
cast 只能在 def polar(abs, angle, name=None):
"""
.....
"""
check_variable_and_dtype(abs, 'abs', ['float32', 'float64'], 'paddle.polar')
check_variable_and_dtype(
angle, 'angle', ['float32', 'float64'], 'paddle.polar'
)
return paddle.complex(abs * paddle.cos(angle), abs * paddle.sin(angle)) 按照如此可避免 dtype 不相同的问题,并且保证类型严格一致,float to complex 的类型变换只会在 |
代码已修改,辛苦 review。 @iclementine |
rfc document link and Chinese document link need to be given in description. |
okay, I have updated doc links in the description. |
rfc doc here: PaddlePaddle/community#364 |
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
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
cfd3640
PR types
New features
PR changes
APIs
Describe
added polar API to paddle
rfc doc here: PaddlePaddle/community#364
Chinese doc here: PaddlePaddle/docs#5639