-
Notifications
You must be signed in to change notification settings - Fork 762
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
映射文档 No.72 #5869
映射文档 No.72 #5869
Conversation
感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-5869.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/index_cn.html |
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.
对于多个输出的情况,比如torch.linalg.lu,三个输出值是不能通过paddle.assign赋值的,可以改为 P, L, U = paddle.linalg.triangular_solve(A)
相应pytorch 代码改为 torch.linalg.solve_triangular(A, out=(P, L, U))
@@ -0,0 +1,33 @@ | |||
## [ torch 参数更多 ]torch.Tensor.arctan2 |
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.
修改完api签名之后,除去第一个参数后,只有参数名不一致,所以分类名写为 仅参数名不一致
吧
### [torch.Tensor.arctan2](https://pytorch.org/docs/1.13/generated/torch.arctan2.html#torch.arctan2) | ||
|
||
```python | ||
torch.Tensor.arctan2(self, other, *, out=None) |
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.
这里的签名写成 torch.Tensor.arctan2(other)
即可,可以参考已经合并的PR #5778 和格式文档 https://github.com/PaddlePaddle/docs/blob/develop/docs/guides/model_convert/convert_from_pytorch/api_difference/pytorch_api_mapping_format_cn.md
paddle.atan2(x, y, name=None) | ||
``` | ||
|
||
Pytorch 相比 Paddle 支持更多其他参数,具体如下: |
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.
这句话需要修改为 两者功能一致且参数用法一致,仅参数名不一致,具体如下:
| other | y | 表示输入的 Tensor ,仅参数名不一致。 | | ||
| out | - | 表示输出的 Tensor , Paddle 无此参数,需要进行转写。 | | ||
|
||
### 转写示例 |
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.
修改之后不需要转写示例了~
| PyTorch | PaddlePaddle | 备注 | | ||
| ----------------------------------- | ------------ | ----------------------------------------------------------------------- | | ||
| self | x | 表示输入的 Tensor ,仅参数名不一致。 | | ||
| other | y | 表示输入的 Tensor ,仅参数名不一致。 | |
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.
参数映射部分只写 other 即可
### [torch.Tensor.cdouble](https://pytorch.org/docs/1.13/generated/torch.Tensor.cdouble.html?highlight=torch+tensor+cdouble#torch.Tensor.cdouble) | ||
|
||
```python | ||
Tensor.cdouble(memory_format=torch.preserve_format) |
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.
签名前面加一个torch吧, 即 torch.Tensor.xxx
Tensor.cdouble(memory_format=torch.preserve_format) | ||
``` | ||
|
||
### [paddle.Tensor.astype('complex128')](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/Tensor_cn.html#astype-dtype) |
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.
这里直接写 paddle.Tensor.astype
即可
Tensor.cfloat(memory_format=torch.preserve_format) | ||
``` | ||
|
||
### [paddle.Tensor.astype('complex64')](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/Tensor_cn.html#astype-dtype) |
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.
可以直接写 paddle.Tensor.astype,这里先不需要写complex64
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.
谢谢您的指点与回复,我已经全部修改,劳烦您继续审核。
| ----------------------------------- | ------------ | ----------------------------------------------------------------------- | | ||
| A | x | 表示需要进行 LU 分解的输入 Tensor ,仅参数名不一致。 | | ||
| pivot | pivot | 表示 LU 分解时是否进行旋转。 | | ||
| - | get_infos | 表示是否返回分解状态信息。 | |
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.
这里的备注加一句 Paddle 保持默认即可
~
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.
您好,已经修改了,麻烦您继续审核
| A | x | 表示线性方程组左边的系数 Tensor ,仅参数名不一致。 | | ||
| B | y | 表示线性方程组右边的 Tensor ,仅参数名不一致。 | | ||
| upper | upper | 表示对系数 Tensor 取上三角还是下三角。 | | ||
| left | transpose | 表示是否对系数 Tensor 进行转置。 | |
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.
这里的备注加一句 仅参数名不一致。
吧~
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.
辛苦您了!我已经添加了,麻烦您审核还有啥其他问题?
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.
LGTM
@zhwesky2010 您好,打扰您了,能麻烦您有时间审核一下吗? |
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.
LGTM
完成对映射文件No.72的工作。