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

[Dy2St] Enable dy2st ut test_assert in PIR mode #60216

Merged
merged 1 commit into from
Dec 21, 2023

Conversation

SigureMo
Copy link
Member

@SigureMo SigureMo commented Dec 21, 2023

PR types

Others

PR changes

Others

Description

启用 test_assert 单测理想态

PCard-66972

Copy link

paddle-bot bot commented Dec 21, 2023

你的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.

Copy link
Member

@gouzil gouzil left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@DrRyanHuang DrRyanHuang left a comment

Choose a reason for hiding this comment

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

class TestAssertVariable(Dy2StTestBase):
    def _run(self, func, x, with_exception, to_static):
        with enable_to_static_guard(to_static):
            if with_exception:
                with self.assertRaises(BaseException):  # noqa: B017 <------------
                    with base.dygraph.guard():
                        func(x)
            else:
                with base.dygraph.guard():
                    func(x)

可否将 BaseException 替换为 AssertionError

@SigureMo
Copy link
Member Author

可否将 BaseException 替换为 AssertionError

我试过了,C++ 端老 IR 实际报的并不是 AssertionError

@SigureMo SigureMo merged commit 582da31 into PaddlePaddle:develop Dec 21, 2023
29 checks passed
@SigureMo SigureMo deleted the dy2st/enable-test-assert branch December 21, 2023 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants