Skip to content

[API Compatibility] sgn/signbit/tensordot/tril_indices/vander/logaddexp/moveaxis/nan_to_num/nanmean/nansum/*scatter Edit By AI Agent#7889

Open
zhwesky2010 wants to merge 1 commit intoPaddlePaddle:developfrom
zhwesky2010:68
Open

Conversation

@zhwesky2010
Copy link
Copy Markdown
Collaborator

@zhwesky2010 zhwesky2010 commented Apr 7, 2026

API Compatibility Edit By AI Agent:

torch.select_scatter
torch.Tensor.select_scatter
torch.sgn
torch.Tensor.sgn
torch.signbit
torch.Tensor.signbit
torch.slice_scatter
torch.Tensor.slice_scatter
torch.take
torch.Tensor.take
torch.tensordot
torch.tril_indices
torch.triu_indices
torch.vander
torch.logaddexp
torch.Tensor.logaddexp
torch.logspace
torch.moveaxis
torch.Tensor.moveaxis
torch.nan_to_num
torch.Tensor.nan_to_num
torch.nanmean
torch.Tensor.nanmean
torch.nansum
torch.Tensor.nansum
torch.masked_fill

…xp/moveaxis/nan_to_num/nanmean/nansum/*scatter Edit By AI Agent
Copilot AI review requested due to automatic review settings April 7, 2026 12:36
@paddle-bot
Copy link
Copy Markdown

paddle-bot bot commented Apr 7, 2026

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

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

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

@zhwesky2010 zhwesky2010 changed the title [API Compatibility] sgn/signbit/tensordot/tril_indices/vander/logadde… [API Compatibility] sgn/signbit/tensordot/tril_indices/vander/logaddexp/moveaxis/nan_to_num/nanmean/nansum/*scatter Edit By AI Agent Apr 7, 2026
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 旨在对部分 Paddle API 中文文档做“PyTorch 风格/兼容性”补充与勘误,提升参数别名与签名描述的一致性。

Changes:

  • triu_indices / tril_indices 增加关于 PyTorch device / layout 参数的兼容性说明(note)。
  • take / sgn / signbit 补充 PyTorch 风格的参数别名与(out)关键字参数描述,并更新 signbit 返回 dtype 说明。
  • 修正文档表述(如 select_scatter 的句末标点与变量名一致性)。

Reviewed changes

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

Show a summary per file
File Description
docs/api/paddle/triu_indices_cn.rst 新增 note 说明 PyTorch device/layout 参数兼容性。
docs/api/paddle/tril_indices_cn.rst 新增 note 说明 PyTorch device/layout 参数兼容性。
docs/api/paddle/take_cn.rst x 参数补充别名 input
docs/api/paddle/signbit_cn.rst 签名增加 out,补充关键字参数说明,并修正返回 dtype 描述为 bool。
docs/api/paddle/sgn_cn.rst 签名增加 out,补充关键字参数说明与 input 别名。
docs/api/paddle/select_scatter_cn.rst 修正描述标点与 values 变量名引用一致性。

Comment on lines +22 to +24
.. note::
Paddle 不支持 PyTorch 的 ``device`` 和 ``layout`` 参数。若传入这些参数,将被自动忽略。在转换 PyTorch 代码时,这些参数可以安全地传入而不影响功能,但 Paddle 会忽略它们的值。

Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

这里的 note 说明“可安全传入 PyTorch 的 device/layout 参数且会被忽略”,但当前文档函数签名为 paddle.triu_indices(row, col=None, offset=0, dtype='int64'),并未包含这些参数。若实际实现也不接受这些关键字参数,用户传入将直接触发 TypeError,导致文档与行为不一致。建议:1) 若确实支持为兼容而接受并忽略它们,请在签名/参数列表中补充 device/layout(并明确其被忽略);2) 否则移除或改写该 note,避免误导。另:该 .. note:: 当前缩进在参数列表内,容易被渲染成紧跟 dtype 参数的附注;如要作为通用说明,建议取消缩进放到参数列表外。

Suggested change
.. note::
Paddle 不支持 PyTorch 的 ``device`` 和 ``layout`` 参数。若传入这些参数,将被自动忽略。在转换 PyTorch 代码时,这些参数可以安全地传入而不影响功能,但 Paddle 会忽略它们的值。

Copilot uses AI. Check for mistakes.
Comment on lines +22 to +24
.. note::
Paddle 不支持 PyTorch 的 ``device`` 和 ``layout`` 参数。若传入这些参数,将被自动忽略。在转换 PyTorch 代码时,这些参数可以安全地传入而不影响功能,但 Paddle 会忽略它们的值。

Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

这里的 note 声称可安全传入 PyTorch 的 device/layout 且会被自动忽略,但当前文档签名 paddle.tril_indices(row, col, offset=0, dtype='int64') 并未包含这些参数;若实际实现不接受这些关键字参数,传入会直接报错,从而造成文档与真实行为不一致。建议根据真实 API 行为:要么在签名/参数列表补充并说明其被忽略,要么删除/改写该 note。另:.. note:: 目前缩进在参数列表内,容易被当作 dtype 参数的补充说明;如想作为函数级说明,建议取消缩进放到参数列表外。

Suggested change
.. note::
Paddle 不支持 PyTorch 的 ``device`` 和 ``layout`` 参数。若传入这些参数,将被自动忽略。在转换 PyTorch 代码时,这些参数可以安全地传入而不影响功能,但 Paddle 会忽略它们的值。

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