-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Fix a bug when reduce_num = 1 in Reduce Op #38771
Conversation
Thanks for your contribution! |
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
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
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, 从而计算错误。