From 3cc160323a8f52e8b1421bf7f011e0959505a4a3 Mon Sep 17 00:00:00 2001 From: Ryan <44900829+DrRyanHuang@users.noreply.github.com> Date: Tue, 12 Sep 2023 19:47:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20enable=5Fto=5Fstatic=20?= =?UTF-8?q?=E7=9A=84=E4=B8=AD=E6=96=87=E6=96=87=E6=A1=A3=20(#6179)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add enable_to_static_cn * change overview: * Apply suggestions from code review Co-authored-by: Nyakku Shigure * Apply suggestions from code review Co-authored-by: Nyakku Shigure * add True/False meaning * Apply suggestions from code review Co-authored-by: Nyakku Shigure --------- Co-authored-by: Nyakku Shigure --- docs/api/paddle/jit/Overview_cn.rst | 1 + docs/api/paddle/jit/enable_to_static_cn.rst | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 docs/api/paddle/jit/enable_to_static_cn.rst 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: 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..31fabd19e00 --- /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(enable_to_static_bool) + +全局启用或禁用从动态图到静态图的转换。 + + +参数 +:::::::::::: + + - **enable_to_static_bool** (bool) - 启用或禁用动转静。为 ``True`` 时启用动转静, 为 ``False`` 时关闭动转静。 + + +代码示例 +:::::::::::: + +COPY-FROM: paddle.jit.enable_to_static