Skip to content

Commit

Permalink
Merge branch 'master' into api_map_16_19
Browse files Browse the repository at this point in the history
  • Loading branch information
Li-fAngyU authored Jun 30, 2023
2 parents 2f6e35c + 0ca4982 commit 3ef0eaa
Show file tree
Hide file tree
Showing 183 changed files with 18,333 additions and 5,844 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ torch.permute
"dims": "perm"
}
},
"unsupport_args": {},
"unsupport_args": [],
"paddle_default_kwargs": {}
}
```
Expand Down Expand Up @@ -618,7 +618,7 @@ if x:

**单测写法**

* **单测位置**:所有的单测文件均放在`tests`目录下,单测文件命名以`test_`为前缀,后面接测试的`API`名称(PyTorch API全称去掉模块名,保留大小写)。例如 `torch.add` 命名为 `test_add.py``torch.Tensor.add` 命名为 `test_Tensor_add.py`
* **单测位置**:所有的单测文件均放在`tests`目录下,单测文件命名以`test_`为前缀,后面接测试的`API`名称(PyTorch API名称即可,保留大小写,无需Module前缀)。例如 `torch.nn.functional.relu` 命名为 `test_relu.py``torch.Tensor.add` 命名为 `test_Tensor_add.py`

* **默认检查逻辑**:采用`pytest`作为单测框架。一般情况下,用户只需要在单测文件中调用 `APIBase` 类的 `run()` 方法,传入 `pytorch_code` 和需要判断的 `Tensor` 变量名列表即可,参考 [torch.permute测试用例](/~https://github.com/PaddlePaddle/PaConvert/tree/master/tests/test_permute.py)`run()` 方法会调用`compare()`函数,该方法默认检查逻辑为:转换前后两个`Tensor``计算数值、数据类型、stop_gradient属性、形状` 是否一致。

Expand Down
8 changes: 4 additions & 4 deletions paconvert/api_alias_mapping.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"torch.nn.modules.GroupNorm": "torch.nn.GroupNorm",
"torch.nn.parameter.Parameter": "torch.nn.Parameter",
"torch.nn.modules.activation.ReLU": "torch.nn.ReLU",
"torch.nn.modules.conv.Conv2d": "torch.nn.Conv2d",
"torch.utils.data.sampler.BatchSampler": "torch.utils.data.BatchSampler",
"torch.nn.modules.module.Module": "torch.nn.Module",
"torch.nn.parameter.Parameter": "torch.nn.Parameter",
"torch.utils.data.sampler.BatchSampler": "torch.utils.data.BatchSampler",
"torch.utils.data.sampler.RandomSampler": "torch.utils.data.RandomSampler",
"torch.utils.data.sampler.SequentialSampler": "torch.utils.data.SequentialSampler",
"torch.utils.data.sampler.Sampler": "torch.utils.data.Sampler"
"torch.utils.data.sampler.Sampler": "torch.utils.data.Sampler",
"torch.utils.data.sampler.SequentialSampler": "torch.utils.data.SequentialSampler"
}
Loading

0 comments on commit 3ef0eaa

Please sign in to comment.