From 3eff257ff171792d566919b1ee71bdc352df219a Mon Sep 17 00:00:00 2001 From: zpceng314 <95727760+zpceng314@users.noreply.github.com> Date: Tue, 27 Jun 2023 14:45:27 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=98=A0=E5=B0=84=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E3=80=91modify=20get=5Fcuda=5Frng=5Fstate=20to=20get=5Frng=5Fs?= =?UTF-8?q?tate=20etc.=20(#5977)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * model_convert add torch.is_nonzero .etc * model_convert add is_nonzero .etc * model_convert add is_nonzero .etc * model_convert add is_nonzero .etc * add xlogy.etc * add randn_like .etc * comment * add vdot etc. * add aminmax etc. * fix parameter * add bucketizr etc. * add bucketizr etc. * add bucketizr etc. * add sinc etc. * add sinc etc. * add sinc etc. * add cov etc. * add cov etc. * add cov etc. * add cov etc. * add unique etc. * add unique etc. * add backward etc. * add backward etc. * modify get_cuda_rng_state to get_rng_state --- .../api_difference/ops/torch.get_rng_state.md | 6 +++--- .../api_difference/ops/torch.initial_seed.md | 2 +- .../convert_from_pytorch/api_difference/ops/torch.seed.md | 2 +- .../api_difference/ops/torch.set_rng_state.md | 6 +++--- .../api_difference/others/torch.random.get_rng_state.md | 6 +++--- .../api_difference/others/torch.random.seed.md | 2 +- .../api_difference/others/torch.random.set_rng_state.md | 6 +++--- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.get_rng_state.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.get_rng_state.md index 19ce1cdbb20..95017fd09a1 100644 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.get_rng_state.md +++ b/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.get_rng_state.md @@ -6,10 +6,10 @@ torch.get_rng_state() ``` -### [paddle.get_cuda_rng_state](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/get_cuda_rng_state_cn.html#get-cuda-rng-state) +### [paddle.get_rng_state]() ```python -paddle.get_cuda_rng_state() +paddle.get_rng_state() ``` 其中 Pytorch 与 Paddle 的返回参数类型不一致 @@ -28,5 +28,5 @@ paddle.get_cuda_rng_state() x = torch.get_rng_state() # Paddle 写法 -x = paddle.get_cuda_rng_state() +x = paddle.get_rng_state() ``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.initial_seed.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.initial_seed.md index ebd9e873299..3cfae7dcb22 100644 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.initial_seed.md +++ b/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.initial_seed.md @@ -15,5 +15,5 @@ PaddlePaddle 目前无对应 API,可使用如下代码组合实现该 API。 torch.initial_seed() # Paddle 写法 -paddle.get_cuda_rng_state()[0].current_seed() +paddle.get_rng_state()[0].current_seed() ``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.seed.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.seed.md index 1694c585a44..c42d4d89125 100644 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.seed.md +++ b/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.seed.md @@ -15,5 +15,5 @@ PaddlePaddle 目前无对应 API,可使用如下代码组合实现该 API。 torch.seed() # Paddle 写法 -paddle.get_cuda_rng_state()[0].current_seed() +paddle.get_rng_state()[0].current_seed() ``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.set_rng_state.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.set_rng_state.md index 40b82c7b78e..a9f699b99d3 100644 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.set_rng_state.md +++ b/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.set_rng_state.md @@ -6,10 +6,10 @@ torch.set_rng_state(new_state) ``` -### [paddle.set_cuda_rng_state](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/set_cuda_rng_state_cn.html#set-cuda-rng-state) +### [paddle.set_rng_state]() ```python -paddle.set_cuda_rng_state(state_list) +paddle.set_rng_state(state_list) ``` 其中 Pytorch 与 Paddle 的输入参数类型不一致 @@ -29,5 +29,5 @@ paddle.set_cuda_rng_state(state_list) torch.set_rng_state(x) # Paddle 写法 -paddle.set_cuda_rng_state(x) +paddle.set_rng_state(x) ``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/others/torch.random.get_rng_state.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/others/torch.random.get_rng_state.md index db73ecebbe0..ce31478a84f 100644 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/others/torch.random.get_rng_state.md +++ b/docs/guides/model_convert/convert_from_pytorch/api_difference/others/torch.random.get_rng_state.md @@ -6,10 +6,10 @@ torch.random.get_rng_state() ``` -### [paddle.get_cuda_rng_state](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/get_cuda_rng_state_cn.html#get-cuda-rng-state) +### [paddle.get_rng_state]() ```python -paddle.get_cuda_rng_state() +paddle.get_rng_state() ``` 其中 Pytorch 与 Paddle 的返回参数类型不一致 @@ -28,5 +28,5 @@ paddle.get_cuda_rng_state() x = torch.random.get_rng_state() # Paddle 写法 -x = paddle.get_cuda_rng_state() +x = paddle.get_rng_state() ``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/others/torch.random.seed.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/others/torch.random.seed.md index af91946d92f..846383e631c 100644 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/others/torch.random.seed.md +++ b/docs/guides/model_convert/convert_from_pytorch/api_difference/others/torch.random.seed.md @@ -15,5 +15,5 @@ PaddlePaddle 目前无对应 API,可使用如下代码组合实现该 API。 torch.random.seed() # Paddle 写法 -paddle.get_cuda_rng_state()[0].current_seed() +paddle.get_rng_state()[0].current_seed() ``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/others/torch.random.set_rng_state.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/others/torch.random.set_rng_state.md index 5e057dd7df7..2e27f22c7ad 100644 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/others/torch.random.set_rng_state.md +++ b/docs/guides/model_convert/convert_from_pytorch/api_difference/others/torch.random.set_rng_state.md @@ -6,10 +6,10 @@ torch.random.set_rng_state(new_state) ``` -### [paddle.set_cuda_rng_state](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/set_cuda_rng_state_cn.html#set-cuda-rng-state) +### [paddle.set_rng_state]() ```python -paddle.set_cuda_rng_state(state_list) +paddle.set_rng_state(state_list) ``` 其中 Pytorch 与 Paddle 的输入参数类型不一致 @@ -29,5 +29,5 @@ paddle.set_cuda_rng_state(state_list) torch.random.set_rng_state(x) # Paddle 写法 -paddle.set_cuda_rng_state(x) +paddle.set_rng_state(x) ```