-
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
[PIR] Adaptation of test_zero_dim_tensor
TestSundryAPIStatic
#61577
Conversation
test_zero_dim_tensor
TestSundryAPIStatic
res = self.exe.run(prog, fetch_list=[x, out] + grad_list) | ||
self.assertEqual(res[0].shape, ()) | ||
self.assertEqual(res[1].shape, ()) | ||
if len(grad_list) > 0: |
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.
这里的判断是说len(grad_list)可能==0吗,grad_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.
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.
因为有时候梯度为 None, 所以数量会变
单测应该是确定的事情,如果这里确实不应该有梯度,那么就应该 assert 是 None
可以看看老 IR 下是不是 None 呢?
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.
那就是新老 IR 无法对齐咯,这里如果方便的话,可以定位下问题,建议单独 PR 处理~
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.
已在 #61413 中做记录
res = self.exe.run(prog, fetch_list=[x, out] + grad_list) | ||
self.assertEqual(res[0].shape, ()) | ||
self.assertEqual(res[1].shape, ()) | ||
if len(grad_list) > 0: |
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.
因为有时候梯度为 None, 所以数量会变
单测应该是确定的事情,如果这里确实不应该有梯度,那么就应该 assert 是 None
可以看看老 IR 下是不是 None 呢?
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 types
Others
PR changes
Others
Description
test_zero_dim_*.py
#61413