diff --git a/doc/fluid/api/gen_doc.sh b/doc/fluid/api/gen_doc.sh index 4f549e17ca72c74edf0c8dc70692651c2a414165..45f00f87a7ee505320f1f6a3b97984bb05665b14 100644 --- a/doc/fluid/api/gen_doc.sh +++ b/doc/fluid/api/gen_doc.sh @@ -1,7 +1,6 @@ #!/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 diff --git a/doc/fluid/api_cn/framework_cn/manual_seed_cn.rst b/doc/fluid/api_cn/framework_cn/manual_seed_cn.rst index cd11ecacafe3e4791bce42a28207fbf91ef087dc..b688da6a571f42b66eea3da62c1edf85781bea94 100644 --- a/doc/fluid/api_cn/framework_cn/manual_seed_cn.rst +++ b/doc/fluid/api_cn/framework_cn/manual_seed_cn.rst @@ -1,3 +1,32 @@ -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 + +