Skip to content

Commit 924156e

Browse files
committed
fix code style
1 parent 0ed6660 commit 924156e

17 files changed

+54
-51
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ PyTorch 相比 Paddle 支持更多其他参数,具体如下:
2525
| reduction | reduction | 表示应用于输出结果的计算方式。 |
2626

2727
### 转写示例
28-
#### reduction 为 sum
28+
#### size_average/reduce:对应到 reduction 为 sum
2929
```python
3030
# PyTorch 写法
3131
torch.nn.BCELoss(weight=w, size_average=False, reduce=True)
@@ -35,7 +35,7 @@ torch.nn.BCELoss(weight=w, size_average=False)
3535
paddle.nn.BCELoss(weight=w, reduction='sum')
3636
```
3737

38-
#### reduction 为 mean
38+
#### size_average/reduce:对应到 reduction 为 mean
3939
```python
4040
# PyTorch 写法
4141
torch.nn.BCELoss(weight=w, size_average=True, reduce=True)
@@ -47,7 +47,7 @@ torch.nn.BCELoss(weight=w)
4747
paddle.nn.BCELoss(weight=w, reduction='mean')
4848
```
4949

50-
#### reduction 为 none
50+
#### size_average/reduce:对应到 reduction 为 none
5151
```python
5252
# PyTorch 写法
5353
torch.nn.BCELoss(weight=w, size_average=True, reduce=False)

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ PyTorch 相比 Paddle 支持更多其他参数,具体如下:
2828
| pos_weight | pos_weight | 表示正类的权重。 |
2929

3030
### 转写示例
31-
#### reduction 为 sum
31+
#### size_average/reduce:对应到 reduction 为 sum
3232
```python
3333
# PyTorch 写法
3434
torch.nn.BCEWithLogitsLoss(weight=w, size_average=False, reduce=True)
@@ -38,7 +38,7 @@ torch.nn.BCEWithLogitsLoss(weight=w, size_average=False)
3838
paddle.nn.BCEWithLogitsLoss(weight=w, reduction='sum')
3939
```
4040

41-
#### reduction 为 mean
41+
#### size_average/reduce:对应到 reduction 为 mean
4242
```python
4343
# PyTorch 写法
4444
torch.nn.BCEWithLogitsLoss(weight=w, size_average=True, reduce=True)
@@ -50,7 +50,7 @@ torch.nn.BCEWithLogitsLoss(weight=w)
5050
paddle.nn.BCEWithLogitsLoss(weight=w, reduction='mean')
5151
```
5252

53-
#### reduction 为 none
53+
#### size_average/reduce:对应到 reduction 为 none
5454
```python
5555
# PyTorch 写法
5656
torch.nn.BCEWithLogitsLoss(weight=w, size_average=True, reduce=False)

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ PyTorch 相比 Paddle 支持更多其他参数,具体如下:
2121
| reduction | reduction | 指定应用于输出结果的计算方式。 |
2222

2323
### 转写示例
24-
#### reduction 为 sum
24+
#### size_average/reduce:对应到 reduction 为 sum
2525
```python
2626
# PyTorch 写法
2727
torch.nn.CosineEmbeddingLoss(margin=m, size_average=False, reduce=True)
@@ -31,7 +31,7 @@ torch.nn.CosineEmbeddingLoss(margin=m, size_average=False)
3131
paddle.nn.CosineEmbeddingLoss(margin=m, reduction='sum')
3232
```
3333

34-
#### reduction 为 mean
34+
#### size_average/reduce:对应到 reduction 为 mean
3535
```python
3636
# PyTorch 写法
3737
torch.nn.CosineEmbeddingLoss(margin=m, size_average=True, reduce=True)
@@ -43,7 +43,7 @@ torch.nn.CosineEmbeddingLoss(margin=m)
4343
paddle.nn.CosineEmbeddingLoss(margin=m, reduction='mean')
4444
```
4545

46-
#### reduction 为 none
46+
#### size_average/reduce:对应到 reduction 为 none
4747
```python
4848
# PyTorch 写法
4949
torch.nn.CosineEmbeddingLoss(margin=m, size_average=True, reduce=False)

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ PyTorch 相比 Paddle 支持更多其他参数,具体如下:
3636
| - | axis | 进行 softmax 计算的维度索引,PyTorch 无此参数,Paddle 保持默认即可。 |
3737

3838
### 转写示例
39-
#### reduction 为 sum
39+
#### size_average/reduce:对应到 reduction 为 sum
4040
```python
4141
# PyTorch 写法
4242
torch.nn.CrossEntropyLoss(weight=w, size_average=False, reduce=True)
@@ -46,7 +46,7 @@ torch.nn.CrossEntropyLoss(weight=w, size_average=False)
4646
paddle.nn.CrossEntropyLoss(weight=w, reduction='sum')
4747
```
4848

49-
#### reduction 为 mean
49+
#### size_average/reduce:对应到 reduction 为 mean
5050
```python
5151
# PyTorch 写法
5252
torch.nn.CrossEntropyLoss(weight=w, size_average=True, reduce=True)
@@ -58,7 +58,7 @@ torch.nn.CrossEntropyLoss(weight=w)
5858
paddle.nn.CrossEntropyLoss(weight=w, reduction='mean')
5959
```
6060

61-
#### reduction 为 none
61+
#### size_average/reduce:对应到 reduction 为 none
6262
```python
6363
# PyTorch 写法
6464
torch.nn.CrossEntropyLoss(weight=w, size_average=True, reduce=False)

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ PyTorch 相比 Paddle 支持更多其他参数,具体如下:
2626
| reduction | reduction | 表示应用于输出结果的计算方式。 |
2727

2828
### 转写示例
29-
#### reduction 为 sum
29+
#### size_average/reduce:对应到 reduction 为 sum
3030
```python
3131
# PyTorch 写法
3232
torch.nn.HingeEmbeddingLoss(margin=m, size_average=False, reduce=True)
@@ -36,7 +36,7 @@ torch.nn.HingeEmbeddingLoss(margin=m, size_average=False)
3636
paddle.nn.HingeEmbeddingLoss(margin=m, reduction='sum')
3737
```
3838

39-
#### reduction 为 mean
39+
#### size_average/reduce:对应到 reduction 为 mean
4040
```python
4141
# PyTorch 写法
4242
torch.nn.HingeEmbeddingLoss(margin=m, size_average=True, reduce=True)
@@ -48,7 +48,7 @@ torch.nn.HingeEmbeddingLoss(margin=m)
4848
paddle.nn.HingeEmbeddingLoss(margin=m, reduction='mean')
4949
```
5050

51-
#### reduction 为 none
51+
#### size_average/reduce:对应到 reduction 为 none
5252
```python
5353
# PyTorch 写法
5454
torch.nn.HingeEmbeddingLoss(margin=m, size_average=True, reduce=False)

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ PyTorch 相比 Paddle 支持更多其他参数,具体如下:
2424
| log_target | log_target | 指定目标是否属于 log 空间。 |
2525

2626
### 转写示例
27-
#### reduction 为 sum
27+
#### size_average/reduce:对应到 reduction 为 sum
2828
```python
2929
# PyTorch 写法
3030
torch.nn.KLDivLoss(size_average=False, reduce=True)
@@ -34,7 +34,7 @@ torch.nn.KLDivLoss(size_average=False)
3434
paddle.nn.KLDivLoss(reduction='sum')
3535
```
3636

37-
#### reduction 为 mean
37+
#### size_average/reduce:对应到 reduction 为 mean
3838
```python
3939
# PyTorch 写法
4040
torch.nn.KLDivLoss(size_average=True, reduce=True)
@@ -46,7 +46,7 @@ torch.nn.KLDivLoss()
4646
paddle.nn.KLDivLoss(reduction='mean')
4747
```
4848

49-
#### reduction 为 none
49+
#### size_average/reduce:对应到 reduction 为 none
5050
```python
5151
# PyTorch 写法
5252
torch.nn.KLDivLoss(size_average=True, reduce=False)

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ PyTorch 相比 Paddle 支持更多其他参数,具体如下:
2222
| reduction | reduction | 表示对输出结果的计算方式。 |
2323

2424
### 转写示例
25-
#### reduction 为 sum
25+
#### size_average/reduce:对应到 reduction 为 sum
2626
```python
2727
# PyTorch 写法
2828
torch.nn.L1Loss(size_average=False, reduce=True)
@@ -32,7 +32,7 @@ torch.nn.L1Loss(size_average=False)
3232
paddle.nn.L1Loss(reduction='sum')
3333
```
3434

35-
#### reduction 为 mean
35+
#### size_average/reduce:对应到 reduction 为 mean
3636
```python
3737
# PyTorch 写法
3838
torch.nn.L1Loss(size_average=True, reduce=True)
@@ -44,7 +44,7 @@ torch.nn.L1Loss()
4444
paddle.nn.L1Loss(reduction='mean')
4545
```
4646

47-
#### reduction 为 none
47+
#### size_average/reduce:对应到 reduction 为 none
4848
```python
4949
# PyTorch 写法
5050
torch.nn.L1Loss(size_average=True, reduce=False)

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ PyTorch 相比 Paddle 支持更多其他参数,具体如下:
2121
| reduction | reduction | 表示对输出结果的计算方式。 |
2222

2323
### 转写示例
24-
#### reduction 为 sum
24+
#### size_average/reduce:对应到 reduction 为 sum
2525
```python
2626
# PyTorch 写法
2727
torch.nn.MSELoss(size_average=False, reduce=True)
@@ -31,7 +31,7 @@ torch.nn.MSELoss(size_average=False)
3131
paddle.nn.MSELoss(reduction='sum')
3232
```
3333

34-
#### reduction 为 mean
34+
#### size_average/reduce:对应到 reduction 为 mean
3535
```python
3636
# PyTorch 写法
3737
torch.nn.MSELoss(size_average=True, reduce=True)
@@ -43,7 +43,7 @@ torch.nn.MSELoss()
4343
paddle.nn.MSELoss(reduction='mean')
4444
```
4545

46-
#### reduction 为 none
46+
#### size_average/reduce:对应到 reduction 为 none
4747
```python
4848
# PyTorch 写法
4949
torch.nn.MSELoss(size_average=True, reduce=False)

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ PyTorch 相比 Paddle 支持更多其他参数,具体如下:
2626
| reduction | reduction | 表示应用于输出结果的计算方式。 |
2727

2828
### 转写示例
29-
#### reduction 为 sum
29+
#### size_average/reduce:对应到 reduction 为 sum
3030
```python
3131
# PyTorch 写法
3232
torch.nn.MarginRankingLoss(margin=m, size_average=False, reduce=True)
@@ -36,7 +36,7 @@ torch.nn.MarginRankingLoss(margin=m, size_average=False)
3636
paddle.nn.MarginRankingLoss(margin=m, reduction='sum')
3737
```
3838

39-
#### reduction 为 mean
39+
#### size_average/reduce:对应到 reduction 为 mean
4040
```python
4141
# PyTorch 写法
4242
torch.nn.MarginRankingLoss(margin=m, size_average=True, reduce=True)
@@ -48,7 +48,7 @@ torch.nn.MarginRankingLoss(margin=m)
4848
paddle.nn.MarginRankingLoss(margin=m, reduction='mean')
4949
```
5050

51-
#### reduction 为 none
51+
#### size_average/reduce:对应到 reduction 为 none
5252
```python
5353
# PyTorch 写法
5454
torch.nn.MarginRankingLoss(margin=m, size_average=True, reduce=False)

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ PyTorch 相比 Paddle 支持更多其他参数,具体如下:
2020
| reduction | reduction | 指定应用于输出结果的计算方式。 |
2121

2222
### 转写示例
23-
#### reduction 为 sum
23+
#### size_average/reduce:对应到 reduction 为 sum
2424
```python
2525
# PyTorch 写法
2626
torch.nn.MultiLabelMarginLoss(size_average=False, reduce=True)
@@ -30,7 +30,7 @@ torch.nn.MultiLabelMarginLoss(size_average=False)
3030
paddle.nn.MultiLabelMarginLoss(reduction='sum')
3131
```
3232

33-
#### reduction 为 mean
33+
#### size_average/reduce:对应到 reduction 为 mean
3434
```python
3535
# PyTorch 写法
3636
torch.nn.MultiLabelMarginLoss(size_average=True, reduce=True)
@@ -42,7 +42,7 @@ torch.nn.MultiLabelMarginLoss()
4242
paddle.nn.MultiLabelMarginLoss(reduction='mean')
4343
```
4444

45-
#### reduction 为 none
45+
#### size_average/reduce:对应到 reduction 为 none
4646
```python
4747
# PyTorch 写法
4848
torch.nn.MultiLabelMarginLoss(size_average=True, reduce=False)

0 commit comments

Comments
 (0)