From 432704c09291196466ebd00f209562adc3eac716 Mon Sep 17 00:00:00 2001 From: DrRyanHuang Date: Sun, 10 Sep 2023 22:40:30 +0800 Subject: [PATCH 1/6] add enable_to_static_cn --- docs/api/paddle/jit/enable_to_static_cn.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 docs/api/paddle/jit/enable_to_static_cn.rst diff --git a/docs/api/paddle/jit/enable_to_static_cn.rst b/docs/api/paddle/jit/enable_to_static_cn.rst new file mode 100644 index 00000000000..7d6b1b5995e --- /dev/null +++ b/docs/api/paddle/jit/enable_to_static_cn.rst @@ -0,0 +1,20 @@ +.. _cn_api_paddle_jit_enable_to_static: + +enable_to_static +------------------------------- + +.. py:function:: paddle.jit.enable_to_static + +全局启用或禁用 `ProgramTranslator` 从动态图到静态图的转换。 + + +参数 +:::::::::::: + + - **enable_to_static_bool** (bool) - 启用或禁用转换为静态。 + + +代码示例 +:::::::::::: + +COPY-FROM: paddle.jit.enable_to_static From 5ea38d43a7ebefbffc9d2d7146ce39e663b3ef6f Mon Sep 17 00:00:00 2001 From: DrRyanHuang Date: Sun, 10 Sep 2023 22:52:06 +0800 Subject: [PATCH 2/6] change overview: --- docs/api/paddle/jit/Overview_cn.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/api/paddle/jit/Overview_cn.rst b/docs/api/paddle/jit/Overview_cn.rst index bf55ee4ab67..48452c838c2 100644 --- a/docs/api/paddle/jit/Overview_cn.rst +++ b/docs/api/paddle/jit/Overview_cn.rst @@ -24,6 +24,7 @@ paddle.jit 目录下包含飞桨框架支持动态图转静态图相关的 API " :ref:`load ` ", "动转静模型载入接口" " :ref:`ignore_module ` ", "增加动转静过程中忽略转写的模块" " :ref:`TranslatedLayer ` ", "是一个命令式编程模式 :ref:`cn_api_paddle_nn_Layer` 的继承类" + " :ref:`enable_to_static ` ", "开启模型动转静功能接口" .. _about_debug: From 2baaf759dba9d52b6fdd489290d2aabf7aef5060 Mon Sep 17 00:00:00 2001 From: Ryan <44900829+DrRyanHuang@users.noreply.github.com> Date: Mon, 11 Sep 2023 09:52:28 +0800 Subject: [PATCH 3/6] Apply suggestions from code review Co-authored-by: Nyakku Shigure --- docs/api/paddle/jit/enable_to_static_cn.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api/paddle/jit/enable_to_static_cn.rst b/docs/api/paddle/jit/enable_to_static_cn.rst index 7d6b1b5995e..73418555a0f 100644 --- a/docs/api/paddle/jit/enable_to_static_cn.rst +++ b/docs/api/paddle/jit/enable_to_static_cn.rst @@ -5,13 +5,13 @@ enable_to_static .. py:function:: paddle.jit.enable_to_static -全局启用或禁用 `ProgramTranslator` 从动态图到静态图的转换。 +全局启用或禁用从动态图到静态图的转换。 参数 :::::::::::: - - **enable_to_static_bool** (bool) - 启用或禁用转换为静态。 + - **enable_to_static_bool** (bool) - 启用或禁用动转静。 代码示例 From dfc77841dd41b7db4e296fc400f191ac087f7369 Mon Sep 17 00:00:00 2001 From: Ryan <44900829+DrRyanHuang@users.noreply.github.com> Date: Mon, 11 Sep 2023 10:21:41 +0800 Subject: [PATCH 4/6] Apply suggestions from code review Co-authored-by: Nyakku Shigure --- docs/api/paddle/jit/enable_to_static_cn.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api/paddle/jit/enable_to_static_cn.rst b/docs/api/paddle/jit/enable_to_static_cn.rst index 73418555a0f..47bfa20640a 100644 --- a/docs/api/paddle/jit/enable_to_static_cn.rst +++ b/docs/api/paddle/jit/enable_to_static_cn.rst @@ -3,7 +3,7 @@ enable_to_static ------------------------------- -.. py:function:: paddle.jit.enable_to_static +.. py:function:: paddle.jit.enable_to_static(enable_to_static_bool) 全局启用或禁用从动态图到静态图的转换。 From f6e2f157ae2ecc87410530f48b7861dfdc48d33b Mon Sep 17 00:00:00 2001 From: Ryan <44900829+DrRyanHuang@users.noreply.github.com> Date: Mon, 11 Sep 2023 17:22:37 +0800 Subject: [PATCH 5/6] add True/False meaning --- docs/api/paddle/jit/enable_to_static_cn.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api/paddle/jit/enable_to_static_cn.rst b/docs/api/paddle/jit/enable_to_static_cn.rst index 47bfa20640a..0c689bbbf0b 100644 --- a/docs/api/paddle/jit/enable_to_static_cn.rst +++ b/docs/api/paddle/jit/enable_to_static_cn.rst @@ -11,7 +11,7 @@ enable_to_static 参数 :::::::::::: - - **enable_to_static_bool** (bool) - 启用或禁用动转静。 + - **enable_to_static_bool** (bool) - 启用或禁用动转静。为 `True` 时启用动转静, 为 `False` 时关闭动转静。 代码示例 From cc746db425f78eac272a7b51fdea4473c4546208 Mon Sep 17 00:00:00 2001 From: Ryan <44900829+DrRyanHuang@users.noreply.github.com> Date: Mon, 11 Sep 2023 18:37:47 +0800 Subject: [PATCH 6/6] Apply suggestions from code review Co-authored-by: Nyakku Shigure --- docs/api/paddle/jit/enable_to_static_cn.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api/paddle/jit/enable_to_static_cn.rst b/docs/api/paddle/jit/enable_to_static_cn.rst index 0c689bbbf0b..31fabd19e00 100644 --- a/docs/api/paddle/jit/enable_to_static_cn.rst +++ b/docs/api/paddle/jit/enable_to_static_cn.rst @@ -11,7 +11,7 @@ enable_to_static 参数 :::::::::::: - - **enable_to_static_bool** (bool) - 启用或禁用动转静。为 `True` 时启用动转静, 为 `False` 时关闭动转静。 + - **enable_to_static_bool** (bool) - 启用或禁用动转静。为 ``True`` 时启用动转静, 为 ``False`` 时关闭动转静。 代码示例