diff --git a/doc/fluid/api_cn/dygraph_cn/jit_cn.rst b/doc/fluid/api_cn/dygraph_cn/jit_cn.rst index 4a9b90d5cab6ce86a1bd7689676e3ad844eae8ee..6899679ce577b0ae25304c638fa9a618b8e060cd 100644 --- a/doc/fluid/api_cn/dygraph_cn/jit_cn.rst +++ b/doc/fluid/api_cn/dygraph_cn/jit_cn.rst @@ -6,5 +6,7 @@ jit :maxdepth: 1 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/SaveLoadConfig_cn.rst diff --git a/doc/fluid/api_cn/dygraph_cn/jit_cn/set_code_level_cn.rst b/doc/fluid/api_cn/dygraph_cn/jit_cn/set_code_level_cn.rst new file mode 100644 index 0000000000000000000000000000000000000000..73b0830cdb7655a5b5246cdd95831264ef77d847 --- /dev/null +++ b/doc/fluid/api_cn/dygraph_cn/jit_cn/set_code_level_cn.rst @@ -0,0 +1,34 @@ +.. _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` diff --git a/doc/fluid/api_cn/dygraph_cn/jit_cn/set_verbosity_cn.rst b/doc/fluid/api_cn/dygraph_cn/jit_cn/set_verbosity_cn.rst new file mode 100644 index 0000000000000000000000000000000000000000..c185e94e5d28dc8ada4c7a8af854c83bbcc557bf --- /dev/null +++ b/doc/fluid/api_cn/dygraph_cn/jit_cn/set_verbosity_cn.rst @@ -0,0 +1,35 @@ +.. _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` + + diff --git a/doc/fluid/api_cn/imperative_cn/jit_cn.rst b/doc/fluid/api_cn/imperative_cn/jit_cn.rst index 491ead2e2f4d51993ca9579301d0e3fbfaba1253..baa8019a5285b3dd667fec3921097c54e37b45ee 100644 --- a/doc/fluid/api_cn/imperative_cn/jit_cn.rst +++ b/doc/fluid/api_cn/imperative_cn/jit_cn.rst @@ -6,5 +6,7 @@ jit :maxdepth: 1 jit_cn/save_cn.rst + jit_cn/set_code_level_cn.rst + jit_cn/set_verbosity.rst jit_cn/load_cn.rst - jit_cn/SaveLoadConfig_cn.rst \ No newline at end of file + jit_cn/SaveLoadConfig_cn.rst diff --git a/doc/fluid/api_cn/imperative_cn/jit_cn/set_code_level_cn.rst b/doc/fluid/api_cn/imperative_cn/jit_cn/set_code_level_cn.rst new file mode 100644 index 0000000000000000000000000000000000000000..e57014212735b9c3e7610ad9221e96439960f90b --- /dev/null +++ b/doc/fluid/api_cn/imperative_cn/jit_cn/set_code_level_cn.rst @@ -0,0 +1,5 @@ +.. _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 diff --git a/doc/fluid/api_cn/imperative_cn/jit_cn/set_verbosity_cn.rst b/doc/fluid/api_cn/imperative_cn/jit_cn/set_verbosity_cn.rst new file mode 100644 index 0000000000000000000000000000000000000000..a20b6c67dd4472da83ecabcbaad519cabce0f3c9 --- /dev/null +++ b/doc/fluid/api_cn/imperative_cn/jit_cn/set_verbosity_cn.rst @@ -0,0 +1,5 @@ +.. _cn_api_imperative_jit_set_verbosity: + +set_verbosity +------------------------------- +:doc_source: paddle.fluid.dygraph.jit.set_verbosity \ No newline at end of file