fill_diagonal op fix border cross caused by offset#36212
Merged
jeff41404 merged 1 commit intoPaddlePaddle:developfrom Oct 9, 2021
zhiboniu:develop_fill_diagonal_fix
Merged
fill_diagonal op fix border cross caused by offset#36212jeff41404 merged 1 commit intoPaddlePaddle:developfrom zhiboniu:develop_fill_diagonal_fix
jeff41404 merged 1 commit intoPaddlePaddle:developfrom
zhiboniu:develop_fill_diagonal_fix
Conversation
|
Thanks for your contribution! |
jeff41404
reviewed
Oct 8, 2021
Comment on lines
112
to
117
Contributor
There was a problem hiding this comment.
suggest adding a annotation to explain this if statement
jeff41404
reviewed
Oct 8, 2021
Comment on lines
30
to
35
Contributor
There was a problem hiding this comment.
suggest adding a annotation to explain this if statement
Contributor
|
and it would be better to add a unittest to cover this case |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR types
Bug fixes
PR changes
OPs
Describe
fill_diagonal op fix border cross caused by offset
原来的方式offset非0时修改值会出现跨行的问题,
本次修复添加行位置越界判断,避免了这类问题。
修复前:

x.fill_diagonal_(1,offset=2)
修改了(0,2)、(2,0)两个位置,其中(2,0)由(1,1)右移2(offset值)导致。
修复后:

x.fill_diagonal_(4,offset=2)
只修改了(0,2)位置