Skip to content

Commit df7b358

Browse files
authored
update docs (#7390)
1 parent abb0557 commit df7b358

File tree

4 files changed

+7
-26
lines changed

4 files changed

+7
-26
lines changed
Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## [ 输入参数类型不一致 ]torch.Tensor.all
1+
## [ 仅参数名不一致 ]torch.Tensor.all
22

33
### [torch.Tensor.all](https://pytorch.org/docs/stable/generated/torch.Tensor.all.html?highlight=torch+tensor+all#torch.Tensor.all)
44

@@ -14,22 +14,11 @@ paddle.Tensor.all(axis=None,
1414
name=None)
1515
```
1616

17-
其中 Paddle 与 PyTorch 运算 Tensor 所支持的类型不一致,具体如下:
17+
其中 PyTorch 和 Paddle 功能一致,仅参数名不一致,具体如下:
1818

1919
### 参数映射
2020

2121
| PyTorch | PaddlePaddle | 备注 |
2222
| ------------- | ------------ | ------------------------------------------------------ |
23-
| 运算 Tensor | 运算 Tensor | PyTorch 支持布尔和数值类型的输入,Paddle 仅支持布尔类型,需要转写。 |
2423
| dim | axis | 表示运算的维度,仅参数名不一致。 |
2524
| keepdim | keepdim | 是否在输出 Tensor 中保留减小的维度,参数完全一致。 |
26-
27-
### 转写示例
28-
#### 运算 Tensor:调用类方法的 Tensor
29-
```python
30-
# PyTorch 写法
31-
y = x.all()
32-
33-
# Paddle 写法
34-
y = x.astype('bool').all()
35-
```
Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## [ 输入参数类型不一致 ]torch.Tensor.any
1+
## [ 仅参数名不一致 ]torch.Tensor.any
22

33
### [torch.Tensor.any](https://pytorch.org/docs/stable/generated/torch.Tensor.any.html?highlight=torch+tensor+any#torch.Tensor.any)
44

@@ -14,22 +14,11 @@ paddle.Tensor.any(axis=None,
1414
name=None)
1515
```
1616

17-
其中 Paddle 与 PyTorch 运算 Tensor 所支持的类型不一致,具体如下:
17+
其中 PyTorch 和 Paddle 功能一致,仅参数名不一致,具体如下:
1818

1919
### 参数映射
2020

2121
| PyTorch | PaddlePaddle | 备注 |
2222
| ------------- | ------------ | ------------------------------------------------------ |
23-
| 运算 Tensor | 运算 Tensor | PyTorch 支持布尔和数值类型的输入,Paddle 仅支持布尔类型,需要转写。 |
2423
| dim | axis | 表示运算的维度,仅参数名不一致。 |
2524
| keepdim | keepdim | 是否在输出 Tensor 中保留减小的维度,参数完全一致。 |
26-
27-
### 转写示例
28-
#### 运算 Tensor:调用类方法的 Tensor
29-
```python
30-
# PyTorch 写法
31-
y = x.any()
32-
33-
# Paddle 写法
34-
y = x.astype('bool').any()
35-
```

docs/guides/model_convert/convert_from_pytorch/api_difference/torch/torch.tensor.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ paddle.to_tensor(data,
1919
```
2020

2121
PyTorch 相比 Paddle 支持更多其他参数,具体如下:
22+
2223
### 参数映射
24+
2325
| PyTorch | PaddlePaddle | 备注 |
2426
| ------------- | ------------ | ------------------------------------------------------ |
2527
| data | data | 表示输入的数据。 |

docs/guides/model_convert/convert_from_pytorch/api_difference/torch/torch.where.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ paddle.where(condition, x, y, name=None)
1515
PyTorch 相比 Paddle 支持更多其他参数,具体如下:
1616

1717
### 参数映射
18+
1819
| PyTorch | PaddlePaddle | 备注 |
1920
| ------------- | ------------ | ------------------------------------------------------ |
2021
| condition | condition | 判断条件。 |

0 commit comments

Comments
 (0)