Skip to content

Conversation

@megemini
Copy link
Contributor

关联:PaddlePaddle/Paddle#76008

更新文档中 《自定义 C++算子》 部分相关内容。

@SigureMo @sunzhongkai588

@paddle-bot
Copy link

paddle-bot bot commented Nov 19, 2025

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

@github-actions
Copy link

github-actions bot commented Nov 19, 2025

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

@SigureMo
Copy link
Member

还得是顺师傅考虑的周全,我稍后看下,这个倒没那么急

[0. , 0. , 0.12062856, 0.18853758, 0.54154527, 0.73217475,
0. , 0. , 0. , 0. ],
[0.04105225, 0. , 0.67857188, 0.95838499, 1.08346415, 2.47209001,
0. , 0. , 0.22969440, 1.08237624]])
Copy link
Member

Choose a reason for hiding this comment

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

这里代码保持源码吧,这样方便 copy,输出用注释表示下

@SigureMo SigureMo requested a review from Copilot November 19, 2025 10:51
Copilot finished reviewing on behalf of SigureMo November 19, 2025 10:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the Custom C++ Operator documentation to reflect changes in setuptools 80+ behavior. The update addresses compatibility with modern setuptools versions, which changed the installation mechanism from egg-based to modern Python package structure.

Key changes:

  • Updated installation directory reference to include both site-packages and dist-packages
  • Replaced old egg-based installation logs with modern setuptools installation output
  • Updated package structure documentation from .py file to proper Python package with __init__.py

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

``` shell

> tree /usr/local/lib/python3.9/dist-packages/custom_setup_ops*
/usr/local/lib/python3.9/dist-packages/custom_setup_ops
Copy link

Copilot AI Nov 19, 2025

Choose a reason for hiding this comment

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

The tree output shows custom_setup_ops as a file instead of a directory. The first line after the path should indicate it's a directory. Consider adding a trailing slash or appropriate directory indicator to clarify that custom_setup_ops is a directory containing __init__.py and the .so file.

Suggested change
/usr/local/lib/python3.9/dist-packages/custom_setup_ops
/usr/local/lib/python3.9/dist-packages/custom_setup_ops/

Copilot uses AI. Check for mistakes.
其中 `custom_setup_ops_pd_.so` 为自定义算子编译生成的动态库,`custom_setup_ops/__init__.py` 为根据 `PaddlePaddle` 接口的定义规则,自动生成的自定义算子 python 模块源码,其示例内容为(自动生成的代码后续可能会更新,生成结果可能与示例代码不一致):

```python

Copy link

Copilot AI Nov 19, 2025

Choose a reason for hiding this comment

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

[nitpick] Unnecessary blank line at the start of the code block. This empty line should be removed for cleaner code presentation.

Suggested change

Copilot uses AI. Check for mistakes.

`/usr/local/lib/python3.7/site-packages/custom_setup_ops-0.0.0-py3.7-linux-x86_64.egg`
``` shell

Copy link

Copilot AI Nov 19, 2025

Choose a reason for hiding this comment

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

[nitpick] Unnecessary blank line at the start of the shell code block. This should be removed to maintain consistent formatting with other code blocks in the documentation.

Suggested change

Copilot uses AI. Check for mistakes.
其目录结构如下:

``` shell

Copy link

Copilot AI Nov 19, 2025

Choose a reason for hiding this comment

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

[nitpick] Unnecessary blank line at the start of the shell code block. This should be removed to maintain consistent formatting with other code blocks in the documentation.

Suggested change

Copilot uses AI. Check for mistakes.
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.

另外我觉得可以单独提一下,在当前目录只有一个 setup.py 时可以使用 pip install . --no-build-isolation 这种现代化的方式来构建

@megemini megemini requested a review from SigureMo November 19, 2025 13:38
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 🐾

@SigureMo SigureMo merged commit 1f43849 into PaddlePaddle:develop Nov 19, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants