Skip to content

映射文档 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

Merged
merged 11 commits into from
May 12, 2023
Merged

映射文档 No.47 #5858

merged 11 commits into from
May 12, 2023

Conversation

Archor001
Copy link
Contributor

@Archor001 Archor001 commented May 5, 2023

完成 #5691 中No.47的文档映射工作,新增了9个api映射文档到api_difference/ops目录下。(No.47中的API:torch.cholesky_solve已经存在)

@paddle-bot
Copy link

paddle-bot bot commented May 5, 2023

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

@paddle-bot
Copy link

paddle-bot bot commented May 5, 2023

❌ The PR's message can't be empty.

@Archor001
Copy link
Contributor Author

完善 #5691 中No.47的文档映射工作,修改了其中9个api映射文档格式。

Copy link
Collaborator

@Fancy-hjyp Fancy-hjyp left a 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
Copy link
Collaborator

Choose a reason for hiding this comment

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

分类名改为 torch 参数更多 即可,下面的也改一下吧,和之前的命名保持统一

Copy link
Contributor Author

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 支持更多其他参数,具体如下:
Copy link
Collaborator

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],其中*为零或更大的批次尺寸,并且最里面的两个维度上的矩阵都应为对称的正定矩阵,仅参数名不一致。|
Copy link
Collaborator

Choose a reason for hiding this comment

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

可以在每个单元格内容前后敲几个空格,这样看着比较拥挤~

Copy link
Contributor Author

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 无此变量,需要进行转写。|
Copy link
Collaborator

Choose a reason for hiding this comment

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

没有的参数用横线-替代,备注中将变量改为参数,保持和之前风格的统一

Copy link
Contributor Author

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
Copy link
Collaborator

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 支持更多其他参数,具体如下:
Copy link
Collaborator

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 无此参数,需要进行转写。|
Copy link
Collaborator

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
Copy link
Collaborator

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 支持更多其他参数,具体如下:
Copy link
Collaborator

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 无此参数,一般对网络训练结果影响不大,可直接删除。|
Copy link
Collaborator

Choose a reason for hiding this comment

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

没有的参数用 - 替代

@Archor001
Copy link
Contributor Author

@Tomoko-hjf


### 转写示例

#### out: 缩并运算的结果
Copy link
Collaborator

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 没有此字段,需要进行转写。 |
Copy link
Collaborator

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'))
Copy link
Collaborator

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 无此字段,需要进行转写。 |
Copy link
Collaborator

Choose a reason for hiding this comment

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

Paddle 无此参数

@CLAassistant
Copy link

CLAassistant commented May 8, 2023

CLA assistant check
All committers have signed the CLA.

Copy link
Collaborator

@Fancy-hjyp Fancy-hjyp left a comment

Choose a reason for hiding this comment

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

LGTM

@Fancy-hjyp
Copy link
Collaborator

剩余的一个API是已经存在了吗,如果是暂无对应功能,可以PR描述中说明

@Archor001
Copy link
Contributor Author

是的,剩下的API已经存在了

Copy link
Collaborator

@zhwesky2010 zhwesky2010 left a comment

Choose a reason for hiding this comment

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

LGTM

@zhwesky2010 zhwesky2010 merged commit efcc54b into PaddlePaddle:develop May 12, 2023
@luotao1
Copy link
Collaborator

luotao1 commented May 16, 2023

hi, @Archor001

  • 非常感谢你对飞桨框架的贡献,我们正在运营一个PFCC组织,会通过定期分享技术知识与发布开发者主导任务的形式持续为飞桨框架做贡献,详情可见 https://github.com/luotao1 主页说明。
  • 如果你对PFCC有兴趣,请发送邮件至 ext_paddle_oss@baidu.com,我们会邀请你加入~

lijialin03 pushed a commit to lijialin03/Paddledocs that referenced this pull request May 16, 2023
* 映射文档 No.47

* 映射文档 No.47:规范格式

* 映射文档 No.47: 规范格式

* 映射文档 No.47: 修改不规范格式

* 映射文档 No.47: 修改格式

* 映射文档 No.47: 修改不规范格式

* 映射文档 No.47: 修改格式

* 映射文档 No.47: 修改不规范格式

* 映射文档 No.47: 修改不规范格式

* 映射文档 No.47: 修改格式
@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants