-
Notifications
You must be signed in to change notification settings - Fork 765
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
Fix API docs #7007
Merged
Merged
Fix API docs #7007
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
92427f9
fix-docs
Xuxuanang 736b09b
fix pi
Xuxuanang a91a4a3
fix pi
Xuxuanang 232cb91
fix docs
Xuxuanang 13b8bec
fix docs
Xuxuanang 832dc59
fix docs
Xuxuanang 299d8a1
fix bugs
Xuxuanang 02e9bd4
fix docs
Xuxuanang b0bb3a8
fix docs
Xuxuanang 07408df
fix docs
Xuxuanang 800ee3f
fix-docs
Xuxuanang 0b21fbf
fix docs
Xuxuanang 0d23f18
fix tools
Xuxuanang 8912950
resolve conflict
Xuxuanang 44624c4
resolve conflict
Xuxuanang 6c549e2
resubmit
Xuxuanang 097a752
resubmit
Xuxuanang 7039c42
Merge branch 'PaddlePaddle:develop' into fix-docs
Xuxuanang ba90b4a
fix docs
Xuxuanang d14b7b2
Merge branch 'PaddlePaddle:develop' into fix-docs
Xuxuanang f9547fb
Merge branch 'PaddlePaddle:develop' into fix-docs
Xuxuanang 17fb9e4
fix-docs
Xuxuanang eef8196
fix docs
Xuxuanang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ torch.nn.RNNCell(input_size, hidden_size, bias=True, nonlinearity='tanh', device | |
paddle.nn.SimpleRNNCell(input_size, hidden_size, activation='tanh', weight_ih_attr=None, weight_hh_attr=None, bias_ih_attr=None, bias_hh_attr=None, name=None) | ||
``` | ||
|
||
两者功能一致但输入参数用法不一致,且返回参数类型不同,具体如下: | ||
两者功能一致但输入参数用法不一致,且返回参数个数不同,具体如下: | ||
### 参数映射 | ||
|
||
| PyTorch | PaddlePaddle | 备注 | | ||
|
@@ -20,6 +20,7 @@ paddle.nn.SimpleRNNCell(input_size, hidden_size, activation='tanh', weight_ih_at | |
| nonlinearity | activation | 表示激活函数类型,仅参数名不一致。 | | ||
| - |weight_ih_attr| weight_ih 的参数, PyTorch 无此参数, Paddle 保持默认即可。 | | ||
| - |weight_hh_attr| weight_hh 的参数, PyTorch 无此参数, Paddle 保持默认即可。 | | ||
| forward 类方法返回值 |forward 类方法返回值 | PyTorch 的返回值为更新后的隐藏状态 ret, Paddle 返回值为 ret、 ret, 需要转写。 | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 返回了两个一模一样的ret吗 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 是的 |
||
|
||
### 转写示例 | ||
#### bias:是否使用偏置 | ||
|
@@ -37,6 +38,7 @@ paddle.nn.SimpleRNNCell(16, 32, bias_ih_attr=False, bias_hh_attr=False) | |
``` | ||
#### forward 类方法:前向传播 | ||
```python | ||
# 返回值个数不一致,Paddle 返回值比 Pytorch 多一个 | ||
# PyTorch 写法 | ||
rnn = torch.nn.RNNCell(2, 2) | ||
result = rnn(inp, h0) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
返回了两个ret吗
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.
是的