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】No.贰〇 add complex support for tanhshrink #56277

Closed
wants to merge 17 commits into from

Conversation

Liyulingyue
Copy link
Contributor

@Liyulingyue Liyulingyue commented Aug 14, 2023

PR types

New features

PR changes

OPs

Description

suppot complex for tanhshrink, without changing in python/paddle/tensor/ops.py and test/legacy_test/test_activation_op.py

#56145

@paddle-bot
Copy link

paddle-bot bot commented Aug 14, 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 Aug 14, 2023
@Liyulingyue Liyulingyue changed the title add tanhshrink in complex.h 【complex op】No.xxx add complex support for tanhshrink Aug 14, 2023
@Liyulingyue Liyulingyue changed the title 【complex op】No.xxx add complex support for tanhshrink 【complex op】No.贰〇 add complex support for tanhshrink Aug 14, 2023
@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Aug 15, 2023
Copy link
Contributor

@ScottWong98 ScottWong98 left a comment

Choose a reason for hiding this comment

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

Maybe we should add testing cases for complex data type

@Liyulingyue
Copy link
Contributor Author

Maybe we should add testing cases for complex data type

got it~

self.x_np = np.random.uniform(10, 20, [10, 17]).astype(
np.float64
) + 1j * np.random.uniform(10, 20, [10, 17]).astype(np.float64)
self.place = (
Copy link
Contributor

Choose a reason for hiding this comment

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

self.placeTestTanhshrinkComplex 中应该是没有用到的

@@ -967,6 +967,40 @@ def test_errors(self):
F.tanhshrink(x_fp16)


class TestTanhshrinkComplex(unittest.TestCase):
Copy link
Contributor

Choose a reason for hiding this comment

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

建议添加一个继承 TestTanhshrink 类的 Case

else paddle.CPUPlace()
)

def test_complex64(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

def test_complex64def test_complex128 应该都没有在 GPU 上进行测试吧

@@ -1642,6 +1642,24 @@ struct TanhShrinkGradFunctor : public BaseActivationFunctor<T> {
static constexpr ActBwdOpFwdDeps FwdDeps() { return ActBwdOpFwdDeps::kDepX; }
};

template <typename T>
struct TanhShrinkGradFunctor<ComplexType<T>>
Copy link
Contributor

Choose a reason for hiding this comment

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

TanhShrinkGradFunctor 只针对 CPU,还需要补充 CudaTanhShrinkGradFunctor 下的 complex 类型

@paddle-ci-bot
Copy link

paddle-ci-bot bot commented Sep 5, 2023

Sorry to inform you that 42b21f3's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually.

@luotao1 luotao1 added HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务 and removed HappyOpenSource 快乐开源活动issue与PR labels Sep 6, 2023
@Liyulingyue Liyulingyue deleted the tanhshrink branch January 15, 2024 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants