diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/cuda/torch.cuda.stream.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/cuda/torch.cuda.stream.md new file mode 100644 index 00000000000..eb68e2b1cb4 --- /dev/null +++ b/docs/guides/model_convert/convert_from_pytorch/api_difference/cuda/torch.cuda.stream.md @@ -0,0 +1,19 @@ +## [参数完全一致]torch.cuda.stream + +### [torch.cuda.stream](https://pytorch.org/docs/stable/generated/torch.cuda.stream.html) + +```python +torch.cuda.stream(stream) +``` + +### [paddle.device.cuda.stream_guard](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/device/cuda/stream_guard_cn.html) + +```python +paddle.device.cuda.stream_guard(stream) +``` + +功能一致,参数完全一致,具体如下: +### 参数映射 +| PyTorch | PaddlePaddle | 备注 | +| ------------- | ------------ | ------------------------------------------------------ | +| stream | stream | 指定的 CUDA stream。如果为 None,则不进行 stream 流切换。Paddle 的该 API 目前仅支持动态图模式。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/pytorch_api_mapping_cn.md b/docs/guides/model_convert/convert_from_pytorch/pytorch_api_mapping_cn.md index bd9139e14e7..4317afb0622 100644 --- a/docs/guides/model_convert/convert_from_pytorch/pytorch_api_mapping_cn.md +++ b/docs/guides/model_convert/convert_from_pytorch/pytorch_api_mapping_cn.md @@ -715,7 +715,9 @@ | 16 | [torch.cuda.memory_usage](https://pytorch.org/docs/stable/generated/torch.cuda.memory_usage.html#torch.cuda.memory_usage) | | 功能缺失 | | 17 | [torch.cuda.mem_get_info](https://pytorch.org/docs/stable/generated/torch.cuda.mem_get_info.html#torch.cuda.mem_get_info) | | 功能缺失 | | 18 | [torch.cuda.set_rng_state](https://pytorch.org/docs/stable/generated/torch.cuda.set_rng_state.html#torch.cuda.set_rng_state) | | 功能缺失 | - +| 19 | [torch.cuda.default_stream](https://pytorch.org/docs/stable/generated/torch.cuda.default_stream.html?highlight=torch+cuda+default_stream#torch.cuda.default_stream) | | 功能缺失 | +| 20 | [torch.cuda.get_arch_list](https://pytorch.org/docs/stable/generated/torch.cuda.get_arch_list.html?highlight=torch+cuda+get_arch_list#torch.cuda.get_arch_list) | | 功能缺失 | +| 21 | [torch.cuda.is_initialized](https://pytorch.org/docs/stable/generated/torch.cuda.is_initialized.html?highlight=torch+cuda+is_initialized#torch.cuda.is_initialized) | | 功能缺失 | ***持续更新...***