-
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 TestNoBackwardAPIStatic.test_unique*
#62794
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
self.assertEqual(inverse, 0) | ||
self.assertEqual(counts, 1) | ||
self.assertEqual(res[0].shape, (1,)) | ||
res = self.exe.run(prog, fetch_list=[x, y, inverse, counts]) |
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.
res = self.exe.run(prog, fetch_list=[x, y, inverse, counts]) | |
x_res, y_res, inverse_res, counts_res = self.exe.run(prog, fetch_list=[x, y, inverse, counts]) |
这样一目了然,不然下面取下标还得看 0、1、2、3 分别是啥
self.assertEqual(counts, 1) | ||
self.assertEqual(res[0].shape, (1,)) | ||
res = self.exe.run(prog, fetch_list=[x, y, inverse, counts]) | ||
self.assertEqual(res[0], res[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.
合理,原来代码就是个隐藏的 bug,Variable == Variable
返回 Variable
,bool(Variable)
永远为 True
self.assertEqual(res[2], 0) | ||
self.assertEqual(res[3], 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.
这里修改也是合理的,原来就是 bug
self.assertEqual(inverse, 0) | ||
self.assertEqual(counts, 1) | ||
self.assertEqual(res[0].shape, (1,)) | ||
res = self.exe.run(prog, fetch_list=[x, y, index, inverse, counts]) |
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.
PR types
Bug fixes
PR changes
Others
Description
适配
test/legacy_test/test_zero_dim_no_backward_api.py
下的TestNoBackwardAPIStatic.test_unique_consecutive
和TestNoBackwardAPIStatic.test_unique
,改为测试执行后的结果我们在这里不能直接使用
Value
进行比较,一个是unique_consecutive
,一个是uniform
相关链接:
test_zero_dim_*.py
- step: 2 #62652bool(Value)
always throw error #60902