-
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
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
@@ -221,6 +225,7 @@ def gather_tree(ids: Tensor, parents: Tensor) -> Tensor: | |||
raise ValueError("The ids's shape must be the same as parents' shape. ") | |||
|
|||
if in_dynamic_or_pir_mode(): | |||
check_dtype(parents.dtype, "parents", ['int32', 'int64'], 'gather_tree') |
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系列的函数实现里已经内含了跳过动态图处理的判断,相对轻量级
@@ -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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
check_xx系列的函数实现里已经内含了跳过动态图处理的判断,相对轻量级
PR Category
Execute Infrastructure
PR Types
Not User Facing
Description
Pcard-67164
关联Issue:#63740