Skip to content

Conversation

@LittleHeroZZZX
Copy link
Contributor

@LittleHeroZZZX LittleHeroZZZX commented Oct 30, 2025

1. 新增如下 API 文档:

nn.ConstantPad1D/2D/3D
nn.ReflectionPad1D/2D/3D
nn.ReplicationPad1D/2D/3D
nn.CircularPad1D/2D/3D

以及上述十二个 API "D" 为小写的别名(例如 nn.ConstantPad1D -> nn.ConstantPad1d)。

由于 rst 的标签不区分大小写,同时避免在不区分大小写的文件系统内文件重名的问题,小写的 API 文档增加了compat后缀,标签也增加了 compat 后缀。

关联 PR:PaddlePaddle/Paddle#76136

2. 优化根据文件名校验首行 Label 的逻辑,展示所有报错信息后再退出,并在错误信息中打印预期值。

旧报错:

2025-11-05 19:57:28 2025-11-05 11:57:28,085 - run_cn_api_label_checking:79 
- ERROR - The first line in /FluidDoc/docs//api/paddle/nn/ConstantPad1D_cn.rst is not available, please re-check it!

新报错:

2025-11-06 10:20:52 2025-11-06 02:20:52,963 - run_cn_api_label_checking:83 - ERROR - ??? First Line API Label Mismatch
2025-11-06 10:20:52   File: api/paddle/nn/ConstantPad1D_cn.rst
2025-11-06 10:20:52   ???? Actual:   `.. _cn_api_paddle_nn_ConstantPad1d:`
2025-11-06 10:20:52   ??? Expected: `.. _cn_api_paddle_nn_ConstantPad1D:`
2025-11-06 10:20:52 
2025-11-06 10:20:52   (Note: The 'Expected' label is auto-generated based on the file path.
2025-11-06 10:20:52    Please check if the filename is correct or update the first line of the file to match.)

@paddle-bot
Copy link

paddle-bot bot commented Oct 30, 2025

感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-7596.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/index_cn.html
预览工具的更多说明,请参考:飞桨文档预览工具

@github-actions
Copy link

github-actions bot commented Oct 30, 2025

📚 本次 PR 文档预览链接(点击展开)
ℹ️ 预览提醒
请等待 Docs-NEW 流水线运行完成后再点击预览链接,否则可能会看到旧版本内容或遇到链接无法访问的情况。

Copy link
Collaborator

@ooooo-create ooooo-create left a comment

Choose a reason for hiding this comment

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

这个的流水线是效率云,这些符号是不是显示不出来。另外之前大小写敏感的解决方式是在大写的那个 加上 __upper, 比如 https://github.com/PaddlePaddle/docs/blob/develop/docs/api/paddle/metric/Accuracy__upper_cn.rsthttps://github.com/PaddlePaddle/docs/blob/develop/docs/api/paddle/metric/accuracy_cn.rst.
LGTM for check_api_label_cn.py change

Copy link
Collaborator

@ooooo-create ooooo-create left a comment

Choose a reason for hiding this comment

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

CI 报错,这些大小写要对应起来
image

@LittleHeroZZZX
Copy link
Contributor Author

CI 报错,这些大小写要对应起来 image

OK,我晚点改成 __upper 的后缀

@LittleHeroZZZX
Copy link
Contributor Author

LittleHeroZZZX commented Nov 6, 2025

另外之前大小写敏感的解决方式是在大写的那个 加上 __upper

Paddle 里1D 的 D 大写才是正统,小写的 API 才是兼容性的 API,这个也走 upper的方案吗?还是小写用 __lower表示?

@ooooo-create
Copy link
Collaborator

另外之前大小写敏感的解决方式是在大写的那个 加上 __upper

Paddle 里1D 的 D 大写才是正统,小写的 API 才是兼容性的 API,这个也走 upper的方案吗?还是小写用 __lower表示?

也走 __upper 吧,文档里统一就好,别人看 api 还是原来的名字

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.

2 participants