Skip to content

Commit

Permalink
Enrich English declarative Doc (PaddlePaddle#26538)
Browse files Browse the repository at this point in the history
As the title.
  • Loading branch information
zhhsplendid authored Aug 25, 2020
1 parent ef317b4 commit 26d6741
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions python/paddle/fluid/dygraph/jit.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,16 @@ def _declarative_(dygraph_func):
"""
Converts imperative dygraph APIs into declarative function APIs. Decorator
@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:
dygraph_func (callable): callable imperative function.
Returns:
VarBase: containing the numerical result.
Tensor(s): containing the numerical result.
Examples:
.. code-block:: python
Expand All @@ -147,6 +150,7 @@ def _declarative_(dygraph_func):
import numpy as np
from paddle.fluid.dygraph.jit import declarative
fluid.enable_dygraph()
@declarative
def func(x):
Expand Down

0 comments on commit 26d6741

Please sign in to comment.