-
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 PIR Unittest No.276,342,395,377,435,445】Fix gather_nd/tree/histogramdd UT #65799
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
b8c3b0d
[PIR]Fix gather_nd/tree/hisgoram UT
Aurelius84 551e053
fix test_gru_rnn_op
Aurelius84 bb8825b
fix linalg
Aurelius84 4aa4fe9
fix import
Aurelius84 9323b9e
fix import
Aurelius84 0012455
fix CMakeList.txt
Aurelius84 ceb58af
fix cmake
Aurelius84 b670c23
fix TypeError
Aurelius84 8bea971
Merge branch 'develop' into fix_cmake
Aurelius84 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5277,6 +5277,7 @@ def gather_nd(x: Tensor, index: Tensor, name: str | None = None) -> Tensor: | |
|
||
""" | ||
if in_dynamic_or_pir_mode(): | ||
check_dtype(index.dtype, "index", ['int32', 'int64'], 'gather_nd') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 同上 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. check_xx系列的函数实现里已经内含了跳过动态图处理的判断,相对轻量级 |
||
return _C_ops.gather_nd(x, index) | ||
else: | ||
check_variable_and_dtype( | ||
|
@@ -5292,10 +5293,10 @@ def gather_nd(x: Tensor, index: Tensor, name: str | None = None) -> Tensor: | |
'int32', | ||
'int64', | ||
], | ||
'gather_np', | ||
'gather_nd', | ||
) | ||
check_variable_and_dtype( | ||
index, 'index', ['int32', 'int64'], 'gather_np' | ||
index, 'index', ['int32', 'int64'], 'gather_nd' | ||
) | ||
helper = LayerHelper('gather_nd', **locals()) | ||
dtype = helper.input_dtype() | ||
|
This file contains 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
This file contains 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
This file contains 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains 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
File renamed without changes.
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.
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.
这个最好加一个if in_pir_mode()更好的写法是:
if in_dynamic_mode():
_c_ops.xxx
if in_pir_mode():
check
_c_ops.xxx
这样不会影响动态图性能
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.
check_xx系列的函数实现里已经内含了跳过动态图处理的判断,相对轻量级