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

Fix convert directive #55811

Merged
merged 8 commits into from
Jul 31, 2023
Merged

Conversation

megemini
Copy link
Contributor

@megemini megemini commented Jul 30, 2023

PR types

Others

PR changes

Others

Description

  • 修改 directive_patthern ,能够转换含有描述的 # doctest: +SKIP('XXX')

  • patch xdoctest : tensor place 能够转换 Tensor 的 place,如:

    Tensor(shape=[1], dtype=float32, place=Place(gpu:0), stop_gradient=True,
                      [0.123456780])

    转换为

    Tensor(shape=[1], dtype=float32, place=Place(cpu), stop_gradient=True,
                      [0.123456780])
  • patch xdoctest : float precision 将输出(got/want)中的数字进行统一的 round(默认digits=5),如

      Tensor(shape=[1], dtype=float32, place=Place(cpu), stop_gradient=True,
                      [0.123456780])

      Tensor(shape=[1], dtype=float32, place=Place(cpu), stop_gradient=True,
                      [0.123456781])

    表示一致。

    这里没有使用 https://github.com/boisgera/numtest/blob/2.x/numtest/__init__.py 的方法,numtest 使用了一种近似方法,可以把 3.13.14 表示为一致。而这里修改的目的是兼容不同设备 float 的精度问题,所以统一使用 round 方法,并且兼容 complex。不需要额外的 directive。

  • 修改 print_summary 使其打印输出 nocodes 的接口。

  • 修改 uniform.py 用于验证修改后的 CI 正确性。

@SigureMo 请评审~

@paddle-bot
Copy link

paddle-bot bot commented Jul 30, 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

@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.

LGTM~

Copy link
Contributor

@sunzhongkai588 sunzhongkai588 left a comment

Choose a reason for hiding this comment

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

LGTM
太牛了顺师傅 @megemini

@luotao1 luotao1 merged commit 2dbd47b into PaddlePaddle:develop Jul 31, 2023
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.

4 participants