Skip to content

Commit 4cd82db

Browse files
authored
fix api_difference & add README.md (#7628)
1 parent 9bc0ec8 commit 4cd82db

File tree

48 files changed

+304
-409
lines changed

Some content is hidden

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

48 files changed

+304
-409
lines changed

docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.BCELoss.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ PyTorch 相比 Paddle 支持更多其他参数,具体如下:
2626

2727
### 转写示例
2828

29+
2930
#### size_average
3031
size_average 为 True
3132
```python
@@ -48,7 +49,7 @@ paddle.nn.BCELoss(reduction='sum')
4849
reduce 为 True
4950
```python
5051
# PyTorch 写法
51-
torch.nn.BCELoss(size_average=False)
52+
torch.nn.BCELoss(reduce=True)
5253

5354
# Paddle 写法
5455
paddle.nn.BCELoss(reduction='sum')

docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.BCEWithLogitsLoss.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ PyTorch 相比 Paddle 支持更多其他参数,具体如下:
2929

3030
### 转写示例
3131

32+
3233
#### size_average
3334
size_average 为 True
3435
```python
@@ -51,7 +52,7 @@ paddle.nn.BCEWithLogitsLoss(reduction='sum')
5152
reduce 为 True
5253
```python
5354
# PyTorch 写法
54-
torch.nn.BCEWithLogitsLoss(size_average=False)
55+
torch.nn.BCEWithLogitsLoss(reduce=True)
5556

5657
# Paddle 写法
5758
paddle.nn.BCEWithLogitsLoss(reduction='sum')

docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.CosineEmbeddingLoss.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ PyTorch 相比 Paddle 支持更多其他参数,具体如下:
2222

2323
### 转写示例
2424

25+
2526
#### size_average
2627
size_average 为 True
2728
```python
@@ -44,7 +45,7 @@ paddle.nn.CosineEmbeddingLoss(reduction='sum')
4445
reduce 为 True
4546
```python
4647
# PyTorch 写法
47-
torch.nn.CosineEmbeddingLoss(size_average=False)
48+
torch.nn.CosineEmbeddingLoss(reduce=True)
4849

4950
# Paddle 写法
5051
paddle.nn.CosineEmbeddingLoss(reduction='sum')

docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.CrossEntropyLoss.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ PyTorch 相比 Paddle 支持更多其他参数,具体如下:
3737

3838
### 转写示例
3939

40+
4041
#### size_average
4142
size_average 为 True
4243
```python
@@ -59,7 +60,7 @@ paddle.nn.CrossEntropyLoss(reduction='sum')
5960
reduce 为 True
6061
```python
6162
# PyTorch 写法
62-
torch.nn.CrossEntropyLoss(size_average=False)
63+
torch.nn.CrossEntropyLoss(reduce=True)
6364

6465
# Paddle 写法
6566
paddle.nn.CrossEntropyLoss(reduction='sum')

docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.HingeEmbeddingLoss.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ PyTorch 相比 Paddle 支持更多其他参数,具体如下:
2727

2828
### 转写示例
2929

30+
3031
#### size_average
3132
size_average 为 True
3233
```python
@@ -49,7 +50,7 @@ paddle.nn.HingeEmbeddingLoss(reduction='sum')
4950
reduce 为 True
5051
```python
5152
# PyTorch 写法
52-
torch.nn.HingeEmbeddingLoss(size_average=False)
53+
torch.nn.HingeEmbeddingLoss(reduce=True)
5354

5455
# Paddle 写法
5556
paddle.nn.HingeEmbeddingLoss(reduction='sum')

docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.KLDivLoss.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ PyTorch 相比 Paddle 支持更多其他参数,具体如下:
2525

2626
### 转写示例
2727

28+
2829
#### size_average
2930
size_average 为 True
3031
```python
@@ -47,7 +48,7 @@ paddle.nn.KLDivLoss(reduction='sum')
4748
reduce 为 True
4849
```python
4950
# PyTorch 写法
50-
torch.nn.KLDivLoss(size_average=False)
51+
torch.nn.KLDivLoss(reduce=True)
5152

5253
# Paddle 写法
5354
paddle.nn.KLDivLoss(reduction='sum')

docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.L1Loss.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ PyTorch 相比 Paddle 支持更多其他参数,具体如下:
2323

2424
### 转写示例
2525

26+
2627
#### size_average
2728
size_average 为 True
2829
```python
@@ -45,7 +46,7 @@ paddle.nn.L1Loss(reduction='sum')
4546
reduce 为 True
4647
```python
4748
# PyTorch 写法
48-
torch.nn.L1Loss(size_average=False)
49+
torch.nn.L1Loss(reduce=True)
4950

5051
# Paddle 写法
5152
paddle.nn.L1Loss(reduction='sum')

docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.MSELoss.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ PyTorch 相比 Paddle 支持更多其他参数,具体如下:
2222

2323
### 转写示例
2424

25+
2526
#### size_average
2627
size_average 为 True
2728
```python
@@ -44,7 +45,7 @@ paddle.nn.MSELoss(reduction='sum')
4445
reduce 为 True
4546
```python
4647
# PyTorch 写法
47-
torch.nn.MSELoss(size_average=False)
48+
torch.nn.MSELoss(reduce=True)
4849

4950
# Paddle 写法
5051
paddle.nn.MSELoss(reduction='sum')

docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.MarginRankingLoss.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ PyTorch 相比 Paddle 支持更多其他参数,具体如下:
2727

2828
### 转写示例
2929

30+
3031
#### size_average
3132
size_average 为 True
3233
```python
@@ -49,7 +50,7 @@ paddle.nn.MarginRankingLoss(reduction='sum')
4950
reduce 为 True
5051
```python
5152
# PyTorch 写法
52-
torch.nn.MarginRankingLoss(size_average=False)
53+
torch.nn.MarginRankingLoss(reduce=True)
5354

5455
# Paddle 写法
5556
paddle.nn.MarginRankingLoss(reduction='sum')

docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.MultiLabelMarginLoss.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ PyTorch 相比 Paddle 支持更多其他参数,具体如下:
2121

2222
### 转写示例
2323

24+
2425
#### size_average
2526
size_average 为 True
2627
```python
@@ -43,7 +44,7 @@ paddle.nn.MultiLabelMarginLoss(reduction='sum')
4344
reduce 为 True
4445
```python
4546
# PyTorch 写法
46-
torch.nn.MultiLabelMarginLoss(size_average=False)
47+
torch.nn.MultiLabelMarginLoss(reduce=True)
4748

4849
# Paddle 写法
4950
paddle.nn.MultiLabelMarginLoss(reduction='sum')

0 commit comments

Comments
 (0)