-
Notifications
You must be signed in to change notification settings - Fork 714
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
【Hackathon 7th No.39】为 Paddle 代码转换工具新增 API 转换规则(第 6 组) #6878
base: develop
Are you sure you want to change the base?
Conversation
Asthestarsfalll
commented
Sep 18, 2024
•
edited
Loading
edited
- 【Hackathon 7th】开源贡献个人挑战赛 Paddle#68244
感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-6878.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/index_cn.html |
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.
麻烦根据 文档模板规范https://github.com/PaddlePaddle/docs/blob/develop/docs/guides/model_convert/convert_from_pytorch/pytorch_api_mapping_format_cn.md , 一一核对并检查无误。
不符合文档规范,不予合入
...odel_convert/convert_from_pytorch/api_difference/functional/torch.nn.functional.lp_pool1d.md
Outdated
Show resolved
Hide resolved
...odel_convert/convert_from_pytorch/api_difference/functional/torch.nn.functional.lp_pool2d.md
Outdated
Show resolved
Hide resolved
...odel_convert/convert_from_pytorch/api_difference/functional/torch.nn.functional.lp_pool1d.md
Outdated
Show resolved
Hide resolved
...odel_convert/convert_from_pytorch/api_difference/functional/torch.nn.functional.lp_pool2d.md
Outdated
Show resolved
Hide resolved
.../model_convert/convert_from_pytorch/api_difference/nn/torch.nn.AdaptiveLogSoftmaxWithLoss.md
Outdated
Show resolved
Hide resolved
docs/guides/model_convert/convert_from_pytorch/api_difference/nn/torch.nn.Softmin.md
Show resolved
Hide resolved
docs/guides/model_convert/convert_from_pytorch/api_difference/nn/torch.nn.Softmin.md
Outdated
Show resolved
Hide resolved
...onvert/convert_from_pytorch/api_difference/nn/torch.nn.utils.parametrizations.weight_norm.md
Outdated
Show resolved
Hide resolved
...onvert/convert_from_pytorch/api_difference/nn/torch.nn.utils.parametrizations.weight_norm.md
Outdated
Show resolved
Hide resolved
docs/guides/model_convert/convert_from_pytorch/api_difference/optimizer/torch.optim.RAdam.md
Outdated
Show resolved
Hide resolved
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.
已按照文档要求更新,劳烦再审核下
docs/guides/model_convert/convert_from_pytorch/api_difference/nn/torch.nn.Softmin.md
Show resolved
Hide resolved
@Asthestarsfalll 映射文档有问题,未通过CI不予合入:
|
| dropout_p | dropout_p | `dropout` 的比例, 默认值为 0.00 即不进行正则化。 | | ||
| is_causal | is_causal | 是否启用因果关系, 默认值为 `False` 即不启用。 | | ||
| scale | - | 在softmax之前应用的缩放因子。默认与 Paddle 行为一致。Paddle 无此参数,暂无转写方式。 | | ||
| - | training | 是否处于训练阶段, 默认值为 `True` 即处于训练阶段。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.
这个取决于torch如何设置,不看paddle怎么设置。
如果torch的行为等同于training=True,那就写paddle保持默认即可。如果torch的行为等同于training=False,那可能这两个API无法直接映射,需要看一下有没有更好的组合方式。
### [paddle.nn.Pad3D](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/Pad3D_cn.html#pad3d) | ||
|
||
```python | ||
paddle.nn.Pad3D(padding, mode='constant', value=0.0, data_format='NCDHW', name=None) |
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.
mode应该是'circular'吧
| PyTorch | PaddlePaddle | 备注 | | ||
| ------------- | ------------ | ---------------------------------------------------------------------------- | | ||
| padding | padding | 填充大小。 | | ||
| - | mode | `padding` 的四种模式。PyTorch 无此参数,Paddle 应设置为 `constant`。 | |
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应设置为'circular'吧
|
||
# Paddle 写法 | ||
module = paddle.nn.Softmax(axis=1) | ||
module(-input) |
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 * input 吧,再加个注释强调一下