-
Notifications
You must be signed in to change notification settings - Fork 752
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
映射文档 No. 59 #5857
Conversation
感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-5857.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/index_cn.html |
@Tomoko-hjf 您好!麻烦审查一下,有问题我再修改,谢谢~ |
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链接换为 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) |
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.bernoulli(x, name=None) | ||
``` | ||
|
||
其中 torch 是类成员函数,而 paddle 是非类成员函数,因此第一个参数 `x` 不进行对比,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.
直接写 其中 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) |
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.
链接改为 1.13 版本下的~
| PyTorch | PaddlePaddle | 备注 | | ||
| ------------- | ------------ | ----------------------------------------------------------------------------------- | | ||
| other | y | 表示输入的 Tensor ,仅参数名不一致。 | | ||
| rounding_mode | - | 用于指定在执行截断除法时的舍入模式。可选值为 'floor'(向下取整) 或 'trunc'(截断)。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.
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 无此功能,暂无转写方式。| |
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 |
@Tomoko-hjf 您好!上述您说的问题我都已经进行了修改,其中torch.Tensor.copy_的映射文档已经存在了,其他的麻烦您审查,谢谢~ |
@Tomoko-hjf 您好!我又检查了torch.Tensor.copy_已存在的映射文档,更新了链接和文档格式,请审查,谢谢~ |
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
hi, @wenyin
|
* 映射文档 No. 59 * 映射文档 No. 59 * 映射文档 No. 59
完成 #5691 中No.59的文档映射工作,其中新增9个api映射文档,有问题请联系