[API Compatibility No.13、75] Add param alias for hypot and hypot_#7851
[API Compatibility No.13、75] Add param alias for hypot and hypot_#7851luotao1 merged 2 commits intoPaddlePaddle:developfrom
Conversation
…n Chinese documentation
|
感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-7851.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 更新了飞桨 paddle.hypot / paddle.hypot_ 的中文 API 文档,以配合新增的参数别名能力,并为 paddle.hypot 补充 out 关键字参数的文档入口。
Changes:
- 更新
paddle.hypot的函数签名,新增out关键字参数,并在参数区补充别名说明 - 更新
paddle.hypot_的函数签名,新增out关键字参数
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| docs/api/paddle/hypot_cn.rst | 更新 hypot 签名并补充参数别名与 out 关键字参数说明 |
| docs/api/paddle/hypot__cn.rst | 更新 hypot_ 签名以包含 out 关键字参数 |
docs/api/paddle/hypot_cn.rst
Outdated
| - **x** (Tensor) – 输入 Tensor,它的数据类型可以是 float32,float64, int32, int64。别名 ``input``。 | ||
| - **y** (Tensor) – 输入 Tensor,它的数据类型可以是 float32,float64,int32, int64。别名 ``other``。 |
There was a problem hiding this comment.
参数列表中数据类型枚举存在多余空格(如 float64, int32、int32, int64),且同一列表项里使用的分隔符风格不一致。建议去掉中文逗号后的空格,并与仓库中多数 API 文档保持一致的枚举写法(例如使用 、 分隔或至少保持无空格的 , 分隔)。
| - **x** (Tensor) – 输入 Tensor,它的数据类型可以是 float32,float64, int32, int64。别名 ``input``。 | |
| - **y** (Tensor) – 输入 Tensor,它的数据类型可以是 float32,float64,int32, int64。别名 ``other``。 | |
| - **x** (Tensor) – 输入 Tensor,它的数据类型可以是 float32,float64,int32,int64。别名 ``input``。 | |
| - **y** (Tensor) – 输入 Tensor,它的数据类型可以是 float32,float64,int32,int64。别名 ``other``。 |
|
|
||
| 关键字参数 | ||
| ::::::::: | ||
| - **out** (Tensor,可选) - 输出 Tensor,若不为 ``None``,计算结果将保存在该 Tensor 中,默认值为 ``None``。 |
There was a problem hiding this comment.
关键字参数 下的 bullet list 结束后紧接着就是下一节 返回 标题,中间缺少空行,容易导致 Sphinx/reST 解析产生告警或渲染异常。建议在 out 参数条目后补一个空行,再开始 返回 小节。
| - **out** (Tensor,可选) - 输出 Tensor,若不为 ``None``,计算结果将保存在该 Tensor 中,默认值为 ``None``。 | |
| - **out** (Tensor,可选) - 输出 Tensor,若不为 ``None``,计算结果将保存在该 Tensor 中,默认值为 ``None``。 |
| .. py:function:: paddle.hypot_(x, y, name=None, *, out=None) | ||
|
|
||
| Inplace 版本的 :ref:`cn_api_paddle_hypot` API,对输入 x 采用 Inplace 策略。 | ||
|
|
There was a problem hiding this comment.
该文档仅更新了签名以支持参数别名/out,但正文未说明别名能力。为与已有 inplace API 文档保持一致,建议补充 .. note::(参考 docs/api/paddle/abs__cn.rst)说明 input/other 可分别替代 x/y(如确实已支持)。
| .. note:: | |
| 该 API 支持使用 ``input`` 和 ``other`` 作为 ``x`` 和 ``y`` 的参数别名,即 ``input`` 等价于 ``x``,``other`` 等价于 ``y``。请勿在同一次调用中同时使用 ``x`` 与 ``input`` 或 ``y`` 与 ``other``。 |
docs/api/paddle/hypot__cn.rst
Outdated
| ------------------------------- | ||
|
|
||
| .. py:function:: paddle.hypot_(x, y, name=None) | ||
| .. py:function:: paddle.hypot_(x, y, name=None, *, out=None) |
PR Category
User Experience
PR Types
New features
Description
paddle.hypot、paddle.hypot_添加参数别名paddle.hypot新增out参数Related Issue: PaddlePaddle/Paddle#76301
Related PRs:
是否引起精度变化
否