Skip to content

Commit

Permalink
Merge pull request #4 from cxxly/science-add-rules-ut
Browse files Browse the repository at this point in the history
fix the document format of enable_prim/disable_prim/prim2orig/prim_enabled
  • Loading branch information
cxxly authored May 17, 2022
2 parents b616351 + 368e9a7 commit d797c21
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions python/paddle/incubate/autograd/primx.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,15 +537,15 @@ def orig2prim(block=None):
def prim2orig(block=None):
"""
.. note::
**This API is ONLY available in the static mode.**
**ONLY available in the static mode.**
All operators in the target block are processed as follows.
If it is an automatic differential basic operator, it will be
transformed into one or a series of original operators with
equivalent function to support execution.
Args:
block(paddle.fluid.framework.Variable|None, optional): The
block(paddle.static.Variable|None, optional): The
target block to process on. Default None, and will
process on the current block of main program.
Expand Down
15 changes: 7 additions & 8 deletions python/paddle/incubate/autograd/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,13 @@ def set_status(self, flag):
def prim_enabled():
"""
.. note::
**This API is ONLY available in the static mode.**
**ONLY available in the static mode.**
This API shows whether the automatic differentiation mechanism based on
Shows whether the automatic differentiation mechanism based on
automatic differential basic operators is ON.
Returns:
flag(bool): whether the automatic differentiation mechanism based on
automatic differential basic operators is ON.
flag(bool): Whether the automatic differentiation mechanism based on automatic differential basic operators is ON. Defaults to False.
Examples:
Expand All @@ -66,9 +65,9 @@ def prim_enabled():
def enable_prim():
"""
.. note::
**This API is ONLY available in the static mode.**
**ONLY available in the static mode.**
This API turns ON automatic differentiation mechanism based on automatic
Turns ON automatic differentiation mechanism based on automatic
differential basic operators.
Examples:
Expand All @@ -90,9 +89,9 @@ def enable_prim():
def disable_prim():
"""
.. note::
**This API is ONLY available in the static mode.**
**ONLY available in the static mode.**
This API turns OFF automatic differentiation mechanism based on automatic
Turns OFF automatic differentiation mechanism based on automatic
differential basic operators.
Examples:
Expand Down

0 comments on commit d797c21

Please sign in to comment.