You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guides/model_convert/convert_from_pytorch/pytorch_api_mapping_cn.md
+28-31Lines changed: 28 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,8 +12,8 @@
12
12
13
13
| 序号 | 类别 | 简介 |
14
14
| ---- | ---- | ---- |
15
-
| 1 |API 完全一致|**此类 API 能极大降低代码迁移成本,其使用方式完全一致,**只需要将代码中所有前缀 `torch.`替换为`paddle.`即可。(或者只需在文件最上方插入一行 `importpaddle as torch`即可)|
16
-
| 2 |仅 API 调用方式不一致|参数一致,但 API 调用方式不一致。此类 API 需要转换,但转换成本较低,只需要对 API 调用方式进行改写,无需处理 API 参数部分。包括:API 名称不同、API 路径不同、Tensor 类方法改成普通方法、Tensor 方法改成属性、Tensor 属性改成方法 等情况。|
15
+
| 1 |API 完全一致|**此类 API 没有转写成本,两者用法完全一致,**只需将代码中所有前缀 ``torch.``替换为``paddle.``即可。(也可只在文件最上方插入一行 ``importpaddle as torch``)|
16
+
| 2 |仅 API 调用方式不一致|此类 API 的转写成本较低,只需对 API 调用方式进行改写,无需转写 API 参数部分|
17
17
| 3 |仅参数名不一致|此类 API 功能相同,但部分参数名称不同|
18
18
| 4 |paddle 参数更多|此类 API 在 PaddlePaddle 中提供了更多可选参数|
19
19
| 5 |参数默认值不一致|此类 API 功能相同,但某些参数的默认值不同|
@@ -27,11 +27,9 @@
27
27
| 13 |功能缺失|此类 PyTorch API 的功能在 PaddlePaddle 中暂时没有等效实现|
28
28
29
29
### 1. API 完全一致
30
-
**分类简介**
31
30
32
-
此类 API 只需要将代码中所有前缀 `torch.`替换为`paddle.`即可。(或者只需在文件最上方插入一行 `importpaddle as torch`即可)
31
+
**简介:此类 API 没有转写成本,两者用法完全一致,** 只需将代码中所有前缀 ``torch.``替换为``paddle.``即可。(也可只在文件最上方插入一行 ``importpaddle as torch``)。示例如下。
0 commit comments