forked from PaddlePaddle/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
映射文档 No.16/17/18/19 (PaddlePaddle#5955)
* 文档映射 16~19 * 增加 torch.searchsorted 参数设置 sorter 时的转写示例。 * 修复gather, searchsorted 转写示例中的错误。 * fix error. * fix error * Revert "fix error" This reverts commit d36b4d7. * Update torch.cummin.md * update for cummin and searchsorted * Update torch.searchsorted.md
- Loading branch information
Showing
5 changed files
with
93 additions
and
4 deletions.
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