Skip to content

Commit 3572a48

Browse files
authored
映射文档No.39 (#5851)
* add new file.md * modified * modify * modify
1 parent efcc54b commit 3572a48

File tree

7 files changed

+120
-12
lines changed

7 files changed

+120
-12
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
## [torch 参数更多 ]torch.frac
2+
### [torch.frac](https://pytorch.org/docs/1.13/generated/torch.frac.html?highlight=frac#torch.frac)
3+
4+
```python
5+
torch.frac(input,
6+
*,
7+
out=None)
8+
```
9+
10+
### [paddle.frac](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/frac_cn.html#frac)
11+
12+
```python
13+
paddle.frac(x,
14+
name=None)
15+
```
16+
17+
其中 Pytorch 相比 Paddle 支持更多其他参数,具体如下:
18+
### 参数差异
19+
| PyTorch | PaddlePaddle | 备注 |
20+
| ------------- | ------------ | ------------------------------------------------------ |
21+
| <font color='red'> input </font> | <font color='red'> x </font> | 表示输入的 Tensor ,仅参数名不一致。 |
22+
| <font color='red'> out </font> | - | 表示输出的 Tensor , Paddle 无此参数,需要进行转写。 |
23+
24+
25+
26+
### 转写示例
27+
#### out:指定输出
28+
```python
29+
# Pytorch 写法
30+
torch.frac(input, out=y)
31+
32+
# Paddle 写法
33+
paddle.assign(paddle.frac(input), y)
34+
```
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
## [torch 参数更多 ]torch.lerp
2+
### [torch.lerp](https://pytorch.org/docs/1.13/generated/torch.lerp.html?highlight=lerp#torch.lerp)
3+
4+
```python
5+
torch.lerp(input,
6+
end,
7+
weight,
8+
*,
9+
out=None)
10+
```
11+
12+
### [paddle.lerp](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/lerp_cn.html#lerp)
13+
14+
```python
15+
paddle.lerp(x,
16+
y,
17+
weight,
18+
name=None)
19+
```
20+
21+
其中 Pytorch 相比 Paddle 支持更多其他参数,具体如下:
22+
### 参数差异
23+
| PyTorch | PaddlePaddle | 备注 |
24+
| ------------- | ------------ | ------------------------------------------------------ |
25+
| <font color='red'> input </font> | <font color='red'> x </font> | 表示输入的 Tensor ,仅参数名不一致。 |
26+
| <font color='red'> end </font> | <font color='red'> y </font> | 表示输入的 Tensor ,仅参数名不一致。 |
27+
| <font color='red'> weight </font> | <font color='red'> weight </font> | 表示输入的 Tensor 。 |
28+
| <font color='red'> out </font> | - | 表示输出的 Tensor , Paddle 无此参数,需要进行转写。 |
29+
30+
31+
32+
### 转写示例
33+
#### out:指定输出
34+
```python
35+
# Pytorch 写法
36+
torch.lerp(input1,input2,0.5, out=y)
37+
38+
# Paddle 写法
39+
paddle.assign(paddle.lerp(input1,input2, 0.5), y)
40+
```
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
## [torch 参数更多 ]torch.lgamma
2+
### [torch.lgamma](https://pytorch.org/docs/1.13/generated/torch.lgamma.html?highlight=lgamma#torch.lgamma)
3+
4+
```python
5+
torch.lgamma(input,
6+
*,
7+
out=None)
8+
```
9+
10+
### [paddle.lgamma](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/lgamma_cn.html#lgamma)
11+
12+
```python
13+
paddle.lgamma(x
14+
, name=None)
15+
```
16+
17+
其中 Pytorch 相比 Paddle 支持更多其他参数,具体如下:
18+
### 参数差异
19+
| PyTorch | PaddlePaddle | 备注 |
20+
| ------------- | ------------ | ------------------------------------------------------ |
21+
| <font color='red'> input </font> | <font color='red'> x </font> | 表示输入的 Tensor ,仅参数名不一致。 |
22+
| <font color='red'> out </font> | - | 表示输出的 Tensor , Paddle 无此参数,需要进行转写。 |
23+
24+
25+
26+
### 转写示例
27+
#### out:指定输出
28+
```python
29+
# Pytorch 写法
30+
torch.lgamma(input,out=y)
31+
32+
# Paddle 写法
33+
paddle.assign(paddle.lgamma(input), y)
34+
```

docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.log.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## [torch 参数更多 ]torch.log
2-
### [torch.log](https://pytorch.org/docs/stable/generated/torch.log.html?highlight=log#torch.log)
2+
### [torch.log](https://pytorch.org/docs/1.13/generated/torch.log.html?highlight=log#torch.log)
33

44
```python
55
torch.log(input,
@@ -25,8 +25,8 @@ paddle.log(x,
2525
#### out:指定输出
2626
```python
2727
# Pytorch 写法
28-
torch.log([3, 5], out=y)
28+
torch.log(input, out=y)
2929

3030
# Paddle 写法
31-
paddle.assign(paddle.log([3, 5]), y)
31+
paddle.assign(paddle.log(input), y)
3232
```

docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.log10.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## [torch 参数更多 ]torch.log10
2-
### [torch.log10](https://pytorch.org/docs/stable/generated/torch.log10.html?highlight=log10#torch.log10)
2+
### [torch.log10](https://pytorch.org/docs/1.13/generated/torch.log10.html?highlight=log10#torch.log10)
33

44
```python
55
torch.log10(input,
@@ -26,8 +26,8 @@ paddle.log10(x,
2626
#### out:指定输出
2727
```python
2828
# Pytorch 写法
29-
torch.log10([3, 5], out=y)
29+
torch.log10(input, out=y)
3030

3131
# Paddle 写法
32-
paddle.assign(paddle.log10([3, 5]), y)
32+
paddle.assign(paddle.log10(input), y)
3333
```

docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.log1p.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## [torch 参数更多 ]torch.log1p
2-
### [torch.log1p](https://pytorch.org/docs/stable/generated/torch.log1p.html?highlight=log1p#torch.log1p)
2+
### [torch.log1p](https://pytorch.org/docs/1.13/generated/torch.log1p.html?highlight=log1p#torch.log1p)
33

44
```python
55
torch.log1p(input,
@@ -26,8 +26,8 @@ paddle.log1p(x,
2626
#### out:指定输出
2727
```python
2828
# Pytorch 写法
29-
torch.log1p([3, 5], out=y)
29+
torch.log1p(input, out=y)
3030

3131
# Paddle 写法
32-
paddle.assign(paddle.log1p([3, 5]), y)
32+
paddle.assign(paddle.log1p(input), y)
3333
```

docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.log2.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## [torch 参数更多 ]torch.log2
2-
### [torch.log2](https://pytorch.org/docs/stable/generated/torch.log2.html?highlight=log2#torch.log2)
2+
### [torch.log2](https://pytorch.org/docs/1.13/generated/torch.log2.html?highlight=log2#torch.log2)
33

44
```python
55
torch.log2(input,
@@ -26,8 +26,8 @@ paddle.log2(x,
2626
#### out:指定输出
2727
```python
2828
# Pytorch 写法
29-
torch.log2([3, 5], out=y)
29+
torch.log2(input, out=y)
3030

3131
# Paddle 写法
32-
paddle.assign(paddle.log2([3, 5]), y)
32+
paddle.assign(paddle.log2(input), y)
3333
```

0 commit comments

Comments
 (0)