Skip to content

Commit

Permalink
【映射文档】modify get_cuda_rng_state to get_rng_state etc. (#5977)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
zpceng314 authored Jun 27, 2023
1 parent 9bd4298 commit 3eff257
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 的返回参数类型不一致
Expand All @@ -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()
```
Original file line number Diff line number Diff line change
Expand Up @@ -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()
```
Original file line number Diff line number Diff line change
Expand Up @@ -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()
```
Original file line number Diff line number Diff line change
Expand Up @@ -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 的输入参数类型不一致
Expand All @@ -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)
```
Original file line number Diff line number Diff line change
Expand Up @@ -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 的返回参数类型不一致
Expand All @@ -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()
```
Original file line number Diff line number Diff line change
Expand Up @@ -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()
```
Original file line number Diff line number Diff line change
Expand Up @@ -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 的输入参数类型不一致
Expand All @@ -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)
```

0 comments on commit 3eff257

Please sign in to comment.