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

Update API convert #5723

Merged
merged 2 commits into from
Mar 14, 2023
Merged

Update API convert #5723

merged 2 commits into from
Mar 14, 2023

Conversation

Skylark-hjyp
Copy link
Collaborator

Update API convert

@paddle-bot
Copy link

paddle-bot bot commented Mar 14, 2023

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

@@ -1,4 +1,4 @@
## torch.nn.functional.cross_entropy
## [ 参数用法不一致 ]torch.nn.functional.cross_entropy
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_api_mapping.md保持一致

@@ -1,4 +1,4 @@
## torch.nn.functional.elu_
## [] 仅参数名不一致 torch.nn.functional.elu_
Copy link
Collaborator

Choose a reason for hiding this comment

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

放进方括号里

@@ -1,4 +1,4 @@
## torch.nn.functional.one_hot
## [ 参数用法不一致 ]torch.nn.functional.one_hot
Copy link
Collaborator

Choose a reason for hiding this comment

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

以后第1类统一在这5种选吧,可以补充到任务描述里:无参数、参数完全一致、仅参数名不一致、仅paddle参数更多、仅参数默认值不一致

这个是最后一种

| PyTorch | PaddlePaddle | 备注 |
| ------------- | ------------ | ------------------------------------------------------ |
| return_indices| return_mask | 如果设置为 True,则会与输出一起返回最大值的索引,默认为 False。 |
| output_size | output_size | 表示输出 Tensor 的大小。 |
| return_indices | return_mask | 如果设置为 True,则会与输出一起返回最大值的索引,默认为 False。 |
Copy link
Collaborator

Choose a reason for hiding this comment

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

仅参数名不一致

| PyTorch | PaddlePaddle | 备注 |
| ------------- | ------------ | ------------------------------------------------------ |
| return_indices| return_mask | 如果设置为 True,则会与输出一起返回最大值的索引,默认为 False。 |
| output_size | output_size | 表示输出 Tensor 的大小。 |
| return_indices | return_mask | 如果设置为 True,则会与输出一起返回最大值的索引,默认为 False。 |
Copy link
Collaborator

Choose a reason for hiding this comment

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

仅参数名不一致


| PyTorch | PaddlePaddle | 备注 |
| ------------- | ------------ | ------------------------------------------------------ |
| parameters | - | 表示要操作的 Tensor,Pytorch 属于原位操作,PaddlePaddle 无此参数,需要实例化之后在 optimizer 中设置才可以使用。 |
| clip_value | - | 表示裁剪梯度的范围,范围为 $[-clip_value, clip_vale]$,PaddlePaddle 的 max 参数可对应实现该参数功能。 |
| clip_value | max | 表示裁剪梯度的范围,范围为 $[-clip_value, clip_vale]$,PaddlePaddle 的 max 参数可对应实现该参数功能。 |
| - | max | 表示裁剪梯度的最大值,PyTorch 无此参数,Paddle 设置值与 torch 的 clip_value 参数保持一致。 |
Copy link
Collaborator

Choose a reason for hiding this comment

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

放上去了 这里就多了

@@ -1,4 +1,4 @@
## torch.nn.utils.remove_weight_norm
## [ 参数名不一致 ]torch.nn.utils.remove_weight_norm
Copy link
Collaborator

Choose a reason for hiding this comment

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

统一描述,五选一

@@ -1,4 +1,4 @@
## torch.nn.utils.spectral_norm
## [ 参数名不一致 ]torch.nn.utils.spectral_norm
Copy link
Collaborator

Choose a reason for hiding this comment

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

统一描述

@@ -1,4 +1,4 @@
## torch.utils.data.BatchSampler
## [paddle 参数更多 ]torch.utils.data.BatchSampler
Copy link
Collaborator

Choose a reason for hiding this comment

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

统一下描述

@@ -1,4 +1,4 @@
## torch.nn.utils.weight_norm
## [ 参数名不一致 ]torch.nn.utils.weight_norm
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
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.

先合入了,1个comment可以后面再改

@@ -17,7 +17,7 @@ torch.nn.Linear(in_features,
name=None)
```

其中 Pytorch 的 bias 与 Paddle 的 bias_attr 用法不一致,具体如下:
其中 Pytorch 的 `bias` 与 Paddle 的 `bias_attr` 用法不一致, Paddle 的 `bias_attr` 仅支持 `False`,具体如下:
Copy link
Collaborator

@zhwesky2010 zhwesky2010 Mar 14, 2023

Choose a reason for hiding this comment

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

这句内容,在下面表格,对应到某个参数里去描述

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.

2 participants