-
Notifications
You must be signed in to change notification settings - Fork 823
映射文档 No.47 #5858
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.47 #5858
Conversation
感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-5858.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/index_cn.html |
❌ The PR's message can't be empty. |
完善 #5691 中No.47的文档映射工作,修改了其中9个api映射文档格式。 |
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参数更多,和前面的文档保持一致
- pytorch 的链接要指定 1.13版本的,stable是2.0版本
- 一句话描述部分,应该是 其中 PyTorch 相比 Paddle 支持更多其他参数,具体如下:
- 参数映射部分,没有的参数要用-代替;每个单元格内容的前后加几个空格;统一改为Paddle无此参数
@@ -0,0 +1,35 @@ | |||
## [仅 torch 参数更多]torch.linalg.cholesky |
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 参数更多
即可,下面的也改一下吧,和之前的命名保持统一
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.linalg.cholesky(x,upper=False,name=None) | ||
``` | ||
|
||
其中 Paddle 相比 PyTorch 支持更多其他参数,具体如下: |
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 相比 Paddle 支持更多其他参数
### 参数映射 | ||
|PyTorch|PaddlePaddle|备注| | ||
| ------- | ------- | ------- | | ||
|A|x|表示输入变量为多维 Tensor,它的维度应该为 [*, M, N],其中*为零或更大的批次尺寸,并且最里面的两个维度上的矩阵都应为对称的正定矩阵,仅参数名不一致。| |
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.
已添加
| ------- | ------- | ------- | | ||
|A|x|表示输入变量为多维 Tensor,它的维度应该为 [*, M, N],其中*为零或更大的批次尺寸,并且最里面的两个维度上的矩阵都应为对称的正定矩阵,仅参数名不一致。| | ||
|upper|upper|表示是否返回上三角矩阵或下三角矩阵。| | ||
|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.
没有的参数用横线-
替代,备注中将变量
改为参数
,保持和之前风格的统一
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.
已修改
@@ -0,0 +1,37 @@ | |||
## [仅 torch 参数更多]torch.addmm |
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 参数更多
paddle.tril(input,diagonal=0,name=None) | ||
``` | ||
|
||
其中 Paddle 相比 PyTorch 支持更多其他参数,具体如下: |
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参数更多
| ------- | ------- | ------- | | ||
|input|input|表示输入的 Tensor 。| | ||
|diagonal|diagonal|表示指定的对角线,默认值是 0 ,表示主对角线。如果 diagonal > 0 ,表示主对角线之上的对角线;如果 diagonal < 0 ,表示主对角线之下的对角线。| | ||
|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.
没有的参数用 - 替代
@@ -0,0 +1,38 @@ | |||
## [仅 torch 参数更多]torch.tril_indices |
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 参数更多
paddle.tril_indices(row,col,offset=0,dtype='int64') | ||
``` | ||
|
||
其中 Paddle 相比 PyTorch 支持更多其他参数,具体如下: |
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 参数更多
|offset|offset| 表示从指定二维平面中获取对角线的位置。如果 offset = 0 ,取主对角线;如果 offset > 0 ,取主对角线右上的对角线;如果 offset < 0 ,取主对角线左下的对角线。| | ||
|dtype|dtype|表示输出张量的数据类型。| | ||
|device||表示 Tensor 存放设备位置,Paddle 无此参数,需要进行转写。| | ||
|layout||表示布局方式, 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.
没有的参数用 - 替代
@Tomoko-hjf |
|
||
### 转写示例 | ||
|
||
#### out: 缩并运算的结果 |
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.
和前面保持一致,改为 输出的Tensor
| ------- | ------- | ------- | | ||
| input | input | 表示输入的 Tensor 。 | | ||
| diagonal | diagonal | 指定的对角线,默认值为 0 ,表示主对角线。如果 diagonal > 0 ,表示主对角线之上的对角线;如果 diagonal < 0 ,表示主对角线之下的对角线。 | | ||
| 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.
没有此参数
|
||
```python | ||
# Pytorch 写法 | ||
>>> a = torch.triu_indices(row,col,offset,dtype,device=torch.device('cpu')) |
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.
把 >>> 删去吧,变量名改成统一的 y
| ------- | ------- | ------- | | ||
| input | x | 表示输入的第一个 Tensor ,仅参数名不一致。 | | ||
| mat2 | 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.
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.
LGTM
剩余的一个API是已经存在了吗,如果是暂无对应功能,可以PR描述中说明 |
是的,剩下的API已经存在了 |
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
hi, @Archor001
|
* 映射文档 No.47 * 映射文档 No.47:规范格式 * 映射文档 No.47: 规范格式 * 映射文档 No.47: 修改不规范格式 * 映射文档 No.47: 修改格式 * 映射文档 No.47: 修改不规范格式 * 映射文档 No.47: 修改格式 * 映射文档 No.47: 修改不规范格式 * 映射文档 No.47: 修改不规范格式 * 映射文档 No.47: 修改格式
完成 #5691 中No.47的文档映射工作,新增了9个api映射文档到api_difference/ops目录下。(No.47中的API:torch.cholesky_solve已经存在)