Skip to content
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. 11 #5709

Merged
merged 44 commits into from
Apr 25, 2023
Merged

映射文档 No. 11 #5709

merged 44 commits into from
Apr 25, 2023

Conversation

Liyulingyue
Copy link
Contributor

@Liyulingyue Liyulingyue commented Mar 12, 2023

考虑部分函数为别名,对部分md文档的名称进行修改

#5691

@paddle-bot
Copy link

paddle-bot bot commented Mar 12, 2023

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

@Liyulingyue
Copy link
Contributor Author

@Tomoko-hjf

@@ -0,0 +1,35 @@
## [ 仅参数名不一致 ]torch.Tensor.gcd.md
Copy link
Collaborator

Choose a reason for hiding this comment

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

这里改成 torch 参数更多

@@ -0,0 +1,15 @@
## [ 仅参数名不一致 ]torch.all
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,33 @@
## [ 仅参数名不一致 ]torch.ge
Copy link
Collaborator

Choose a reason for hiding this comment

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

这里改成 torch 参数更多

@@ -0,0 +1,33 @@
## [ 仅参数名不一致 ]torch.gt
Copy link
Collaborator

Choose a reason for hiding this comment

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

这里改成 torch 参数更多

@@ -0,0 +1,33 @@
## [ 仅参数名不一致 ]torch.greater_equal
Copy link
Collaborator

Choose a reason for hiding this comment

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

这里改成 torch 参数更多

@@ -0,0 +1,30 @@
## [ 仅参数名不一致 ]torch.histc
Copy link
Collaborator

Choose a reason for hiding this comment

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

这里改成 torch 参数更多

### 参数映射
| PyTorch | PaddlePaddle | 备注 |
|-----------------------------------|------------------------------| ------------------------------------------------------ |
| <font color='red'> out </font> | - | 表示输出的 Tensor,PaddlePaddle 无此参数,需要进行转写。 |
Copy link
Collaborator

Choose a reason for hiding this comment

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

辛苦把 input ,bin min max 也补充一下~

### 参数差异
| PyTorch | PaddlePaddle | 备注 |
| ------------- | ------------ | ------------------------------------------------------ |
| input | x | 输入的 Tensor。 |
Copy link
Collaborator

Choose a reason for hiding this comment

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

辛苦把 lambd 补充一下 ~

@@ -0,0 +1,36 @@
## [ 仅参数名不一致 ]torch.outer
Copy link
Collaborator

Choose a reason for hiding this comment

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

这里改成 torch 参数更多

@@ -0,0 +1,33 @@
## [ 仅参数名不一致 ]torch.ge

### [torch.ge](https://pytorch.org/docs/1.13/generated/torch.ge.html#torch.ge)
Copy link
Collaborator

Choose a reason for hiding this comment

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

确认了一下,torch.Tensor.ge 还是保持原来的吧,torch.ge也会实现一份(放在ops文件夹下),但是会由别的分组写。所以这 10个API 还是都放在 Tensor 文件夹下吧。剩下的也请修改一下~

@Liyulingyue
Copy link
Contributor Author

@Tomoko-hjf fixed,可以再次review~

Copy link
Collaborator

@huajiao-hjyp huajiao-hjyp left a comment

Choose a reason for hiding this comment

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

有一个共性问题,paddle.Tensor.xxx方法大都写成了paddle.xxx方法,可以参考已经合并的PR:#5733
如果在Tensor页面没有找到相应的api介绍,链接直接置为空即可
辛苦修改一下~

@@ -0,0 +1,35 @@
## [ torch 参数更多 ]torch.Tensor.gcd.md
Copy link
Collaborator

Choose a reason for hiding this comment

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

.md 可以删去~

@@ -0,0 +1,35 @@
## [ torch 参数更多 ]torch.Tensor.gcd.md

同 torch.gcd
Copy link
Collaborator

Choose a reason for hiding this comment

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

这句话也删去吧,保持风格统一

torch.Tensor.gcd(input, other, *, out=None)
```

### [paddle.gcd(x, y, name=None)](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/gcd_cn.html)
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个对应的应该是paddle.Tensor.gcd(y)吧,参考链接 https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/Tensor_cn.html#gcd-x-y-name-none,官网好像写错了,可以这样调用

import paddle
x1 = paddle.to_tensor(12)
x2 = paddle.to_tensor(20)
res = x1.gcd(x2)

### [paddle.greater_equal](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/greater_equal_cn.html#greater-equal)

```python
paddle.greater_equal(x, y, name=None)
Copy link
Collaborator

Choose a reason for hiding this comment

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

这里可以调用 paddle.Tensor.greater_equal,参考链接 https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/Tensor_cn.html#greater-equal-y-name-none
这样分类就属于仅参数名不一致,其他的也都需要修改一下~

torch.Tensor.gcd(other)
```

### [paddle.Tensor.gcd(x, y, name=None)](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/Tensor_cn.html#gcd-x-y-name-none)
Copy link
Collaborator

Choose a reason for hiding this comment

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

这里的标题可以去掉(x, y, name=None) ~

@Liyulingyue
Copy link
Contributor Author

@Tomoko-hjf 可以再次看看~

@Liyulingyue
Copy link
Contributor Author

@Tomoko-hjf 可以再次看看~

paddle.Tensor.histogram(bins=100, min=0, max=0, name=None)
```

两者功能一致且参数完全一致。
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.

done~

Copy link
Collaborator

@huajiao-hjyp huajiao-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

@zhwesky2010 zhwesky2010 merged commit 23e54b4 into PaddlePaddle:develop Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants