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. 59 #5857

Merged
merged 3 commits into from
May 9, 2023
Merged

映射文档 No. 59 #5857

merged 3 commits into from
May 9, 2023

Conversation

wenyin
Copy link
Contributor

@wenyin wenyin commented May 5, 2023

完成 #5691 中No.59的文档映射工作,其中新增9个api映射文档,有问题请联系

@paddle-bot
Copy link

paddle-bot bot commented May 5, 2023

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

@wenyin
Copy link
Contributor Author

wenyin commented May 6, 2023

@Tomoko-hjf 您好!麻烦审查一下,有问题我再修改,谢谢~

Copy link
Collaborator

@Skylark-hjyp Skylark-hjyp left a comment

Choose a reason for hiding this comment

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

统一将pytorch链接换为 1.13 版本下的吧~

@@ -0,0 +1,33 @@
## [ torch 参数更多 ] torch.Tensor.bernoulli

### [torch.Tensor.bernoulli](https://pytorch.org/docs/stable/generated/torch.Tensor.bernoulli.html#torch-tensor-bernoulli)
Copy link
Collaborator

Choose a reason for hiding this comment

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

pytorch链接需要是 1.13 版本下的链接 ,其余文件也辛苦修改一下
image

paddle.bernoulli(x, name=None)
```

其中 torch 是类成员函数,而 paddle 是非类成员函数,因此第一个参数 `x` 不进行对比,Pytorch 相比 Paddle 支持更多其他参数,具体如下:
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 支持更多其他参数,具体如下:即可,前面那句话可以不用写~

@@ -0,0 +1,33 @@
## [ torch 参数更多 ] torch.Tensor.bfloat16

### [torch.Tensor.bfloat16](https://pytorch.org/docs/stable/generated/torch.Tensor.bfloat16.html#torch-tensor-bfloat16)
Copy link
Collaborator

Choose a reason for hiding this comment

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

链接改为 1.13 版本下的~

| PyTorch | PaddlePaddle | 备注 |
| ------------- | ------------ | ----------------------------------------------------------------------------------- |
| other | y | 表示输入的 Tensor ,仅参数名不一致。 |
| rounding_mode | - | 用于指定在执行截断除法时的舍入模式。可选值为 'floor'(向下取整) 或 'trunc'(截断)。Paddle 无此功能,暂无转写方式。|
Copy link
Collaborator

Choose a reason for hiding this comment

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

trunc可以写为 向零取整
这里可以通过paddle.trunc()和paddle.floor()转写完成

import paddle
a = paddle.to_tensor([0.9, 1.2])
b = paddle.to_tensor([-0.2, 0.7])
res1 = a.divide(b).trunc()  # 向零取整
res2 = a.divide(b).floor()  # 向下取整
print(res1)
print(res2)

| PyTorch | PaddlePaddle | 备注 |
| ------------- | ------------ | ----------------------------------------------------------------------------------- |
| other | y | 表示输入的 Tensor ,仅参数名不一致。 |
| rounding_mode | - | 用于指定在执行截断除法时的舍入模式。可选值为 'floor'(向下取整) 或 'trunc'(截断)。Paddle 无此功能,暂无转写方式。|
Copy link
Collaborator

Choose a reason for hiding this comment

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

和上面一个转写方式一样

@Skylark-hjyp
Copy link
Collaborator

缺失一个文档是已经存在了吗,如果没有对应功能,可以在评论中说明是哪个api

@wenyin
Copy link
Contributor Author

wenyin commented May 6, 2023

@Tomoko-hjf 您好!上述您说的问题我都已经进行了修改,其中torch.Tensor.copy_的映射文档已经存在了,其他的麻烦您审查,谢谢~

@wenyin
Copy link
Contributor Author

wenyin commented May 6, 2023

@Tomoko-hjf 您好!我又检查了torch.Tensor.copy_已存在的映射文档,更新了链接和文档格式,请审查,谢谢~

Copy link
Collaborator

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

@wenyin
Copy link
Contributor Author

wenyin commented May 8, 2023

@zhwesky2010 您好!麻烦您审查,谢谢~

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 4da15bc into PaddlePaddle:develop May 9, 2023
@luotao1
Copy link
Collaborator

luotao1 commented May 10, 2023

hi, @wenyin

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

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

* 映射文档 No. 59

* 映射文档 No. 59
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.

4 participants