未验证 提交 8b370241 编写于 作者: 0 0YuanZhang0 提交者: GitHub

manual_seed (#2021)

Add paddle.framework.manual_seed ch doc
上级 d7bb6f7d
#!/bin/bash
# fluid
for module in layers dataset clip metrics executor initializer io nets optimizer profiler regularizer transpiler backward profiler unique_name dygraph
for module in layers dataset clip metrics executor initializer io nets optimizer profiler regularizer transpiler backward profiler unique_name dygraph framework
do
python gen_doc.py --module_name ${module} --module_prefix ${module} --output ${module} --output_name fluid --to_multiple_files True
python gen_module_index.py ${module} fluid.${module}
......@@ -27,6 +26,8 @@ done
python gen_module_index.py complex.tensor tensor
python gen_module_index.py complex paddle.complex
python gen_module_index.py framework paddle.framework
# nn
for module in loss
......
manual
.. _cn_api_paddle_framework_manual_seed:
manual_seed
-------------------------------
**版本升级,文档正在开发中**
.. py:function:: paddle.framework.manual_seed(seed)
设置并固定随机种子, manual_seed设置后,会将用户定义的Program中的random_seed参数设置成相同的种子
参数:
- **seed** (int32|int64) - 设置产生随机数的种子
返回: 无
**代码示例**:
.. code-block:: python
import paddle
from paddle.framework import manual_seed
default_seed = paddle.fluid.default_startup_program().random_seed #default_seed为0
manual_seed(102)
prog = paddle.fluid.Program()
prog_seed = prog.random_seed #prog_seed为102
update_seed = paddle.fluid.default_startup_program().random_seed #update_seed 为102
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册