[API Compatibility] Modify and supplement documents#7898
[API Compatibility] Modify and supplement documents#7898sunzhongkai588 merged 3 commits intoPaddlePaddle:developfrom
Conversation
|
感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-7898.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/index_cn.html |
📚 本次 PR 文档预览链接(点击展开)
|
There was a problem hiding this comment.
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.tile与Tensor.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 总览表中补充新增条目 |
| 请参考 :ref:`cn_api_paddle_sigmoid` | ||
|
|
||
| sigmoid_(name=None) | ||
| ::::::::: | ||
|
|
||
| Inplace 版本的 :ref:`cn_api_paddle_sigmoid` API,对输入 ``x`` 采用 Inplace 策略。 |
There was a problem hiding this comment.
这里新增 sigmoid(name=None)/sigmoid_(name=None) 小节,但都引用了 :ref:cn_api_paddle_sigmoid``;当前仓库内未找到该 label 定义,构建时会产生未解析引用。建议补充 paddle.sigmoid 的文档页并提供 `cn_api_paddle_sigmoid` label,或把这里的引用改为实际存在的非 inplace API 文档 label。
| 请参考 :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 策略。 |
| tanh(name=None) | ||
| ::::::::: | ||
|
|
There was a problem hiding this comment.
tanh(name=None) 小节在后续内容里“请参考”以及 tanh_ 的 Inplace 描述当前指向了 cn_api_paddle_tan(tan 的文档),会导致 tanh 错链。建议把该小节内相关引用改为 cn_api_paddle_tanh / cn_api_paddle_tanh_ 对应的文档。
| 本方法支持两种调用方式: | ||
|
|
||
| 1. **Paddle 风格**: ``x.tile(repeat_times, name=None)`` | ||
| 使用张量序列或 Tensor 指定各维度复制次数。 |
There was a problem hiding this comment.
这里描述 Paddle 风格调用时写成了“使用张量序列或 Tensor 指定各维度复制次数”,但 tile 的 repeat_times 实际是整数序列(list/tuple of int)或 1-D int Tensor(以及可能包含 int Tensor 的序列),不是“张量序列”。建议改为“整数序列(list/tuple)或 Tensor”等更准确表述,避免误导。
| 使用张量序列或 Tensor 指定各维度复制次数。 | |
| 使用整数序列(``list/tuple``)或 ``Tensor`` 指定各维度复制次数。 |
| - **x** (Tensor) - 输入的 Tensor,数据类型为:bool、float16、float32、float64、int32、int64、complex64 或 complex128。别名 ``input``。 | ||
| - **repeat_times** (list|tuple|Tensor) - 指定输入 ``x`` 每个维度的复制次数。如果 ``repeat_times`` 的类型是 list 或 tuple,它的元素可以是整数或者数据类型为 int32 的 1-D Tensor。如果 ``repeat_times`` 的类型是 Tensor,则是数据类型为 int32 的 1-D Tensor。别名 ``dims``。 |
There was a problem hiding this comment.
文档声明支持 PyTorch 风格 paddle.tile(input, *dims),但参数说明里 repeat_times 仍只描述为 list|tuple|Tensor,容易让读者误以为 dims 也是同样类型。建议在 repeat_times/dims 的参数说明中补充:PyTorch 风格下 dims 为可变数量的整数参数(等价于一个整数序列),并明确两种风格下传参方式的对应关系。
| 返回 | ||
| ::::::::: | ||
| ``Tensor``,数据类型与 ``x`` 相同。返回值的第 i 维的大小等于 ``x[i] * repeat_times[i]`` 。 | ||
| ``Tensor``,数据类型与 ``x`` 相同。返回值的第 i 维的大小等于 ``x.shape[i] * repeat_times[i]`` 。 |
There was a problem hiding this comment.
返回值描述里“第 i 维”中的 i 未使用一致的行内代码格式(上文已写作第 i 个维度),且表达式与上文一处缺少空格不一致。建议统一为第 i 维,并保持表达式格式一致(例如在 * 两侧留空格)。
| ``Tensor``,数据类型与 ``x`` 相同。返回值的第 i 维的大小等于 ``x.shape[i] * repeat_times[i]`` 。 | |
| ``Tensor``,数据类型与 ``x`` 相同。返回值的第 ``i`` 维的大小等于 ``x.shape[i] * repeat_times[i]`` 。 |
|
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
PR Category
User Experience
PR Types
New features
Description
pr涉及到api的文档 [API compatibility] update paddle.Tensor.exp_、sqrt_、rsqrt_、ceil_、floor_、reciprocal_、sigmoid_、sin_、sinh_、asin_、asinh_、cos_、cosh_、acos_、acosh_、tan_、atan_、atanh_、expm1_、square_ Paddle#78617 [API compatibility] update paddle.Tensor.tile Paddle#78516api: exp_、sqrt_、rsqrt_、ceil_、floor_、reciprocal_、sigmoid_、sin_、sinh_、asin_、asinh_、cos_、cosh_、acos_、acosh_、tan_、atan_、atanh_、expm1_、square_、tile是否引起精度变化
否
😺