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

Fix a bug when reduce_num = 1 in Reduce Op #38771

Merged
merged 3 commits into from
Jan 7, 2022

Conversation

AnnaTrainingG
Copy link
Contributor

PR types

Bug fixes

PR changes

OPs

Describe

Fix a bug when reduce_num = 1 in Reduce Op, replace copy and cast kernel with elementwise kernel in reduce.h

问题场景:
当reduce_num = 1 时, 直接将输入数据给输出数据,导致 transform(x) != x 时依旧返回X。
例如transform操作为(exp(x)) 操作,当reduce_num = 1时,正确的返回结果应该为 exp(x), 但是原计算依旧返回的是 X, 从而计算错误。

@paddle-bot-old
Copy link

paddle-bot-old bot commented Jan 6, 2022

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

GuoxiaWang
GuoxiaWang previously approved these changes Jan 7, 2022
Copy link
Contributor

@GuoxiaWang GuoxiaWang left a comment

Choose a reason for hiding this comment

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

LGTM

ZzSean
ZzSean previously approved these changes Jan 7, 2022
Copy link
Contributor

@ZzSean ZzSean left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@GuoxiaWang GuoxiaWang left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@ZzSean ZzSean left a comment

Choose a reason for hiding this comment

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

LGTM

@AnnaTrainingG AnnaTrainingG merged commit f634c0b into PaddlePaddle:develop Jan 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants