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

【Complex op】add complex support for sin, cos, tan, tanh #55380

Merged

Conversation

ScottWong98
Copy link
Contributor

@ScottWong98 ScottWong98 commented Jul 12, 2023

PR types

New features

PR changes

OPs

Description

add complex support for sin, cos, tan, tanh.

@paddle-bot
Copy link

paddle-bot bot commented Jul 12, 2023

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot bot added contributor External developers status: proposed labels Jul 12, 2023
@ScottWong98 ScottWong98 marked this pull request as draft July 12, 2023 14:20
@ScottWong98 ScottWong98 marked this pull request as ready for review July 12, 2023 14:35
@ScottWong98 ScottWong98 changed the title 【Complex op】add complex support for tanh 【Complex op】add complex support for sin, cos, tan, tanh Jul 17, 2023
@@ -566,6 +566,16 @@ def if_enable_cinn(self):
pass


class TestTanh_Complex64(TestTanh):
def init_dytpe(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

只是改变dtype,似乎input只有实部,没有虚部(虚部都为0)

@@ -554,7 +559,8 @@ def setUp(self):
def test_check_grad(self):
if self.dtype == np.float16:
return
self.check_grad(['X'], 'Out', check_prim=True)
# TODO(ScottWong98): set `check_prim=False` when `fill_any_like` supports `complex` dtype
Copy link
Contributor

Choose a reason for hiding this comment

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

这里加个分支判断,只有complex类型的才设置check_prim=False,还有maxrelative等,不要影响正常的单测

Copy link
Contributor

@GGBond8488 GGBond8488 left a comment

Choose a reason for hiding this comment

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

LGTM

@ScottWong98
Copy link
Contributor Author

@luotao1 麻烦涛姐帮我 review 一下

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.

3 participants