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 trace offset out of shape #33922

Merged
merged 1 commit into from
Jul 2, 2021

Conversation

jeff41404
Copy link
Contributor

PR types

Bug fixes

PR changes

OPs

Describe

问题:paddle.trace 在参数 offset 超出维度大小时,返回结果不为0,不符合官网文档说明和预期
原因:代码中取Tensor对角线数据时,缺少 offset 超出维度大小的分支判断及相关处理
方案:增加offset 超出维度大小的分支,返回结果为0,和官网文档说明一致
效果:在CPU/CUDA上修复此问题

@paddle-bot-old
Copy link

paddle-bot-old bot commented Jul 1, 2021

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

Copy link
Contributor

@XiaoguangHu01 XiaoguangHu01 left a comment

Choose a reason for hiding this comment

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

LGTM

@XiaoguangHu01 XiaoguangHu01 merged commit b9e4aaa into PaddlePaddle:develop Jul 2, 2021
@jeff41404 jeff41404 deleted the fix_trace_outshape branch July 2, 2021 07:31
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.

2 participants