未验证 提交 26d67414 编写于 作者: H Huihuang Zheng 提交者: GitHub

Enrich English declarative Doc (#26538)

As the title.
上级 ef317b4b
...@@ -132,13 +132,16 @@ def _declarative_(dygraph_func): ...@@ -132,13 +132,16 @@ def _declarative_(dygraph_func):
""" """
Converts imperative dygraph APIs into declarative function APIs. Decorator Converts imperative dygraph APIs into declarative function APIs. Decorator
@declarative handles the Program and Executor of static mode and returns @declarative handles the Program and Executor of static mode and returns
the result as a dygraph VarBase. the result as dygraph Tensor(s). Users could use the returned dygraph
Tensor(s) to do imperative training, inference, or other operations. If the
decorated function calls other imperative function, the called one will be
converted into declarative function as well.
Args: Args:
dygraph_func (callable): callable imperative function. dygraph_func (callable): callable imperative function.
Returns: Returns:
VarBase: containing the numerical result. Tensor(s): containing the numerical result.
Examples: Examples:
.. code-block:: python .. code-block:: python
...@@ -147,6 +150,7 @@ def _declarative_(dygraph_func): ...@@ -147,6 +150,7 @@ def _declarative_(dygraph_func):
import numpy as np import numpy as np
from paddle.fluid.dygraph.jit import declarative from paddle.fluid.dygraph.jit import declarative
fluid.enable_dygraph()
@declarative @declarative
def func(x): def func(x):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册