Skip to content

[API Compatibility] select_scatter/sgn/signbit/slice_scatter/tensordot/tril_indices/triu_indices/vander/logaddexp/logspace/moveaxis/nan_to_num/nanmean/nansum/masked_fill Edit By AI Agent#7904

Closed
zhwesky2010 wants to merge 2 commits into
PaddlePaddle:developfrom
zhwesky2010:claude

Conversation

@zhwesky2010

@zhwesky2010 zhwesky2010 commented May 12, 2026

Copy link
Copy Markdown
Collaborator

API Compatibility Edit By AI Agent:
torch.select_scatter
torch.sgn
torch.signbit
torch.slice_scatter
torch.tensordot
torch.tril_indices
torch.triu_indices
torch.vander
torch.logaddexp
torch.logspace
torch.moveaxis
torch.nan_to_num
torch.nanmean
torch.nansum
torch.masked_fill

Copilot AI review requested due to automatic review settings May 12, 2026 12:28
@paddle-bot

paddle-bot Bot commented May 12, 2026

Copy link
Copy Markdown

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

@github-actions

github-actions Bot commented May 12, 2026

Copy link
Copy Markdown
📚 本次 PR 文档预览链接(点击展开)
ℹ️ 预览提醒
请等待 Docs-NEW 流水线运行完成后再点击预览链接,否则可能会看到旧版本内容或遇到链接无法访问的情况。
  • docs/dev_guides/coding_agent/api_compatibility/.claude/skills/add-compatibility-test/SKILL.md: 点击预览
  • docs/dev_guides/coding_agent/api_compatibility/.claude/skills/add-new-api/SKILL.md: 点击预览
  • docs/dev_guides/coding_agent/api_compatibility/.claude/skills/add-new-api/references/api_docs_guidelines.md: 点击预览
  • docs/dev_guides/coding_agent/api_compatibility/.claude/skills/add-new-api/references/new_cpp_op.md: 点击预览
  • docs/dev_guides/coding_agent/api_compatibility/.claude/skills/add-new-api/references/new_python_api.md: 点击预览
  • docs/dev_guides/coding_agent/api_compatibility/.claude/skills/api-change-decider/SKILL.md: 点击预览
  • docs/dev_guides/coding_agent/api_compatibility/.claude/skills/api-compatibility/SKILL.md: 点击预览
  • docs/dev_guides/coding_agent/api_compatibility/.claude/skills/api-docs-updater/SKILL.md: 点击预览
  • docs/dev_guides/coding_agent/api_compatibility/.claude/skills/cpp-sink/SKILL.md: 点击预览
  • docs/dev_guides/coding_agent/api_compatibility/.claude/skills/create-pr/SKILL.md: 点击预览
  • docs/dev_guides/coding_agent/api_compatibility/.claude/skills/modify-origin-api/SKILL.md: 点击预览
  • docs/dev_guides/coding_agent/api_compatibility/.claude/skills/python-decorator/SKILL.md: 点击预览
  • docs/dev_guides/coding_agent/api_compatibility/.claude/skills/pytorch-alignment-validator/SKILL.md: 点击预览

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

该 PR 根据 Paddle 主仓 PR(https://github.com/PaddlePaddle/Paddle/pull/78971)对齐 PyTorch 兼容性改动,集中更新多项 Paddle API 的中文 .rst 文档(签名、参数别名、关键字参数如 out 等),以反映最新的 API 形态与别名支持。

Changes:

  • 为部分 API 文档补齐/更新函数签名(如新增仅关键字参数 out,以及 logspacedevice/requires_grad 等)。
  • 在参数说明中补充与 PyTorch 对齐的参数别名(如 xinputyotheraxesdims 等)。
  • 为新增的仅关键字参数补充“关键字参数”小节。

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
docs/api/paddle/vander_cn.rst n 参数补充别名说明(N)。
docs/api/paddle/tensordot_cn.rst 更新签名以支持 out,并为 x/y/axes 增加别名与关键字参数说明。
docs/api/paddle/take_cn.rst x 参数补充别名 input
docs/api/paddle/slice_scatter_cn.rst 为多参数补充别名,并将若干参数类型扩展为支持 int
docs/api/paddle/signbit_cn.rst 更新签名以支持 out,并为 x 增加别名 input
docs/api/paddle/sgn_cn.rst 更新签名以支持 out,并为 x 增加别名 input
docs/api/paddle/nansum_cn.rst 更新签名以支持 out,并为 x/axis 增加别名。
docs/api/paddle/nanmean_cn.rst 更新签名以补充 dtypeout,并为 x/axis 增加别名。
docs/api/paddle/nan_to_num_cn.rst 更新签名以支持 out,并为 x 增加别名 input
docs/api/paddle/moveaxis_cn.rst x 参数补充别名 input
docs/api/paddle/logspace_cn.rst 更新签名以支持 out/device/requires_grad,并为参数补充别名与关键字参数说明。
docs/api/paddle/logaddexp_cn.rst 更新签名以支持 out,并为 x/y 增加别名与关键字参数说明。
Comments suppressed due to low confidence (2)

docs/api/paddle/logaddexp_cn.rst:10

  • 文档中的数学公式与返回值描述都写成了 logaddexp(x),但该函数有两个输入 x/y,应表述为 logaddexp(x, y)(与签名一致)。建议同步修正公式与“返回”部分的函数记法,避免把 y 漏掉。
.. py:function:: paddle.logaddexp(x, y, name=None, *, out=None)

计算 ``x`` 和 ``y`` 的以 e 为底的指数的和的自然对数。计算公式如下:

.. math::

docs/api/paddle/logspace_cn.rst:10

  • 这里同时声明“paddle.logspace 不进行梯度计算”但又新增了 requires_grad 参数并描述会设置 stop_gradient。这两者语义上冲突:要么移除/隐藏 requires_grad,要么在 note/参数说明中明确该 op 不支持反向、requires_grad 仅影响属性标记等。
.. py:function:: paddle.logspace(start, stop, num, base=10.0, dtype=None, name=None, *, out=None, device=None, requires_grad=False)

返回一个 Tensor,Tensor 的值为在区间 :math:`[base^{start}, base^{stop}]` 上按对数均匀间隔的 :math:`num` 个值,输出 Tensor 的长度为 num。

.. note::

::::::::::
- **x** (Tensor) - 输入的 Tensor,必须是 1-D Tensor, 支持的数据类型:int32、int64、float32、float64、complex64、complex128。
- **n** (int,可选) - 输出中的列数。如果未指定 n,则返回一个方阵(n = len(x))。
- **n** (int,可选) - 输出中的列数。如果未指定 n,则返回一个方阵(n = len(x))。别名 ``N``。
Comment thread docs/api/paddle/slice_scatter_cn.rst Outdated
Comment on lines +21 to +24
- **axes** (int|list|tuple) - 指定沿着哪几个维度嵌入对应的值。别名 ``dim``
- **starts** (int|list|tuple) - 嵌入的起始索引。别名 ``start``
- **ends** (int|list|tuple) - 嵌入的截止索引。别名 ``end``
- **strides** (int|list|tuple) - 嵌入的步长。别名 ``step``

返回
::::::::::::
Tensor,输出掩码,数据的 shape 大小及数据类型和输入 ``x`` 一致。
@zhwesky2010 zhwesky2010 force-pushed the claude branch 4 times, most recently from 5d179d4 to 5658a52 Compare May 19, 2026 09:49
@zhwesky2010 zhwesky2010 changed the title [API Compatibility] sgn/signbit/take/tensordot/vander/logaddexp/logspace/moveaxis/nan_to_num/nanmean/nansum/slice_scatter Edit By AI Agent [API Compatibility] select_scatter/sgn/signbit/slice_scatter/take/tensordot/tril_indices/triu_indices/vander/logaddexp/logspace/moveaxis/nan_to_num/nanmean/nansum/masked_fill Edit By AI Agent May 19, 2026
@zhwesky2010 zhwesky2010 force-pushed the claude branch 3 times, most recently from 5a85dda to cea8ad5 Compare May 22, 2026 15:28
@zhwesky2010 zhwesky2010 changed the title [API Compatibility] select_scatter/sgn/signbit/slice_scatter/take/tensordot/tril_indices/triu_indices/vander/logaddexp/logspace/moveaxis/nan_to_num/nanmean/nansum/masked_fill Edit By AI Agent [Coding Agent] Update API Compatibility Claude Code Skills May 22, 2026
@zhwesky2010 zhwesky2010 changed the title [Coding Agent] Update API Compatibility Claude Code Skills [API Compatibility] select_scatter/sgn/signbit/slice_scatter/take/tensordot/tril_indices/triu_indices/vander/logaddexp/logspace/moveaxis/nan_to_num/nanmean/nansum/masked_fill Edit By AI Agent May 22, 2026
@zhwesky2010 zhwesky2010 reopened this May 22, 2026
@zhwesky2010 zhwesky2010 changed the title [API Compatibility] select_scatter/sgn/signbit/slice_scatter/take/tensordot/tril_indices/triu_indices/vander/logaddexp/logspace/moveaxis/nan_to_num/nanmean/nansum/masked_fill Edit By AI Agent [API Compatibility] addmv/addr/fix/trunc/histc/special.round/... Edit By AI Agent May 25, 2026
zhwesky2010 and others added 2 commits June 1, 2026 10:37
…t/tril_indices/triu_indices/vander/logaddexp/logspace/moveaxis/nan_to_num/nanmean/nansum/masked_fill Edit By AI Agent

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@zhwesky2010 zhwesky2010 changed the title [API Compatibility] addmv/addr/fix/trunc/histc/special.round/... Edit By AI Agent [API Compatibility] select_scatter/sgn/signbit/slice_scatter/tensordot/tril_indices/triu_indices/vander/logaddexp/logspace/moveaxis/nan_to_num/nanmean/nansum/masked_fill Edit By AI Agent Jun 1, 2026
@zhwesky2010 zhwesky2010 closed this Jun 1, 2026
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