Skip to content
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

Merged
merged 3 commits into from
Mar 19, 2024

Conversation

gouzil
Copy link
Member

@gouzil gouzil commented Mar 18, 2024

PR types

Bug fixes

PR changes

Others

Description

我们不应该在setUp中加载任何数据,因为在这时还没确定是哪种 IR 模式运行

相关链接:

Copy link

paddle-bot bot commented Mar 18, 2024

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot bot added the contributor External developers label Mar 18, 2024
@gouzil gouzil requested a review from SigureMo March 18, 2024 04:46
@@ -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):
Copy link
Member Author

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 = []
Copy link
Member

@SigureMo SigureMo Mar 18, 2024

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

SigureMo
SigureMo previously approved these changes Mar 18, 2024
Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTMeow 🐾

@gouzil gouzil merged commit faad409 into PaddlePaddle:develop Mar 19, 2024
30 checks passed
@gouzil gouzil deleted the fix_test_zero_dim_5 branch April 10, 2024 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants