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.48 torch.nn.RNNBase mapping #5973

Merged
merged 2 commits into from
Jul 11, 2023

Conversation

RedContritio
Copy link
Contributor

@RedContritio RedContritio commented Jun 26, 2023

@paddle-bot
Copy link

paddle-bot bot commented Jun 26, 2023

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

### 参数映射
| PyTorch | PaddlePaddle | 备注 |
| ------------- | ------------ | ------------------------------------------------------ |
| mode | mode | 表示 `RNN` 模型的类型,torch 取值为 `'LSTM', 'GRU', 'RNN_TANH', 'RNN_RELU`,paddle 取值为 `'SimpleRNN', 'LSTM', 'GRU`,需要转写。|
Copy link
Collaborator

@zhwesky2010 zhwesky2010 Jun 29, 2023

Choose a reason for hiding this comment

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

paddle的mode也是支持 'LSTM', 'GRU', 'RNN_TANH', 'RNN_RELU` 吧

Copy link
Contributor Author

Choose a reason for hiding this comment

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

paddle 的 'LSTM', 'GRU' 能正常接受,'RNN_TANH', 'RNN_RELU' 如果传入,会导致 self.activation 未定义出现错误。

https://github.com/PaddlePaddle/Paddle/blob/35b72e876b003c378ddbf7e9a0b92e7f3dc3416e/python/paddle/nn/layer/rnn.py#L1344C41-L1344C41

### 参数映射
| PyTorch | PaddlePaddle | 备注 |
| ------------- | ------------ | ------------------------------------------------------ |
| mode | mode | 表示 `RNN` 模型的类型,torch 取值为 `'LSTM', 'GRU', 'RNN_TANH', 'RNN_RELU`,paddle 取值为 `'LSTM', 'GRU'`,需要转写。|
Copy link
Collaborator

Choose a reason for hiding this comment

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

好的,这里有一个功能bug 应该是要支持'RNN_TANH', 'RNN_RELU'的,我们会修复

@zhwesky2010 zhwesky2010 merged commit 7046952 into PaddlePaddle:develop Jul 11, 2023
@RedContritio RedContritio deleted the paconvert_RNNBase branch July 11, 2023 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants