Skip to content

Commit 42bc66d

Browse files
committed
修改invok_only_diff
1 parent 77e6741 commit 42bc66d

File tree

7 files changed

+32
-72
lines changed

7 files changed

+32
-72
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## [ 仅参数名不一致 ]torch.Tensor.bernoulli
2+
3+
### [torch.Tensor.bernoulli](https://pytorch.org/docs/stable/tensors.html#torch.Tensor.bernoulli)
4+
5+
```python
6+
torch.Tensor.bernoulli(*, generator=None)
7+
```
8+
9+
### [paddle.bernoulli](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/bernoulli_cn.html#paddle/bernoulli_cn#cn-api-paddle-bernoulli)
10+
11+
```python
12+
paddle.bernoulli(x, name=None)
13+
```
14+
15+
两者功能一致且参数用法一致,仅参数名不一致
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## [ 仅参数名不一致 ]torch.Tensor.hardshrink
2+
3+
### [torch.Tensor.hardshrink](https://pytorch.org/docs/stable/tensors.html#torch.Tensor.hardshrink)
4+
5+
```python
6+
torch.Tensor.hardshrink(lambd=0.5)
7+
```
8+
9+
### [paddle.nn.functional.hardshrink](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/hardshrink_cn.html#paddle/nn/functional/hardshrink_cn#cn-api-paddle-nn-functional-hardshrink)
10+
11+
```python
12+
paddle.nn.functional.hardshrink(x, threshold=0.5, name=None)
13+
```
14+
15+
两者功能一致,仅参数名不一致

docs/guides/model_convert/convert_from_pytorch/api_difference/invok_diff_only/torch.Tensor.bernoulli.md

Lines changed: 0 additions & 12 deletions
This file was deleted.

docs/guides/model_convert/convert_from_pytorch/api_difference/invok_diff_only/torch.Tensor.hardshrink.md

Lines changed: 0 additions & 12 deletions
This file was deleted.

docs/guides/model_convert/convert_from_pytorch/api_difference/invok_diff_only/torch.Tensor.lu_solve.md

Lines changed: 0 additions & 12 deletions
This file was deleted.

docs/guides/model_convert/convert_from_pytorch/api_difference/invok_diff_only/torch.Tensor.ormqr.md

Lines changed: 0 additions & 12 deletions
This file was deleted.

docs/guides/model_convert/convert_from_pytorch/tools/utils.py

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -312,30 +312,8 @@ def get_paddle_url(paddle_api: str) -> str:
312312
rst_path = os.path.join(root_dir, "api", url_path.replace(".html", ".rst"))
313313

314314
# 如果RST文件不存在,尝试查找同名文件并移动
315-
# if not os.path.exists(rst_path):
316-
# # 提取文件名(不含路径)
317-
# file_name = os.path.basename(rst_path)
318-
# api_dir = os.path.join(root_dir, "api")
319-
320-
# # 在api目录下查找同名文件
321-
# matches = []
322-
# for root, _, files in os.walk(api_dir):
323-
# for file in files:
324-
# if file == file_name:
325-
# matches.append(os.path.join(root, file))
326-
327-
# if len(matches) == 0:
328-
# print(f"Error: RST file '{file_name}' not found in {api_dir}")
329-
# elif len(matches) > 1:
330-
# print(
331-
# f"Warning: Multiple files named '{file_name}' found in {api_dir}. Not moving any."
332-
# )
333-
# else:
334-
# source = matches[0]
335-
# target_dir = os.path.dirname(rst_path)
336-
# os.makedirs(target_dir, exist_ok=True)
337-
# shutil.move(source, rst_path)
338-
# print(f"Successfully moved {source} to {rst_path}")
315+
if not os.path.exists(rst_path):
316+
print(f"Warning: RST file '{url_path}' not found.")
339317

340318
# 添加锚点
341319
anchor = url_path.replace(

0 commit comments

Comments
 (0)