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

映射文档 No. 227 #6050

Merged
merged 1 commit into from
Jul 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## [ 组合替代实现 ]torch.random.initial_seed

### [torch.initial_seed](https://pytorch.org/docs/stable/random.html#torch.random.initial_seed)

```python
torch.random.initial_seed()
```

获取当前随机数种子。返回一个用于播种 RNG 的 64 位数字。

PaddlePaddle 目前无对应 API,可使用如下代码组合实现该 API。

### 转写示例

```python
# Pytorch 写法
torch.random.initial_seed()

# Paddle 写法
paddle.get_rng_state()[0].current_seed()
```