-
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_no_backward_api
, extract init data
#62808
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
@@ -312,6 +315,7 @@ def test_arange(self): | |||
np.testing.assert_array_equal(res, [1.0, 2.0, 3.0, 4.0, 5.0]) | |||
|
|||
def test_normal(self): |
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看
@@ -260,6 +260,9 @@ class TestNoBackwardAPIStatic(unittest.TestCase): | |||
def setUp(self): | |||
paddle.enable_static() | |||
self.exe = paddle.static.Executor() | |||
self.shape = [] |
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.
我们不应该在setUp中加载任何数据,因为在这时还没确定是哪种 IR 模式运行
这个默认的 self.shape
是针对什么情况的?如果所有 case 都有 init_data
的话,就不存在需要 self.shape
默认值的情况
另外,既然现在是在具体 test case 里调用的,就不要写成带有 side effect 的函数了,直接作为返回值返回即可,能写成纯函数就写成纯函数,函数名改名为 create_dynamic_shape
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.
Done
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
我们不应该在
setUp
中加载任何数据,因为在这时还没确定是哪种 IR 模式运行相关链接:
test_zero_dim_*.py
- step: 2 #62652