-
Notifications
You must be signed in to change notification settings - Fork 764
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add new docs * fix torch.digamma.md * fix bugs * fix examples
- Loading branch information
1 parent
3f3b6c0
commit 4e0381e
Showing
10 changed files
with
197 additions
and
38 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.digamma.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,30 @@ | ||
## [ torch 参数更多 ]torch.digamma | ||
### [torch.digamma](https://pytorch.org/docs/1.13/generated/torch.digamma.html?highlight=torch+digamma#torch.digamma) | ||
```python | ||
torch.digamma(input, | ||
*, | ||
out=None) | ||
``` | ||
|
||
### [paddle.digamma](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/digamma_cn.html) | ||
```python | ||
paddle.digamma(x, | ||
name=None) | ||
``` | ||
|
||
其中 Pytorch 相比 Paddle 支持更多其他参数,具体如下: | ||
### 参数映射 | ||
| PyTorch | PaddlePaddle | 备注 | | ||
| ------------- | ------------ | ------------------------------------------------------ | | ||
| input | x | 表示输入的 Tensor ,仅参数名不一致。 | | ||
| out | - | 表示输出的 Tensor , Paddle 无此参数,需要进行转写。 | | ||
|
||
### 转写示例 | ||
#### out:指定输出 | ||
```python | ||
# Pytorch 写法 | ||
torch.digamma(torch.tensor([[1, 1.5], [0, -2.2]]), out=y) | ||
|
||
# Paddle 写法 | ||
paddle.assign(paddle.digamma(paddle.to_tensor([[1, 1.5], [0, -2.2]], dtype='float32')), y) | ||
``` |
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
32 changes: 32 additions & 0 deletions
32
docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.erfinv.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,32 @@ | ||
## [ torch 参数更多 ]torch.erfinv | ||
### [torch.erfinv](https://pytorch.org/docs/1.13/generated/torch.erfinv.html?highlight=torch+erfinv#torch.erfinv) | ||
|
||
```python | ||
torch.erfinv(input, | ||
*, | ||
out=None) | ||
``` | ||
|
||
### [paddle.erfinv](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/erfinv_cn.html) | ||
|
||
```python | ||
paddle.erfinv(x, | ||
name=None) | ||
``` | ||
|
||
其中 Pytorch 相比 Paddle 支持更多其他参数,具体如下: | ||
### 参数映射 | ||
| PyTorch | PaddlePaddle | 备注 | | ||
| ------------- | ------------ | ------------------------------------------------------ | | ||
| input | x | 表示输入的 Tensor ,仅参数名不一致。 | | ||
| out | - | 表示输出的 Tensor , Paddle 无此参数,需要进行转写。 | | ||
|
||
### 转写示例 | ||
#### out:指定输出 | ||
```python | ||
# Pytorch 写法 | ||
torch.erfinv(torch.tensor([0, 0.5, -1.]), out=y) | ||
|
||
# Paddle 写法 | ||
paddle.assign(paddle.erfinv(paddle.to_tensor([0, 0.5, -1.], dtype="float32")), y) | ||
``` |
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
33 changes: 33 additions & 0 deletions
33
docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.expm1.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,33 @@ | ||
## [ torch 参数更多 ]torch.expm1 | ||
### [torch.expm1](https://pytorch.org/docs/1.13/generated/torch.expm1.html?highlight=torch+expm1#torch.expm1) | ||
|
||
```python | ||
torch.expm1(input, | ||
*, | ||
out=None) | ||
``` | ||
|
||
### [paddle.expm1](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/expm1_cn.html) | ||
|
||
```python | ||
paddle.expm1(x, | ||
name=None) | ||
``` | ||
|
||
其中 Pytorch 相比 Paddle 支持更多其他参数,具体如下: | ||
### 参数映射 | ||
| PyTorch | PaddlePaddle | 备注 | | ||
| ------------- | ------------ | ------------------------------------------------------ | | ||
| input | x | 表示输入的 Tensor ,仅参数名不一致。 | | ||
| out | - | 表示输出的 Tensor , Paddle 无此参数,需要进行转写。 | | ||
|
||
|
||
### 转写示例 | ||
#### out:指定输出 | ||
```python | ||
# Pytorch 写法 | ||
torch.expm1(torch.tensor([-0.4, -0.2, 0.1, 0.3]), out=y) | ||
|
||
# Paddle 写法 | ||
paddle.assign(paddle.expm1(paddle.to_tensor([-0.4, -0.2, 0.1, 0.3])), y) | ||
``` |
32 changes: 32 additions & 0 deletions
32
docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.fix.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,32 @@ | ||
## [ torch 参数更多 ]torch.fix | ||
### [torch.fix](https://pytorch.org/docs/1.13/generated/torch.fix.html?highlight=torch+fix#torch.fix) | ||
|
||
```python | ||
torch.fix(input, | ||
*, | ||
out=None) | ||
``` | ||
|
||
### [paddle.trunc](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/trunc_cn.html) | ||
|
||
```python | ||
paddle.trunc(input, | ||
name=None) | ||
``` | ||
|
||
其中 Pytorch 相比 Paddle 支持更多其他参数,具体如下: | ||
### 参数映射 | ||
| PyTorch | PaddlePaddle | 备注 | | ||
| ------------- | ------------ | ------------------------------------------------------ | | ||
| input | input | 表示输入的 Tensor。 | | ||
| out | - | 表示输出的 Tensor , Paddle 无此参数,需要进行转写。 | | ||
|
||
### 转写示例 | ||
#### out:指定输出 | ||
```python | ||
# Pytorch 写法 | ||
torch.fix(input, out=y) | ||
|
||
# Paddle 写法 | ||
paddle.assign(paddle.trunc(input), y) | ||
``` |
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
32 changes: 32 additions & 0 deletions
32
docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.trunc.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,32 @@ | ||
## [ torch 参数更多 ]torch.trunc | ||
### [torch.trunc](https://pytorch.org/docs/1.13/generated/torch.trunc.html?highlight=torch+trunc#torch.trunc) | ||
|
||
```python | ||
torch.trunc(input, | ||
*, | ||
out=None) | ||
``` | ||
|
||
### [paddle.trunc](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/trunc_cn.html) | ||
|
||
```python | ||
paddle.trunc(input, | ||
name=None) | ||
``` | ||
|
||
其中 Pytorch 相比 Paddle 支持更多其他参数,具体如下: | ||
### 参数映射 | ||
| PyTorch | PaddlePaddle | 备注 | | ||
| ------------- | ------------ | ------------------------------------------------------ | | ||
| input | input | 表示输入的 Tensor。 | | ||
| out | - | 表示输出的 Tensor , Paddle 无此参数,需要进行转写。 | | ||
|
||
### 转写示例 | ||
#### out:指定输出 | ||
```python | ||
# Pytorch 写法 | ||
torch.trunc(input, out=y) | ||
|
||
# Paddle 写法 | ||
paddle.assign(paddle.trunc(input), y) | ||
``` |