-
Notifications
You must be signed in to change notification settings - Fork 873
API Compatibility Edit by AI Agent #7676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
…ciprocal/square/tan)
|
感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-7676.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/index_cn.html |
📚 本次 PR 文档预览链接(点击展开)
|
There was a problem hiding this 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 是由 AI Agent 自动生成的 API 兼容性编辑,主要目的是为多个 Paddle API 添加与 PyTorch 兼容的 out 参数支持和参数别名,并相应删除了不再需要的 PyTorch API 差异对比文档。
主要变更包括:
- 为 15 个 Paddle API 添加了
out参数支持(作为关键字参数) - 为这些 API 的参数添加了 PyTorch 兼容的别名(如
input、other、values、diagonal) - 删除了 19 个 PyTorch 与 Paddle API 差异对比文档(因为差异已消除)
Reviewed changes
Copilot reviewed 34 out of 34 changed files in this pull request and generated 24 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.square.md | 删除 torch.square 与 paddle.square 的 API 差异文档 |
| docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.reciprocal.md | 删除 torch.reciprocal 与 paddle.reciprocal 的 API 差异文档 |
| docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nextafter.md | 删除 torch.nextafter 与 paddle.nextafter 的 API 差异文档 |
| docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.heaviside.md | 删除 torch.heaviside 与 paddle.heaviside 的 API 差异文档 |
| docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fmin.md | 删除 torch.fmin 与 paddle.fmin 的 API 差异文档 |
| docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fmax.md | 删除 torch.fmax 与 paddle.fmax 的 API 差异文档 |
| docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.diag.md | 删除 torch.diag 与 paddle.diag 的 API 差异文档 |
| docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.atan.md | 删除 torch.atan 与 paddle.atan 的 API 差异文档 |
| docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.asinh.md | 删除 torch.asinh 与 paddle.asinh 的 API 差异文档 |
| docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.angle.md | 删除 torch.angle 与 paddle.angle 的 API 差异文档 |
| docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.tan.md | 删除 torch.tan 与 paddle.tan 的参数名差异文档 |
| docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.bitwise_xor.md | 删除 torch.bitwise_xor 与 paddle.bitwise_xor 的参数名差异文档 |
| docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.bitwise_not.md | 删除 torch.bitwise_not 与 paddle.bitwise_not 的参数名差异文档 |
| docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.bitwise_and.md | 删除 torch.bitwise_and 与 paddle.bitwise_and 的参数名差异文档 |
| docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.bincount.md | 删除 torch.bincount 与 paddle.bincount 的参数名差异文档 |
| docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.bitwise_xor_.md | 删除 torch.Tensor.bitwise_xor_ 与 paddle.Tensor.bitwise_xor_ 的参数名差异文档 |
| docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.bitwise_xor.md | 删除 torch.Tensor.bitwise_xor 与 paddle.Tensor.bitwise_xor 的参数名差异文档 |
| docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.bitwise_and_.md | 删除 torch.Tensor.bitwise_and_ 与 paddle.Tensor.bitwise_and_ 的参数名差异文档 |
| docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.bitwise_and.md | 删除 torch.Tensor.bitwise_and 与 paddle.Tensor.bitwise_and 的参数名差异文档 |
| docs/api/paddle/tan_cn.rst | 添加 out 参数和 input 别名 |
| docs/api/paddle/square_cn.rst | 添加 out 参数和 input 别名 |
| docs/api/paddle/reciprocal_cn.rst | 添加 out 参数和 input 别名 |
| docs/api/paddle/nextafter_cn.rst | 添加 out 参数以及 input、other 别名 |
| docs/api/paddle/heaviside_cn.rst | 添加 out 参数以及 input、values 别名 |
| docs/api/paddle/fmin_cn.rst | 添加 out 参数以及 input、other 别名 |
| docs/api/paddle/fmax_cn.rst | 添加 out 参数以及 input、other 别名 |
| docs/api/paddle/diag_cn.rst | 添加 input、diagonal 别名(未添加 out 参数,可能因为已有特殊处理) |
| docs/api/paddle/bitwise_xor_cn.rst | 调整参数顺序,将 out 改为关键字参数,添加 input、other 别名 |
| docs/api/paddle/bitwise_not_cn.rst | 调整参数顺序,将 out 改为关键字参数,添加 input 别名 |
| docs/api/paddle/bitwise_and_cn.rst | 调整参数顺序,将 out 改为关键字参数,添加 input、other 别名 |
| docs/api/paddle/bincount_cn.rst | 添加 input 别名 |
| docs/api/paddle/atan_cn.rst | 添加 input 别名(未添加 out 参数,可能因为已有特殊处理) |
| docs/api/paddle/asinh_cn.rst | 添加 out 参数和 input 别名 |
| docs/api/paddle/angle_cn.rst | 添加 out 参数和 input 别名 |
| - **x** (Tensor)- 输入的 Tensor。数据类型为 ``bfloat16`` 、 ``float16`` 、 ``float32`` 、 ``float64`` 、 ``int32`` 或 ``int64`` 。别名 ``input`` 。 | ||
| - **y** (Tensor)- 输入的 Tensor。数据类型为 ``bfloat16`` 、 ``float16`` 、 ``float32`` 、 ``float64`` 、 ``int32`` 或 ``int64`` 。别名 ``other`` 。 |
Copilot
AI
Dec 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
中文和英文之间缺少空格。应该将 别名 ``input``` 和 别名 other``` 改为 `别名:input 和 `别名:``other,以符合文档书写规范。
| - **x** (Tensor) - 输入的 `Tensor`。它的形状可以是一维或二维。其数据类型应为 float16、float32、float64、int32、int64、complex64、complex128。别名 ``input`` 。 | ||
| - **offset** (int,可选) - 对角线偏移量。正值表示上对角线,0 表示主对角线,负值表示下对角线。默认值为 0。别名 ``diagonal`` 。 |
Copilot
AI
Dec 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
中文和英文之间缺少空格。应该将 别名 ``input``` 和 别名 diagonal``` 改为 `别名:input 和 `别名:``diagonal,以符合文档书写规范。
|
|
||
| - **x** (Tensor)- 输入的 N-D `Tensor`,数据类型为:bool,uint8,int8,int16,int32,int64。 | ||
| - **out** (Tensor,可选)- 输出的结果 `Tensor`,是与输入数据类型相同的 N-D `Tensor`。默认值为 None,此时将创建新的 Tensor 来保存输出结果。 | ||
| - **x** (Tensor)- 输入的 N-D `Tensor`,数据类型为:bool,uint8,int8,int16,int32,int64。别名 ``input``。 |
Copilot
AI
Dec 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
中文和英文之间缺少空格。应该将 别名 ``input``` 改为 别名:``input```,以符合文档书写规范。
| - **x** (Tensor)- 输入的 N-D `Tensor`,数据类型为:bool,uint8,int8,int16,int32,int64。别名 ``input``。 | ||
| - **y** (Tensor)- 输入的 N-D `Tensor`,数据类型为:bool,uint8,int8,int16,int32,int64。别名 ``other``。 |
Copilot
AI
Dec 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
中文和英文之间缺少空格。应该将 别名 ``input``` 和 别名 other``` 改为 `别名:input 和 `别名:``other,以符合文档书写规范。
|
|
||
| 关键字参数 | ||
| ::::::::: | ||
| - **out** (Tensor,可选) - 输出 Tensor,若不为 ``None``,计算结果将保存在该 Tensor 中,默认值为 ``None``。 |
Copilot
AI
Dec 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
中文和英文之间缺少空格。应该将 若不为 ``None``` 改为 若不为 None```(在 None`` 前添加空格),以符合文档书写规范中关于中英文间需要空格分隔的要求。
|
|
||
| 关键字参数 | ||
| ::::::::: | ||
| - **out** (Tensor,可选) - 输出 Tensor,若不为 ``None``,计算结果将保存在该 Tensor 中,默认值为 ``None``。 |
Copilot
AI
Dec 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
中文和英文之间缺少空格。应该将 若不为 ``None``` 改为 若不为 None```(在 None`` 前添加空格),以符合文档书写规范中关于中英文间需要空格分隔的要求。
|
|
||
| 关键字参数 | ||
| ::::::::: | ||
| - **out** (Tensor,可选) - 输出 Tensor,若不为 ``None``,计算结果将保存在该 Tensor 中,默认值为 ``None``。 |
Copilot
AI
Dec 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
中文和英文之间缺少空格。应该将 若不为 ``None``` 改为 若不为 None```(在 None`` 前添加空格),以符合文档书写规范中关于中英文间需要空格分隔的要求。
| 参数 | ||
| ::::::::: | ||
| - **x** (Tensor) - 该 OP 的输入为 Tensor。数据类型为 float32,float64,complex64,complex128。别名 ``input``。 |
Copilot
AI
Dec 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
中文和英文之间缺少空格。应该将 别名 ``input``` 改为 别名:``input```,以符合文档书写规范中关于中英文间需要空格分隔的要求。此外,建议在"别名"后添加冒号以保持一致性。
| - **x** (Tensor)- 输入的 N-D `Tensor`,数据类型为:bool,uint8,int8,int16,int32,int64。别名 ``input``。 | ||
| - **y** (Tensor)- 输入的 N-D `Tensor`,数据类型为:bool,uint8,int8,int16,int32,int64。别名 ``other``。 |
Copilot
AI
Dec 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
中文和英文之间缺少空格。应该将 别名 ``input``` 和 别名 other``` 改为 `别名:input 和 `别名:``other,以符合文档书写规范。
| - **x** (Tensor) - 赫维赛德阶跃函数的输入 Tensor。数据类型为 bfloat16、float16、float32、float64、int32 或 int64。别名 ``input``。 | ||
| - **y** (Tensor) - 决定了一个赫维赛德阶跃函数的 Tensor。数据类型为 bfloat16、float16、float32、float64、int32 或 int64。别名 ``values``。 |
Copilot
AI
Dec 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
中文和英文之间缺少空格。应该将 别名 ``input``` 和 别名 values``` 改为 `别名:input 和 `别名:``values,以符合文档书写规范。
本文档均基于AI Agent自动生成,确保了代码风格和实现的一致性。Agent所使用编程规则详见 PaddlePaddle/Paddle#77161