未验证 提交 8d4bd1ac 编写于 作者: L liym27 提交者: GitHub

[Dy2Stat-API] Add Chinese doc of api set_verbosity and set_code_level (#2593)

上级 2870469b
...@@ -6,5 +6,7 @@ jit ...@@ -6,5 +6,7 @@ jit
:maxdepth: 1 :maxdepth: 1
jit_cn/save_cn.rst jit_cn/save_cn.rst
jit_cn/set_code_level_cn.rst
jit_cn/set_verbosity_cn.rst
jit_cn/load_cn.rst jit_cn/load_cn.rst
jit_cn/SaveLoadConfig_cn.rst jit_cn/SaveLoadConfig_cn.rst
.. _cn_api_fluid_dygraph_jit_set_code_level:
set_code_level
-----------------
.. py:function:: paddle.fluid.dygraph.jit.set_code_level(level=100)
设置代码级别,打印该级别 AST Transformer 转化后的代码。
有两种方法设置代码级别:
1. 调用函数 ``set_code_level``
2. 设置环境变量 ``TRANSLATOR_CODE_LEVEL``
.. note::
函数 ``set_code_level`` 的优先级高于环境变量 ``TRANSLATOR_CODE_LEVEL``。
参数:
- **level** (int) - 打印的代码级别。默认值为100,这意味着打印的是所有 AST Transformer 转化后的代码。
**示例代码**
.. code-block:: python
import os
import paddle
paddle.jit.set_code_level(2)
# It will print the transformed code at level 2, which means to print the code after second transformer,
# as the date of August 28, 2020, it is CastTransformer.
os.environ['TRANSLATOR_CODE_LEVEL'] = '3'
# The code level is now 3, but it has no effect because it has a lower priority than `set_code_level`
.. _cn_api_fluid_dygraph_jit_set_verbosity:
set_verbosity
-----------------
.. py:function:: paddle.fluid.dygraph.jit.set_verbosity(level=0)
设置动态图转静态图的日志详细级别。
有两种方法设置日志详细级别:
1. 调用函数 ``set_verbosity``
2. 设置环境变量 ``TRANSLATOR_VERBOSITY``
.. note::
函数 ``set_verbosity`` 的优先级高于环境变量 ``TRANSLATOR_VERBOSITY``。
参数:
- **level** (int) - 日志详细级别。值越大,表示越详细。默认值为0,表示不显示日志。
**示例代码**
.. code-block:: python
import os
import paddle
paddle.jit.set_verbosity(1)
# The verbosity level is now 1
os.environ['TRANSLATOR_VERBOSITY'] = '3'
# The verbosity level is now 3, but it has no effect because it has a lower priority than `set_verbosity`
...@@ -6,5 +6,7 @@ jit ...@@ -6,5 +6,7 @@ jit
:maxdepth: 1 :maxdepth: 1
jit_cn/save_cn.rst jit_cn/save_cn.rst
jit_cn/set_code_level_cn.rst
jit_cn/set_verbosity.rst
jit_cn/load_cn.rst jit_cn/load_cn.rst
jit_cn/SaveLoadConfig_cn.rst jit_cn/SaveLoadConfig_cn.rst
\ No newline at end of file
.. _cn_api_imperative_jit_set_code_level:
set_code_level
-------------------------------
:doc_source: paddle.fluid.dygraph.jit.set_code_level
\ No newline at end of file
.. _cn_api_imperative_jit_set_verbosity:
set_verbosity
-------------------------------
:doc_source: paddle.fluid.dygraph.jit.set_verbosity
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册