Skip to content

Commit

Permalink
Cherry pick to update 1.2 (PaddlePaddle#458)
Browse files Browse the repository at this point in the history
* delete en2zn link

* 1207

 1.english api reference links removed
2. formatted

* update transpiler

* update profilse_cn
  • Loading branch information
tink2123 authored and shanyi15 committed Dec 7, 2018
1 parent 8755edd commit 9aece65
Show file tree
Hide file tree
Showing 19 changed files with 2,429 additions and 1,100 deletions.
5 changes: 0 additions & 5 deletions doc/fluid/api/gen_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ def print_class(self, name):
:noindex:
'''.format(self.module_name, name))
self._print_cn_ref(name)

def print_method(self, name):
self._print_ref_(name)
Expand All @@ -95,7 +94,6 @@ def print_method(self, name):
:noindex:
'''.format(self.module_name, name))
self._print_cn_ref(name)

def _print_header_(self, name, dot, is_title):
dot_line = dot * len(name)
Expand All @@ -111,9 +109,6 @@ def _print_header_(self, name, dot, is_title):
def _print_ref_(self, name):
self.stream.write(".. _api_{0}_{1}:\n\n".format("_".join(
self.module_name.split(".")), name))
def _print_cn_ref(self, name):
self.stream.write("Read Chinese Version: :ref:`cn_api_{0}_{1}`\n\n".format("_".join(
self.module_name.split(".")),name))


def main():
Expand Down
7 changes: 4 additions & 3 deletions doc/fluid/api_cn/average_cn.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#################
fluid.average
#################
Expand All @@ -8,7 +7,7 @@
.. _cn_api_fluid_average_WeightedAverage:

WeightedAverage
>>>>>>>>>>>>>>>>>>>>>>>>>>
-------------------------------

.. py:class:: paddle.fluid.average.WeightedAverage
Expand Down Expand Up @@ -65,5 +64,7 @@ WeightedAverage
英文版API文档: :ref:`api_fluid_average_WeightedAverage`
7 changes: 4 additions & 3 deletions doc/fluid/api_cn/backward_cn.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#################
fluid.backward
#################
Expand All @@ -8,7 +7,7 @@
.. _cn_api_fluid_backward_append_backward:

append_backward
>>>>>>>>>>>>>>>>>>>>>>>>>>
-------------------------------

.. py:function:: paddle.fluid.backward.append_backward(loss, parameter_list=None, no_grad_set=None, callbacks=None)
Expand Down Expand Up @@ -86,5 +85,7 @@ append_backward
英文版API文档: :ref:`api_fluid_backward_append_backward`
25 changes: 16 additions & 9 deletions doc/fluid/api_cn/clip_cn.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#################
fluid.clip
#################
Expand All @@ -8,7 +7,7 @@
.. _cn_api_fluid_clip_ErrorClipByValue:

ErrorClipByValue
>>>>>>>>>>>>
-------------------------------

.. py:class:: paddle.fluid.clip.ErrorClipByValue(max, min=None)
Expand All @@ -34,12 +33,14 @@ ErrorClipByValue
英文版API文档: :ref:`api_fluid_clip_ErrorClipByValue`
.. _cn_api_fluid_clip_GradientClipByGlobalNorm:

GradientClipByGlobalNorm
>>>>>>>>>>>>
-------------------------------

.. py:class:: paddle.fluid.clip.GradientClipByGlobalNorm(clip_norm, group_name='default_group')
Expand Down Expand Up @@ -78,12 +79,14 @@ GradientClipByGlobalNorm
英文版API文档: :ref:`api_fluid_clip_GradientClipByGlobalNorm`
.. _cn_api_fluid_clip_GradientClipByNorm:

GradientClipByNorm
>>>>>>>>>>>>
-------------------------------

.. py:class:: paddle.fluid.clip.GradientClipByNorm(clip_norm)
Expand Down Expand Up @@ -116,12 +119,14 @@ GradientClipByNorm
英文版API文档: :ref:`api_fluid_clip_GradientClipByNorm`
.. _cn_api_fluid_clip_GradientClipByValue:

GradientClipByValue
>>>>>>>>>>>>
-------------------------------

.. py:class:: paddle.fluid.clip.GradientClipByValue(max, min=None)
Expand Down Expand Up @@ -152,5 +157,7 @@ GradientClipByValue
英文版API文档: :ref:`api_fluid_clip_GradientClipByValue`
21 changes: 11 additions & 10 deletions doc/fluid/api_cn/data_feeder_cn.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@

#################
fluid.data_feeder
#################
###################
fluid.data_feeder
###################



.. _cn_api_fluid_data_feeder_DataFeeder:

DataFeeder
>>>>>>>>>>>>>>>>>
-------------------------------

.. py:class:: paddle.fluid.data_feeder.DataFeeder(feed_list, place, program=None)
Expand Down Expand Up @@ -101,10 +100,10 @@ reader通常返回一个minibatch条目列表。在列表中每一条目都是
将reader返回的输入数据batch转换为多个mini-batch,之后每个mini-batch都会被输入进各个设备(CPU或GPU)中。

参数:
- **reader** (fun) – 待输入的数据
- **multi_devices** (bool) – 执行场所的数目,默认为None
- **num_places** (int) – 执行场所的数目,默认为None
- **drop_last** (bool) – 舍弃数目匹配不上的batch或设备
- **reader** (fun) – 该参数是一个可以生成数据的函数
- **multi_devices** (bool) – bool型,指明是否使用多个设备
- **num_places** (int) – 如果 ``multi_devices`` 为 ``True`` , 可以使用此参数来设置GPU数目。如果 ``num_places`` 为 ``None`` ,该函数默认使用当前训练机所有GPU设备。默认为None
- **drop_last** (bool) – 如果最后一个batch的大小比 ``batch_size`` 要小,则可使用该参数来指明是否选择丢弃最后一个batch数据。 默认为 ``True``

返回:转换结果

Expand All @@ -117,5 +116,7 @@ reader通常返回一个minibatch条目列表。在列表中每一条目都是



英文版API文档: :ref:`api_fluid_data_feeder_DataFeeder`




66 changes: 62 additions & 4 deletions doc/fluid/api_cn/executor_cn.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@

#################
fluid.executor
#################



.. _cn_api_fluid_executor:
.. _cn_api_fluid_executor_Executor:

Executor
>>>>>>>>>>>>>>>>>>>>>
-------------------------------


.. py:class:: paddle.fluid.executor.Executor (place)
Expand Down Expand Up @@ -107,5 +106,64 @@ feed map为该program提供输入数据。fetch_list提供program训练结束后
英文版API文档: :ref:`api_fluid_executor`
.. _cn_api_fluid_executor_global_scope:

global_scope
-------------------------------

.. py:function:: paddle.fluid.global_scope()
获取全局/默认作用域实例。很多api使用默认 ``global_scope`` ,例如 ``Executor.run`` 。

返回:全局/默认作用域实例

返回类型:Scope






.. _cn_api_fluid_executor_scope_guard:

scope_guard
-------------------------------

.. py:function:: paddle.fluid.scope_guard(*args, **kwds)
修改全局/默认作用域(scope), 运行时中的所有变量都将分配给新的scope。

参数:
- **scope** - 新的全局/默认 scope。

**代码示例**

.. code-block:: python
import paddle.fluid as fluid
new_scope = fluid.Scope()
with fluid.scope_guard(new_scope):
...
Loading

0 comments on commit 9aece65

Please sign in to comment.