-
Notifications
You must be signed in to change notification settings - Fork 766
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.16/17/18/19 #5955
Merged
Merged
映射文档 No.16/17/18/19 #5955
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9ccddbc
文档映射 16~19
Li-fAngyU 415c568
增加 torch.searchsorted 参数设置 sorter 时的转写示例。
Li-fAngyU c19781d
修复gather, searchsorted 转写示例中的错误。
Li-fAngyU 0e77827
fix error.
Li-fAngyU d36b4d7
fix error
Li-fAngyU 1678dfc
Revert "fix error"
Li-fAngyU 393147d
Update torch.cummin.md
Li-fAngyU 5194897
update for cummin and searchsorted
Li-fAngyU 01b5a81
Update torch.searchsorted.md
Li-fAngyU 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
40 changes: 40 additions & 0 deletions
40
docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.cummin.md
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
## [ torch 参数更多 ]torch.cummin | ||
|
||
### [torch.cummin](https://pytorch.org/docs/stable/generated/torch.cummin.html) | ||
|
||
```python | ||
torch.cummin(input, | ||
dim, | ||
*, | ||
out=None) | ||
``` | ||
|
||
### [paddle.cummin](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/cummin_cn.html) | ||
|
||
```python | ||
paddle.cummin(x, | ||
axis=None, | ||
dtype='int64', | ||
name=None) | ||
``` | ||
|
||
两者功能一致,torch 参数更多,具体如下: | ||
|
||
### 参数映射 | ||
| PyTorch | PaddlePaddle | 备注 | | ||
| ------------- | ------------ | ------------------------------------------------------ | | ||
| input | x | 表示输入的 Tensor,仅参数名不一致。 | | ||
| dim | axis | 用于指定 index 获取输入的维度,仅参数名不一致。 | | ||
| - | dtype | 指定输出索引的数据格式,PyTorch 无此参数,Paddle 保持默认即可。 | | ||
| out | - | 表示输出的 Tensor,Paddle 无此参数,需要进行转写。 | | ||
|
||
### 转写示例 | ||
#### out:指定输出 | ||
|
||
```python | ||
# Pytorch 写法 | ||
torch.cummin(x,1, out=(values, indices)) | ||
|
||
# Paddle 写法 | ||
paddle.assign(paddle.cummin(x,1), (values, indices)) | ||
``` |
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
26 changes: 26 additions & 0 deletions
26
docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.vander.md
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
## [ 仅参数名不一致 ]torch.vander | ||
|
||
### [torch.vander](https://pytorch.org/docs/stable/generated/torch.vander.html?highlight=vander#torch.vander) | ||
|
||
```python | ||
torch.vander(x, | ||
N, | ||
increasing) | ||
``` | ||
|
||
### [paddle.vander](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/vander_cn.html#vander) | ||
|
||
```python | ||
paddle.vander(x, | ||
n, | ||
increasing) | ||
``` | ||
|
||
两者功能一致,仅参数名不一致,具体如下: | ||
|
||
### 参数映射 | ||
| PyTorch | PaddlePaddle | 备注 | | ||
| ------------- | ------------ | ------------------------------------------------------ | | ||
| x | x | 表示输入的 Tensor。 | | ||
| N | n | 用于指定输出的列数, 仅参数名大小写的区别。 | | ||
| increasing | increasing | 指定输出列的幂次顺序。如果为 True,则幂次从左到右增加。 | |
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.
有转写方式的话:加一个 需要转写
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.
好的,已修改。