From 5fe7e81ed3f9258379305da97062213f9419ea4a Mon Sep 17 00:00:00 2001 From: Aurelius84 Date: Tue, 25 Aug 2020 04:02:01 +0000 Subject: [PATCH] add zh doc in paddle.static --- .../api_cn/static_cn/BuildStrategy_cn.rst | 5 ++ .../api_cn/static_cn/CompiledProgram_cn.rst | 5 ++ .../api_cn/static_cn/ExecutionStrategy_cn.rst | 5 ++ doc/fluid/api_cn/static_cn/Executor_cn.rst | 5 ++ doc/fluid/api_cn/static_cn/InputSpec_cn.rst | 2 +- .../api_cn/static_cn/ParallelExecutor_cn.rst | 5 ++ doc/fluid/api_cn/static_cn/Print_cn.rst | 5 ++ doc/fluid/api_cn/static_cn/Program_cn.rst | 5 ++ .../static_cn/WeightNormParamAttr_cn.rst | 5 ++ .../api_cn/static_cn/append_backward_cn.rst | 6 ++ doc/fluid/api_cn/static_cn/data_cn.rst | 64 +------------------ .../static_cn/default_main_program_cn.rst | 5 ++ .../static_cn/default_startup_program_cn.rst | 5 ++ .../api_cn/static_cn/global_scope_cn.rst | 5 ++ doc/fluid/api_cn/static_cn/gradients_cn.rst | 5 ++ doc/fluid/api_cn/static_cn/load_cn.rst | 5 ++ doc/fluid/api_cn/static_cn/name_scope_cn.rst | 5 ++ .../api_cn/static_cn/program_guard_cn.rst | 5 ++ doc/fluid/api_cn/static_cn/py_func_cn.rst | 5 ++ doc/fluid/api_cn/static_cn/save_cn.rst | 5 ++ doc/fluid/api_cn/static_cn/scope_guard_cn.rst | 5 ++ 21 files changed, 98 insertions(+), 64 deletions(-) create mode 100644 doc/fluid/api_cn/static_cn/BuildStrategy_cn.rst create mode 100644 doc/fluid/api_cn/static_cn/CompiledProgram_cn.rst create mode 100644 doc/fluid/api_cn/static_cn/ExecutionStrategy_cn.rst create mode 100644 doc/fluid/api_cn/static_cn/Executor_cn.rst create mode 100644 doc/fluid/api_cn/static_cn/ParallelExecutor_cn.rst create mode 100644 doc/fluid/api_cn/static_cn/Print_cn.rst create mode 100644 doc/fluid/api_cn/static_cn/Program_cn.rst create mode 100644 doc/fluid/api_cn/static_cn/WeightNormParamAttr_cn.rst create mode 100644 doc/fluid/api_cn/static_cn/append_backward_cn.rst create mode 100644 doc/fluid/api_cn/static_cn/default_main_program_cn.rst create mode 100644 doc/fluid/api_cn/static_cn/default_startup_program_cn.rst create mode 100644 doc/fluid/api_cn/static_cn/global_scope_cn.rst create mode 100644 doc/fluid/api_cn/static_cn/gradients_cn.rst create mode 100644 doc/fluid/api_cn/static_cn/load_cn.rst create mode 100644 doc/fluid/api_cn/static_cn/name_scope_cn.rst create mode 100644 doc/fluid/api_cn/static_cn/program_guard_cn.rst create mode 100644 doc/fluid/api_cn/static_cn/py_func_cn.rst create mode 100644 doc/fluid/api_cn/static_cn/save_cn.rst create mode 100644 doc/fluid/api_cn/static_cn/scope_guard_cn.rst diff --git a/doc/fluid/api_cn/static_cn/BuildStrategy_cn.rst b/doc/fluid/api_cn/static_cn/BuildStrategy_cn.rst new file mode 100644 index 000000000..284ee3ee5 --- /dev/null +++ b/doc/fluid/api_cn/static_cn/BuildStrategy_cn.rst @@ -0,0 +1,5 @@ +.. _cn_api_static_cn_BuildStrategy: + +BuildStrategy +------------------------------ +:doc_source: paddle.fluid.BuildStrategy \ No newline at end of file diff --git a/doc/fluid/api_cn/static_cn/CompiledProgram_cn.rst b/doc/fluid/api_cn/static_cn/CompiledProgram_cn.rst new file mode 100644 index 000000000..7788a6570 --- /dev/null +++ b/doc/fluid/api_cn/static_cn/CompiledProgram_cn.rst @@ -0,0 +1,5 @@ +.. _cn_api_static_cn_CompiledProgram: + +CompiledProgram +------------------------------ +:doc_source: paddle.fluid.CompiledProgram \ No newline at end of file diff --git a/doc/fluid/api_cn/static_cn/ExecutionStrategy_cn.rst b/doc/fluid/api_cn/static_cn/ExecutionStrategy_cn.rst new file mode 100644 index 000000000..bbe41192f --- /dev/null +++ b/doc/fluid/api_cn/static_cn/ExecutionStrategy_cn.rst @@ -0,0 +1,5 @@ +.. _cn_api_static_cn_ExecutionStrategy: + +ExecutionStrategy +------------------------------ +:doc_source: paddle.fluid.ExecutionStrategy \ No newline at end of file diff --git a/doc/fluid/api_cn/static_cn/Executor_cn.rst b/doc/fluid/api_cn/static_cn/Executor_cn.rst new file mode 100644 index 000000000..6e9907117 --- /dev/null +++ b/doc/fluid/api_cn/static_cn/Executor_cn.rst @@ -0,0 +1,5 @@ +.. _cn_api_static_cn_Executor: + +Executor +------------------------------ +:doc_source: paddle.fluid.Executor \ No newline at end of file diff --git a/doc/fluid/api_cn/static_cn/InputSpec_cn.rst b/doc/fluid/api_cn/static_cn/InputSpec_cn.rst index 528f681e6..32d23ac94 100644 --- a/doc/fluid/api_cn/static_cn/InputSpec_cn.rst +++ b/doc/fluid/api_cn/static_cn/InputSpec_cn.rst @@ -1,4 +1,4 @@ -.. _cn_api_static_cn_data: +.. _cn_api_static_cn_InputSpec: InputSpec ------------------------------- diff --git a/doc/fluid/api_cn/static_cn/ParallelExecutor_cn.rst b/doc/fluid/api_cn/static_cn/ParallelExecutor_cn.rst new file mode 100644 index 000000000..6c3592ccd --- /dev/null +++ b/doc/fluid/api_cn/static_cn/ParallelExecutor_cn.rst @@ -0,0 +1,5 @@ +.. _cn_api_static_cn_ParallelExecutor: + +ParallelExecutor +------------------------------ +:doc_source: paddle.fluid.ParallelExecutor \ No newline at end of file diff --git a/doc/fluid/api_cn/static_cn/Print_cn.rst b/doc/fluid/api_cn/static_cn/Print_cn.rst new file mode 100644 index 000000000..607fb88ef --- /dev/null +++ b/doc/fluid/api_cn/static_cn/Print_cn.rst @@ -0,0 +1,5 @@ +.. _cn_api_static_cn_Print: + +Print +------------------------------ +:doc_source: paddle.fluid.layers.Print \ No newline at end of file diff --git a/doc/fluid/api_cn/static_cn/Program_cn.rst b/doc/fluid/api_cn/static_cn/Program_cn.rst new file mode 100644 index 000000000..11eee83be --- /dev/null +++ b/doc/fluid/api_cn/static_cn/Program_cn.rst @@ -0,0 +1,5 @@ +.. _cn_api_static_cn_Program: + +Program +------------------------------ +:doc_source: paddle.fluid.Program \ No newline at end of file diff --git a/doc/fluid/api_cn/static_cn/WeightNormParamAttr_cn.rst b/doc/fluid/api_cn/static_cn/WeightNormParamAttr_cn.rst new file mode 100644 index 000000000..5751a1dbe --- /dev/null +++ b/doc/fluid/api_cn/static_cn/WeightNormParamAttr_cn.rst @@ -0,0 +1,5 @@ +.. _cn_api_static_cn_WeightNormParamAttr: + +WeightNormParamAttr +------------------------------ +:doc_source: paddle.fluid.WeightNormParamAttr \ No newline at end of file diff --git a/doc/fluid/api_cn/static_cn/append_backward_cn.rst b/doc/fluid/api_cn/static_cn/append_backward_cn.rst new file mode 100644 index 000000000..aa31fa617 --- /dev/null +++ b/doc/fluid/api_cn/static_cn/append_backward_cn.rst @@ -0,0 +1,6 @@ +.. _cn_api_static_cn_append_backward: + +append_backward +------------------------------ +:doc_source: paddle.fluid.backward.append_backward + diff --git a/doc/fluid/api_cn/static_cn/data_cn.rst b/doc/fluid/api_cn/static_cn/data_cn.rst index 23ae9e3d3..ef138e150 100644 --- a/doc/fluid/api_cn/static_cn/data_cn.rst +++ b/doc/fluid/api_cn/static_cn/data_cn.rst @@ -2,67 +2,5 @@ data ------------------------------- - - -.. py:function:: paddle.static.data(name, shape, dtype='float32', lod_level=0) - - - - -该OP会在全局block中创建变量(Variable),该全局变量可被计算图中的算子(operator)访问。该变量可作为占位符用于数据输入。例如用执行器(Executor)feed数据进该变量 - -注意: - - 不推荐使用 ``paddle.fluid.layers.data`` ,其在之后的版本中会被删除。请使用这个 ``paddle.static.data`` 。 - - ``paddle.fluid.layers.data`` 在组网期间会设置创建的变量维度(shape)和数据类型(dtype),但不会检查输入数据的维度和数据类型是否符合要求。 ``paddle.static.data`` 会在运行过程中由Executor/ParallelExecutor检查输入数据的维度和数据类型。 - - 如果想输入变长输入,可以使用 ``paddle.static.data`` 时将变长维度设为-1,或者直接输入 ``paddle.fluid.layers.data`` 且PaddlePaddle会按具体输入的形状运行。 - - 本API创建的变量默认 ``stop_gradient`` 属性为true,这意味这反向梯度不会被传递过这个数据变量。如果用户想传递反向梯度,可以设置 ``var.stop_gradient = False`` 。 - -参数: - - **name** (str)- 被创建的变量的名字,具体用法请参见 :ref:`api_guide_Name` 。 - - **shape** (list|tuple)- 声明维度信息的list或tuple。 - - **dtype** (np.dtype|VarType|str,可选)- 数据类型,支持bool,float16,float32,float64,int8,int16,int32,int64,uint8。默认值为float32。 - - **lod_level** (int,可选)- LoDTensor变量的LoD level数,LoD level是PaddlePaddle的高级特性,一般任务中不会需要更改此默认值,关于LoD level的详细适用场景和用法请见 :ref:`cn_user_guide_lod_tensor` 。默认值为0。 - -返回:全局变量,可进行数据访问 - -返回类型:Variable - -**代码示例**: - -.. code-block:: python - - import paddle - import paddle.fluid as fluid - import numpy as np - - # Creates a variable with fixed size [3, 2, 1] - # User can only feed data of the same shape to x - x = paddle.static.data(name='x', shape=[3, 2, 1], dtype='float32') - - # Creates a variable with changable batch size -1. - # Users can feed data of any batch size into y, - # but size of each data sample has to be [2, 1] - y = paddle.static.data(name='y', shape=[-1, 2, 1], dtype='float32') - - z = x + y - - # In this example, we will feed x and y with np-ndarray "1" - # and fetch z, like implementing "1 + 1 = 2" in PaddlePaddle - feed_data = np.ones(shape=[3, 2, 1], dtype=np.float32) - - exe = fluid.Executor(fluid.CPUPlace()) - out = exe.run(fluid.default_main_program(), - feed={ - 'x': feed_data, - 'y': feed_data - }, - fetch_list=[z.name]) - - # np-ndarray of shape=[3, 2, 1], dtype=float32, whose elements are 2 - print(out) - +:doc_source: paddle.fluid.data diff --git a/doc/fluid/api_cn/static_cn/default_main_program_cn.rst b/doc/fluid/api_cn/static_cn/default_main_program_cn.rst new file mode 100644 index 000000000..3c9448538 --- /dev/null +++ b/doc/fluid/api_cn/static_cn/default_main_program_cn.rst @@ -0,0 +1,5 @@ +.. _cn_api_static_cn_default_main_program: + +default_main_program +------------------------------ +:doc_source: paddle.fluid.default_main_program \ No newline at end of file diff --git a/doc/fluid/api_cn/static_cn/default_startup_program_cn.rst b/doc/fluid/api_cn/static_cn/default_startup_program_cn.rst new file mode 100644 index 000000000..138946e64 --- /dev/null +++ b/doc/fluid/api_cn/static_cn/default_startup_program_cn.rst @@ -0,0 +1,5 @@ +.. _cn_api_static_cn_default_startup_program: + +default_startup_program +------------------------------ +:doc_source: paddle.fluid.default_startup_program \ No newline at end of file diff --git a/doc/fluid/api_cn/static_cn/global_scope_cn.rst b/doc/fluid/api_cn/static_cn/global_scope_cn.rst new file mode 100644 index 000000000..b868e48c7 --- /dev/null +++ b/doc/fluid/api_cn/static_cn/global_scope_cn.rst @@ -0,0 +1,5 @@ +.. _cn_api_static_cn_global_scope: + +global_scope +------------------------------ +:doc_source: paddle.fluid.global_scope \ No newline at end of file diff --git a/doc/fluid/api_cn/static_cn/gradients_cn.rst b/doc/fluid/api_cn/static_cn/gradients_cn.rst new file mode 100644 index 000000000..3e2c6ad0b --- /dev/null +++ b/doc/fluid/api_cn/static_cn/gradients_cn.rst @@ -0,0 +1,5 @@ +.. _cn_api_static_cn_gradients: + +gradients +------------------------------ +:doc_source: paddle.fluid.backward.gradients \ No newline at end of file diff --git a/doc/fluid/api_cn/static_cn/load_cn.rst b/doc/fluid/api_cn/static_cn/load_cn.rst new file mode 100644 index 000000000..e10eeddf4 --- /dev/null +++ b/doc/fluid/api_cn/static_cn/load_cn.rst @@ -0,0 +1,5 @@ +.. _cn_api_static_cn_load: + +load +------------------------------ +:doc_source: paddle.fluid.load \ No newline at end of file diff --git a/doc/fluid/api_cn/static_cn/name_scope_cn.rst b/doc/fluid/api_cn/static_cn/name_scope_cn.rst new file mode 100644 index 000000000..2722a8f35 --- /dev/null +++ b/doc/fluid/api_cn/static_cn/name_scope_cn.rst @@ -0,0 +1,5 @@ +.. _cn_api_static_cn_name_scope: + +name_scope +------------------------------ +:doc_source: paddle.fluid.name_scope \ No newline at end of file diff --git a/doc/fluid/api_cn/static_cn/program_guard_cn.rst b/doc/fluid/api_cn/static_cn/program_guard_cn.rst new file mode 100644 index 000000000..b9c4c03a5 --- /dev/null +++ b/doc/fluid/api_cn/static_cn/program_guard_cn.rst @@ -0,0 +1,5 @@ +.. _cn_api_static_cn_program_guard: + +program_guard +------------------------------ +:doc_source: paddle.fluid.program_guard \ No newline at end of file diff --git a/doc/fluid/api_cn/static_cn/py_func_cn.rst b/doc/fluid/api_cn/static_cn/py_func_cn.rst new file mode 100644 index 000000000..7c40a2d1f --- /dev/null +++ b/doc/fluid/api_cn/static_cn/py_func_cn.rst @@ -0,0 +1,5 @@ +.. _cn_api_static_cn_py_func: + +py_func +------------------------------ +:doc_source: paddle.fluid.layers.py_func \ No newline at end of file diff --git a/doc/fluid/api_cn/static_cn/save_cn.rst b/doc/fluid/api_cn/static_cn/save_cn.rst new file mode 100644 index 000000000..c4ead3834 --- /dev/null +++ b/doc/fluid/api_cn/static_cn/save_cn.rst @@ -0,0 +1,5 @@ +.. _cn_api_static_cn_save: + +save +------------------------------ +:doc_source: paddle.fluid.save \ No newline at end of file diff --git a/doc/fluid/api_cn/static_cn/scope_guard_cn.rst b/doc/fluid/api_cn/static_cn/scope_guard_cn.rst new file mode 100644 index 000000000..894cca135 --- /dev/null +++ b/doc/fluid/api_cn/static_cn/scope_guard_cn.rst @@ -0,0 +1,5 @@ +.. _cn_api_static_cn_scope_guard: + +scope_guard +------------------------------ +:doc_source: paddle.fluid.executor.scope_guard \ No newline at end of file -- GitLab