-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
[PIR] Adaptation of test_zero_dim_tensor
before TestSundryAPIStatic
#61575
Conversation
test_zero_dim_tensor
before TestSundryAPIStatic
self.assertEqual(res[0].shape, ()) | ||
if len(res) > 1: | ||
self.assertEqual(res[1].shape, ()) | ||
if len(res) > 2: | ||
self.assertEqual(res[2].shape, (3, 5)) |
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.
确认下,这里 PIR 是没跑到么?为啥这里直接用 assertEqual 可以跑过呢?PIR shape 应该是 list
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.
是的 paddle.any
和 paddle.all
这俩不可微分API 在PIR下没跑到,按理说PIR下是对的,梯度不存在就行,旧IR下是一个全1的矩阵
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.
这样的话,下个 PR 加一个注释吧,因为单测不应该有这样的不确定性,这对未来退场也是不友好的,可以考虑写成 in_pir_mode
如何,否则如何的形式,根据 len 来判断的话,将来退场是不可能知道要修改这里的
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.
self.assertEqual(res[0].shape, ()) | ||
if len(res) > 1: | ||
self.assertEqual(res[1].shape, ()) | ||
if len(res) > 2: | ||
self.assertEqual(res[2].shape, (3, 5)) |
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.
这样的话,下个 PR 加一个注释吧,因为单测不应该有这样的不确定性,这对未来退场也是不友好的,可以考虑写成 in_pir_mode
如何,否则如何的形式,根据 len 来判断的话,将来退场是不可能知道要修改这里的
@@ -198,6 +209,13 @@ def test_static_unary(self): | |||
|
|||
# Use to test zero-dim of reduce API | |||
class TestReduceAPI(unittest.TestCase): | |||
def assertShapeEqual(self, out, target_tuple): |
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.
def assertShapeEqual(self, out, target_tuple): | |
def assertShapeEqual(self, actual_shape, expected_shape): |
之后可以优化下签名~
PR types
Others
PR changes
Others
Description
test_zero_dim_*.py
#61413