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

support kldiv_loss/kldiv_loss_grad for kunlun #47638

Merged
merged 1 commit into from
Nov 7, 2022

Conversation

QingshuChen
Copy link
Contributor

@QingshuChen QingshuChen commented Nov 3, 2022

PR types

Others

PR changes

Others

Describe

support kldiv_loss/kldiv_loss_grad for kunlun.

@paddle-bot
Copy link

paddle-bot bot commented Nov 3, 2022

你的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.

@PaddlePaddle PaddlePaddle locked and limited conversation to collaborators Nov 7, 2022
@PaddlePaddle PaddlePaddle unlocked this conversation Nov 7, 2022
@@ -0,0 +1,147 @@
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Copy link
Contributor

Choose a reason for hiding this comment

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

改成 2022 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK

def setUp(self):
self.initTestCase()
self.op_type = 'kldiv_loss'
self.dtype = np.float32
Copy link
Contributor

Choose a reason for hiding this comment

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

使用 self.dtype = self.in_type 代替吧,方便op后续支持其他数据类型。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK

self.dtype = np.float32
self.__class__.use_xpu = True
self.python_api = kl_div
x = np.random.uniform(-10, 10, self.x_shape).astype('float32')
Copy link
Contributor

Choose a reason for hiding this comment

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

使用 .astype(self.dtype),下同。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK

@houj04 houj04 merged commit 5f0a8ad into PaddlePaddle:develop Nov 7, 2022
@paddle-bot
Copy link

paddle-bot bot commented Nov 7, 2022

你的PR已合入Paddle库,请关注后续测试结果。
Your PR has been merged into the repository. An official integration test will be conducted later. Stay tuned.

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.

4 participants