Skip to content

Commit a46693e

Browse files
authored
[Doc] 增加api_difference校验脚本,手动修复部分差异文档 (#7552)
* 增加api_difference校验脚本,手动修复部分差异文档 * 修复info生成bug * update from develop
1 parent 1ed233e commit a46693e

File tree

1,195 files changed

+1562
-6035
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,195 files changed

+1562
-6035
lines changed

docs/guides/model_convert/convert_from_pytorch/api_difference/args_default_value_diff/torch.alpha_dropout.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
## [ 参数默认值不一致 ]torch.alpha_dropout
2-
32
### [torch.alpha\_dropout](https://pytorch.org/docs/master/generated/torch.nn.functional.alpha_dropout.html)
4-
53
```python
64
torch.alpha_dropout(input, p=0.5, train=False)
75
```
86

97
### [paddle.nn.functional.alpha\_dropout](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/alpha_dropout_cn.html#alpha-dropout)
10-
118
```python
129
paddle.nn.functional.alpha_dropout(x, p=0.5, training=True, name=None)
1310
```
1411

1512
其中 PyTorch 和 Paddle 功能一致,参数默认值不一致,具体如下:
1613

1714
### 参数映射
18-
1915
| PyTorch | PaddlePaddle | 备注 |
2016
| ------- | ------------ | -- |
2117
| input | x | 输入的多维 Tensor,仅参数名不一致。 |

docs/guides/model_convert/convert_from_pytorch/api_difference/args_default_value_diff/torch.cuda.amp.GradScaler.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
11
## [ 参数默认值不一致 ]torch.cuda.amp.GradScaler
22

33
### [torch.cuda.amp.GradScaler](https://pytorch.org/docs/stable/amp.html#torch.cuda.amp.GradScaler)
4-
54
```python
65
torch.cuda.amp.GradScaler(init_scale=65536.0, growth_factor=2.0, backoff_factor=0.5, growth_interval=2000, enabled=True)
76
```
87

98
### [paddle.amp.GradScaler](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/amp/GradScaler_cn.html)
10-
119
```python
1210
paddle.amp.GradScaler(enable=True, init_loss_scaling=65536.0, incr_ratio=2.0, decr_ratio=0.5, incr_every_n_steps=2000, decr_every_n_nan_or_inf=2, use_dynamic_loss_scaling=True)
1311
```
1412

1513
其中 Paddle 相比 PyTorch 支持更多其他参数且参数默认值不一致,具体如下:
1614

1715
### 参数映射
18-
1916
| PyTorch | PaddlePaddle | 备注 |
2017
| --------------- | ------------------------ |-----------------------------------------------------------------------------|
2118
| init_scale | init_loss_scaling | 初始 loss scaling 因子。Paddle 与 PyTorch 默认值不同,Paddle 应设置为 65536.0。 |

docs/guides/model_convert/convert_from_pytorch/api_difference/args_default_value_diff/torch.linalg.diagonal.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
## [ 参数默认值不一致 ]torch.linalg.diagonal
22
### [torch.linalg.diagonal](https://pytorch.org/docs/stable/generated/torch.linalg.diagonal.html#torch.linalg.diagonal)
3-
43
```python
54
torch.linalg.diagonal(A, *, offset=0, dim1=-2, dim2=-1)
65
```
76

87
### [paddle.diagonal](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/diagonal_cn.html#diagonal)
9-
108
```python
119
paddle.diagonal(x,
1210
offset=0,
@@ -18,7 +16,6 @@ paddle.diagonal(x,
1816
两者功能一致且参数用法一致,参数默认值不一致,具体如下:
1917

2018
### 参数映射
21-
2219
| PyTorch | PaddlePaddle | 备注 |
2320
| ------------- | ------------ | ------------------------------------------------------ |
2421
| <font color='red'> A </font> | <font color='red'> x </font> | 表示输入的 Tensor ,仅参数名不一致。 |

docs/guides/model_convert/convert_from_pytorch/api_difference/args_default_value_diff/torch.nn.functional.rrelu_.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
## [ 参数默认值不一致 ]torch.nn.functional.rrelu_
2-
32
### [torch.nn.functional.rrelu\_](https://pytorch.org/docs/stable/generated/torch.nn.functional.rrelu_.html)
4-
53
```python
64
torch.nn.functional.rrelu_(input, lower=1./8, upper=1./3, training=False)
75
```
86

97
### [paddle.nn.functional.rrelu](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/rrelu_cn.html)
10-
118
```python
129
paddle.nn.functional.rrelu(x, lower=1./8., upper=1./3., training=True, name=None)
1310
```
1411

1512
其中 PyTorch 和 Paddle 功能基本一致,前者会在不变更变量内存地址的情况下,直接改变变量的值,一般对网络训练结果影响不大。参数名与参数默认值不一致,具体如下:
1613

1714
### 参数映射
18-
1915
| PyTorch | PaddlePaddle | 备注 |
2016
| -------- | ------------ | -- |
2117
| input | x | 输入的 Tensor,仅参数名不一致。 |

docs/guides/model_convert/convert_from_pytorch/api_difference/args_default_value_diff/torch.nn.functional.threshold_.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
## [ 参数默认值不一致 ]torch.nn.functional.threshold_
2-
32
### [torch.nn.functional.threshold_](https://pytorch.org/docs/stable/generated/torch.nn.functional.threshold_.html#torch.nn.functional.threshold_)
4-
53
```python
64
torch.nn.functional.threshold_(input, threshold, value)
75
```
86

97
### [paddle.nn.functional.thresholded_relu_](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/thresholded_relu__cn.html#thresholded-relu)
10-
118
```python
129
paddle.nn.functional.thresholded_relu_(x, threshold=1.0, value=0.0, name=None)
1310
```
1411

1512
两者功能一致,但参数名称与参数默认值不一致,具体如下:
1613

1714
### 参数映射
18-
1915
| PyTorch | PaddlePaddle | 备注 |
2016
| --------- | ------------ | --------------------------------------------------------------------------------------------------------------- |
2117
| input | x | 输入的 Tensor,仅参数名不一致。 |

docs/guides/model_convert/convert_from_pytorch/api_difference/args_default_value_diff/torch.rrelu.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
## [ 参数默认值不一致 ]torch.rrelu
2-
32
### [torch.rrelu](https://pytorch.org/docs/stable/generated/torch.nn.functional.rrelu.html#torch.nn.functional.rrelu)
4-
53
```python
64
torch.rrelu(input, lower=1./8, upper=1./3, training=False)
75
```
86

97
### [paddle.nn.functional.rrelu](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/rrelu_cn.html)
10-
118
```python
129
paddle.nn.functional.rrelu(x, lower=1./8, upper=1./3, training=True, name=None)
1310
```
1411

1512
其中 PyTorch 和 Paddle 功能一致,参数名与参数默认值不一致,具体如下:
1613

1714
### 参数映射
18-
1915
| PyTorch | PaddlePaddle | 备注 |
2016
| -------- | ------------ | ----------------------------------------- |
2117
| input | x | 输入的 Tensor,仅参数名不一致。 |

docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.addmm.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
## [ 仅参数名不一致 ]torch.Tensor.addmm
2-
32
### [torch.Tensor.addmm](https://pytorch.org/docs/stable/generated/torch.Tensor.addmm.html)
4-
53
```python
64
torch.Tensor.addmm(mat1, mat2, *, beta=1, alpha=1)
75
```
86

97
### [paddle.Tensor.addmm]()
10-
118
```python
129
paddle.Tensor.addmm(x, y, alpha=1.0, beta=1.0)
1310
```
1411

1512
两者功能一致且参数用法一致,仅参数名不一致,具体如下:
1613

1714
### 参数映射
18-
1915
| PyTorch | PaddlePaddle | 备注 |
2016
| -------- | ------------ | -------------------------------- |
2117
| mat1 | x | 表示输入的 Tensor,仅参数名不一致。 |

docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.addmm_.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
## [ 仅参数名不一致 ]torch.Tensor.addmm_
2-
32
### [torch.Tensor.addmm_](https://pytorch.org/docs/stable/generated/torch.Tensor.addmm_.html)
4-
53
```python
64
torch.Tensor.addmm_(mat1, mat2, *, beta=1, alpha=1)
75
```
86

97
### [paddle.Tensor.addmm_]()
10-
118
```python
129
paddle.Tensor.addmm_(x, y, alpha=1.0, beta=1.0)
1310
```
1411

1512
两者功能一致且参数用法一致,仅参数名不一致,具体如下:
1613

1714
### 参数映射
18-
1915
| PyTorch | PaddlePaddle | 备注 |
2016
| -------- | ------------ | -------------------------------- |
2117
| mat1 | x | 表示输入的 Tensor,仅参数名不一致。 |

docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.as_strided.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
## [ 仅参数名不一致 ]torch.Tensor.as_strided
22
### [torch.Tensor.as_strided](https://pytorch.org/docs/stable/generated/torch.Tensor.as_strided.html?highlight=as_strided#torch.Tensor.as_strided)
3-
43
```python
54
torch.Tensor.as_strided(size,
65
stride,
76
storage_offset=None)
87
```
98

109
### [paddle.Tensor.as_strided](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor_cn.html#as-strided-x-shape-stride-offset-0-name-none)
11-
1210
```python
1311
paddle.Tensor.as_strided(shape,
1412
stride,
@@ -18,7 +16,6 @@ paddle.Tensor.as_strided(shape,
1816

1917
两者功能一致且参数用法一致,仅参数名不一致,具体如下:
2018
### 参数映射
21-
2219
| PyTorch | PaddlePaddle | 备注 |
2320
| ------------- | ------------ | ------------------------------------------------------ |
2421
| size | shape | 表示输出 Tensor 的维度, 仅参数名不一致。 |
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
## [ 仅参数名不一致 ]torch.Tensor.atan2
2-
32
### [torch.Tensor.atan2](https://pytorch.org/docs/stable/generated/torch.atan2.html#torch.atan2)
4-
53
```python
64
torch.Tensor.atan2(other)
75
```
86

97
### [paddle.Tensor.atan2](https://www.paddlepaddle.org.cn/documentation/docs/en/develop/api/paddle/Tensor_en.html)
10-
118
```python
129
paddle.Tensor.atan2(y, name=None)
1310
```
1411

1512
两者功能一致且参数用法一致,仅参数名不一致,具体如下:
1613

1714
### 参数映射
18-
1915
| PyTorch | PaddlePaddle | 备注 |
2016
| --------- | ------------ | --------------------------------- |
2117
| other | y | 表示输入的 Tensor ,仅参数名不一致。 |

0 commit comments

Comments
 (0)