Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix API docs #7007

Open
wants to merge 22 commits into
base: develop
Choose a base branch
from
Open
Prev Previous commit
Next Next commit
resolve conflict
  • Loading branch information
Xuxuanang committed Nov 25, 2024
commit 89129501ca4cda11bcdf8fbcea04efa01d271f22
Original file line number Diff line number Diff line change
@@ -2,13 +2,13 @@
### [torch.utils.checkpoint.checkpoint](https://pytorch.org/docs/stable/checkpoint.html#torch.utils.checkpoint.checkpoint)

```python
torch.utils.checkpoint.checkpoint(function, *args, preserve_rng_state=True, use_reentrant=True, determinism_check="default", **kwargs)
torch.utils.checkpoint.checkpoint(function, preserve_rng_state=True, use_reentrant=True, determinism_check="default", *args, **kwargs)
```

### [paddle.distributed.fleet.utils.recompute](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/utils/cpp_extension/CppExtension_cn.html)

```python
paddle.distributed.fleet.utils.recompute(function, *args, preserve_rng_state=True, use_reentrant=True, **kwargs)
paddle.distributed.fleet.utils.recompute(function, preserve_rng_state=True, use_reentrant=True, *args, **kwargs)
```

PyTorch 相比 Paddle 支持更多其他参数,具体如下:
@@ -17,8 +17,8 @@ PyTorch 相比 Paddle 支持更多其他参数,具体如下:
| PyTorch | PaddlePaddle | 备注 |
| ------------- | ------------ | ------------------------------------------------------ |
| function | function | 模型前向传播的部分连续的层函数组成的序列。 |
|*args | *args | function 的输入。 |
| preserve_rng_state | preserve_rng_state | 是否保存前向的 rng。 |
| use_reentrant | use_reentrant | recompute 的实现方式。 |
| determinism_check | - | 控制是否在反向传播时检查操作的确定性, 一般对训练结果影响不大,可直接删除。 |
| **kwargs | **kwargs | 用于指定 Extension 的其他参数,支持的参数与 setuptools.Extension 一致。 |
|*args | *args | function 的输入。 |
| **kwargs | **kwargs | 用于指定 Extension 的其他参数,支持的参数与 setuptools.Extension 一致。 |