Skip to content

[API Compatibility] Modify and supplement documents#7898

Merged
sunzhongkai588 merged 3 commits intoPaddlePaddle:developfrom
Le-soleile:api
Apr 30, 2026
Merged

[API Compatibility] Modify and supplement documents#7898
sunzhongkai588 merged 3 commits intoPaddlePaddle:developfrom
Le-soleile:api

Conversation

@Le-soleile
Copy link
Copy Markdown
Contributor

PR Category

User Experience

PR Types

New features

Description

是否引起精度变化

😺

Copilot AI review requested due to automatic review settings April 27, 2026 05:49
@paddle-bot
Copy link
Copy Markdown

paddle-bot Bot commented Apr 27, 2026

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

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 27, 2026

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

Copy link
Copy Markdown
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

本 PR 旨在配合最近的 API 兼容性变更,补充/修正多项数学算子的中文 API 文档(重点是 inplace 版本),并增强 tile 对 PyTorch 风格调用方式的说明。

Changes:

  • 新增/补齐多个 inplace API 的中文文档页(如 sigmoid_cosh_atanh_asin_asinh_acosh_ 等)。
  • 修正若干 inplace API 文档的函数签名与表述(如 ceil_floor_reciprocal_sinh_ 等)。
  • 更新 paddle.tileTensor.tile 文档,说明 Paddle 风格与 PyTorch 风格两种调用方式,并在总览页补充新增 API 入口。

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
docs/api/paddle/tile_cn.rst 增加 tile 的两种调用风格说明,并扩展参数/返回描述
docs/api/paddle/square__cn.rst 规范 inplace 文档排版与 x 的行内代码标注
docs/api/paddle/sinh__cn.rst 调整 sinh_ 文档签名以匹配 inplace 文档风格
docs/api/paddle/sigmoid__cn.rst 新增 sigmoid_ 的中文 inplace 文档页
docs/api/paddle/reciprocal__cn.rst 修正文档签名,补充缺失的 x 参数
docs/api/paddle/floor__cn.rst 修正文档签名,补充缺失的 x 参数
docs/api/paddle/expm1__cn.rst 规范 inplace 文档排版与 x 的行内代码标注
docs/api/paddle/cosh__cn.rst 新增 cosh_ 的中文 inplace 文档页
docs/api/paddle/ceil__cn.rst 修正文档签名并规范 x 行内代码标注
docs/api/paddle/atanh__cn.rst 新增 atanh_ 的中文 inplace 文档页
docs/api/paddle/atan__cn.rst 规范 inplace 文档排版与 x 的行内代码标注
docs/api/paddle/asinh__cn.rst 新增 asinh_ 的中文 inplace 文档页
docs/api/paddle/asin__cn.rst 新增 asin_ 的中文 inplace 文档页
docs/api/paddle/acosh__cn.rst 新增 acosh_ 的中文 inplace 文档页
docs/api/paddle/acos__cn.rst 规范 inplace 文档排版与 x 的行内代码标注
docs/api/paddle/Tensor__upper_cn.rst 补充多个 Tensor 方法/原位方法条目,并补充 tile 的调用风格说明
docs/api/paddle/Overview_cn.rst 在 inplace API 总览表中补充新增条目

Comment thread docs/api/paddle/Tensor__upper_cn.rst Outdated
Comment on lines +2714 to +2719
请参考 :ref:`cn_api_paddle_sigmoid`

sigmoid_(name=None)
:::::::::

Inplace 版本的 :ref:`cn_api_paddle_sigmoid` API,对输入 ``x`` 采用 Inplace 策略。
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

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

这里新增 sigmoid(name=None)/sigmoid_(name=None) 小节,但都引用了 :ref:cn_api_paddle_sigmoid``;当前仓库内未找到该 label 定义,构建时会产生未解析引用。建议补充 paddle.sigmoid 的文档页并提供 `cn_api_paddle_sigmoid` label,或把这里的引用改为实际存在的非 inplace API 文档 label。

Suggested change
请参考 :ref:`cn_api_paddle_sigmoid`
sigmoid_(name=None)
:::::::::
Inplace 版本的 :ref:`cn_api_paddle_sigmoid` API,对输入 ``x`` 采用 Inplace 策略。
请参考 ``paddle.sigmoid``
sigmoid_(name=None)
:::::::::
Inplace 版本的 ``paddle.sigmoid`` API,对输入 ``x`` 采用 Inplace 策略。

Copilot uses AI. Check for mistakes.
Comment on lines 3014 to 3016
tanh(name=None)
:::::::::

Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

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

tanh(name=None) 小节在后续内容里“请参考”以及 tanh_ 的 Inplace 描述当前指向了 cn_api_paddle_tan(tan 的文档),会导致 tanh 错链。建议把该小节内相关引用改为 cn_api_paddle_tanh / cn_api_paddle_tanh_ 对应的文档。

Copilot uses AI. Check for mistakes.
本方法支持两种调用方式:

1. **Paddle 风格**: ``x.tile(repeat_times, name=None)``
使用张量序列或 Tensor 指定各维度复制次数。
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

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

这里描述 Paddle 风格调用时写成了“使用张量序列或 Tensor 指定各维度复制次数”,但 tilerepeat_times 实际是整数序列(list/tuple of int)或 1-D int Tensor(以及可能包含 int Tensor 的序列),不是“张量序列”。建议改为“整数序列(list/tuple)或 Tensor”等更准确表述,避免误导。

Suggested change
使用张量序列或 Tensor 指定各维度复制次数。
使用整数序列(``list/tuple``)或 ``Tensor`` 指定各维度复制次数。

Copilot uses AI. Check for mistakes.
Comment on lines +22 to +23
- **x** (Tensor) - 输入的 Tensor,数据类型为:bool、float16、float32、float64、int32、int64、complex64complex128。别名 ``input``
- **repeat_times** (list|tuple|Tensor) - 指定输入 ``x`` 每个维度的复制次数。如果 ``repeat_times`` 的类型是 list 或 tuple,它的元素可以是整数或者数据类型为 int32 的 1-D Tensor。如果 ``repeat_times`` 的类型是 Tensor,则是数据类型为 int32 的 1-D Tensor。别名 ``dims``。
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

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

文档声明支持 PyTorch 风格 paddle.tile(input, *dims),但参数说明里 repeat_times 仍只描述为 list|tuple|Tensor,容易让读者误以为 dims 也是同样类型。建议在 repeat_times/dims 的参数说明中补充:PyTorch 风格下 dims 为可变数量的整数参数(等价于一个整数序列),并明确两种风格下传参方式的对应关系。

Copilot uses AI. Check for mistakes.
返回
:::::::::
``Tensor``,数据类型与 ``x`` 相同。返回值的第 i 维的大小等于 ``x[i] * repeat_times[i]`` 。
``Tensor``,数据类型与 ``x`` 相同。返回值的第 i 维的大小等于 ``x.shape[i] * repeat_times[i]`` 。
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

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

返回值描述里“第 i 维”中的 i 未使用一致的行内代码格式(上文已写作第 i 个维度),且表达式与上文一处缺少空格不一致。建议统一为第 i 维,并保持表达式格式一致(例如在 * 两侧留空格)。

Suggested change
``Tensor``,数据类型与 ``x`` 相同。返回值的第 i 维的大小等于 ``x.shape[i] * repeat_times[i]`` 。
``Tensor``,数据类型与 ``x`` 相同。返回值的第 ``i`` 维的大小等于 ``x.shape[i] * repeat_times[i]`` 。

Copilot uses AI. Check for mistakes.
Comment thread docs/api/paddle/sigmoid__cn.rst Outdated
@zhwesky2010
Copy link
Copy Markdown
Collaborator

ERROR: api_label is not correct, please check api_label in the above files

Le-soleile and others added 2 commits April 27, 2026 19:38
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Collaborator

@zhwesky2010 zhwesky2010 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
Copy Markdown
Collaborator

@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

@sunzhongkai588 sunzhongkai588 merged commit c165e6f into PaddlePaddle:develop Apr 30, 2026
4 of 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.

4 participants